Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
467 changes: 447 additions & 20 deletions lib/builtin.js

Large diffs are not rendered by default.

375 changes: 342 additions & 33 deletions lib/generator.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function _type(name, variable = false) {
return 'Number';
}

if (name === 'integer' || name === 'int32') {
if (name === 'integer' || name === 'int32' || name === 'int8' || name === 'int16' || name === 'uint8' || name === 'uint16' || name === 'uint32') {
if (variable) {
return 'int';
}
Expand All @@ -100,7 +100,7 @@ function _type(name, variable = false) {
return 'java.io.OutputStream';
}

if (name === 'long' | name === 'int64') {
if (name === 'long' | name === 'int64' || name === 'uint64' || name === 'ulong') {
if (variable) {
return 'long';
}
Expand Down
47 changes: 39 additions & 8 deletions test/fixtures/api/Client.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.test;

import com.aliyun.tea.*;
import com.aliyun.tea.interceptor.InterceptorChain;
import com.aliyun.tea.interceptor.RuntimeOptionsInterceptor;
import com.aliyun.tea.interceptor.RequestInterceptor;
import com.aliyun.tea.interceptor.ResponseInterceptor;
import com.aliyun.darabonba.*;
import com.aliyun.darabonba.interceptor.InterceptorChain;
import com.aliyun.darabonba.interceptor.RuntimeOptionsInterceptor;
import com.aliyun.darabonba.interceptor.RequestInterceptor;
import com.aliyun.darabonba.interceptor.ResponseInterceptor;
import com.aliyun.test.models.*;
import com.aliyun.teautil.*;
import com.aliyun.teautil.models.*;

public class Client {

private final static InterceptorChain interceptorChain = InterceptorChain.create();

public String _httpProxy;
public String _httpsProxy;
public String _socks5Proxy;
public String _socks5NetWork;
public Integer _maxIdleConns;
public Integer _readTimeout;
public Integer _connectTimeout;
public String _noProxy;
public String _key;
public String _cert;
public String _ca;
public $RetryOptions _retryOptions;
public Client(Config config) throws Exception {
}

Expand All @@ -27,8 +41,22 @@ public void hello() throws Exception {
return ;
}

public void helloRuntime() throws Exception {
java.util.Map<String, Object> runtime_ = new java.util.HashMap<>();
public String helloRuntime(String bodyType, RuntimeOptions runtime) throws Exception {
java.util.Map<String, Object> runtime_ = TeaConverter.buildMap(
new TeaPair("key", com.aliyun.teautil.Common.defaultString(runtime.key, _key)),
new TeaPair("cert", com.aliyun.teautil.Common.defaultString(runtime.cert, _cert)),
new TeaPair("ca", com.aliyun.teautil.Common.defaultString(runtime.ca, _ca)),
new TeaPair("readTimeout", com.aliyun.teautil.Common.defaultNumber(runtime.readTimeout, _readTimeout)),
new TeaPair("connectTimeout", com.aliyun.teautil.Common.defaultNumber(runtime.connectTimeout, _connectTimeout)),
new TeaPair("httpProxy", com.aliyun.teautil.Common.defaultString(runtime.httpProxy, _httpProxy)),
new TeaPair("httpsProxy", com.aliyun.teautil.Common.defaultString(runtime.httpsProxy, _httpsProxy)),
new TeaPair("noProxy", com.aliyun.teautil.Common.defaultString(runtime.noProxy, _noProxy)),
new TeaPair("socks5Proxy", com.aliyun.teautil.Common.defaultString(runtime.socks5Proxy, _socks5Proxy)),
new TeaPair("socks5NetWork", com.aliyun.teautil.Common.defaultString(runtime.socks5NetWork, _socks5NetWork)),
new TeaPair("maxIdleConns", com.aliyun.teautil.Common.defaultNumber(runtime.maxIdleConns, _maxIdleConns)),
new TeaPair("retryOptions", _retryOptions),
new TeaPair("ignoreSSL", runtime.ignoreSSL)
);

TeaRequest _lastRequest = null;
Exception _lastException = null;
Expand All @@ -52,7 +80,7 @@ public void helloRuntime() throws Exception {
_lastRequest = request_;
TeaResponse response_ = Tea.doAction(request_, runtime_, interceptorChain);

return ;
return "test";
} catch (Exception e) {
if (Tea.isRetryable(e)) {
_lastException = e;
Expand Down Expand Up @@ -89,4 +117,7 @@ public void addResponseInterceptor(ResponseInterceptor interceptor) {
interceptorChain.addResponseInterceptor(interceptor);
}

public vno vnoPayCallBackNotifyEx() throws Exception {
return null;
}
}
Loading