6
0
Fork 0

Merge tag '0.3.8' into develop

master
nishengli 2 years ago
commit 9e6c91e5b3
  1. 2
      pom.xml
  2. 3
      src/main/java/com/tsl3060/open/extend/core/ApiClient.java
  3. 9
      src/main/java/com/tsl3060/open/extend/core/Config.java

@ -6,7 +6,7 @@
<groupId>com.tsl3060.open.extend</groupId>
<artifactId>tsl-open-sdk-java-wanshun</artifactId>
<version>0.3.7</version>
<version>0.3.8</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>

@ -21,6 +21,7 @@ import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
public class ApiClient {
@ -140,6 +141,8 @@ public class ApiClient {
.post(requestBody)
.build();
OkHttpClient.Builder builder = new OkHttpClient.Builder();
//设置连接超时时间
builder.connectTimeout(this.config.getTimeout(), TimeUnit.MILLISECONDS);
OkHttpClient okHttpClient = builder.build();
try {
Call call = okHttpClient.newCall(request);

@ -19,6 +19,15 @@ public class Config {
private String host = "https://open.tsl3060.com";
private String dataFormat = "yyyy-MM-dd HH:mm:ss";
private int timeout = 25000;
public int getTimeout() {
return timeout;
}
public void setTimeout(int timeout) {
this.timeout = timeout;
}
public String getPrivateKey() {
return privateKey;

Loading…
Cancel
Save