|
|
@@ -8,13 +8,21 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
@Slf4j
|
|
|
@Component
|
|
|
public class WeComThirdPartyApiClient {
|
|
|
|
|
|
private static final MediaType JSON = MediaType.get("application/json; charset=utf-8");
|
|
|
- private final OkHttpClient client = new OkHttpClient();
|
|
|
+ private final OkHttpClient client;
|
|
|
+
|
|
|
+ {
|
|
|
+ client = new OkHttpClient().newBuilder()
|
|
|
+ .connectTimeout(3, TimeUnit.MINUTES)
|
|
|
+ .readTimeout(3, TimeUnit.MINUTES)
|
|
|
+ .writeTimeout(3, TimeUnit.MINUTES).build();
|
|
|
+ }
|
|
|
|
|
|
@Value("${wecom.thirdpart.baseUrl:http://47.96.102.58:8083}")
|
|
|
private String baseUrl;
|