Skip to content

Commit 6b7c86d

Browse files
author
ecoolper
committed
添加枚举HttpType
1 parent 2384b4b commit 6b7c86d

File tree

6 files changed

+35
-0
lines changed

6 files changed

+35
-0
lines changed

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/apache/WxCpServiceImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import me.chanjar.weixin.common.bean.WxAccessToken;
55
import me.chanjar.weixin.common.bean.result.WxError;
66
import me.chanjar.weixin.common.exception.WxErrorException;
7+
import me.chanjar.weixin.common.util.http.HttpType;
78
import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
89
import me.chanjar.weixin.common.util.http.apache.DefaultApacheHttpClientBuilder;
910
import me.chanjar.weixin.cp.api.WxCpConfigStorage;
@@ -32,6 +33,11 @@ public HttpHost getRequestHttpProxy() {
3233
return httpProxy;
3334
}
3435

36+
@Override
37+
public HttpType getRequestType() {
38+
return HttpType.apacheHttp;
39+
}
40+
3541
@Override
3642
public String getAccessToken(boolean forceRefresh) throws WxErrorException {
3743
if (forceRefresh) {

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/jodd/WxCpServiceImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import me.chanjar.weixin.common.bean.WxAccessToken;
55
import me.chanjar.weixin.common.bean.result.WxError;
66
import me.chanjar.weixin.common.exception.WxErrorException;
7+
import me.chanjar.weixin.common.util.http.HttpType;
78
import me.chanjar.weixin.cp.api.WxCpConfigStorage;
89
import me.chanjar.weixin.cp.api.impl.AbstractWxCpServiceImpl;
910

@@ -22,6 +23,11 @@ public ProxyInfo getRequestHttpProxy() {
2223
return httpProxy;
2324
}
2425

26+
@Override
27+
public HttpType getRequestType() {
28+
return HttpType.joddHttp;
29+
}
30+
2531
@Override
2632
public String getAccessToken(boolean forceRefresh) throws WxErrorException {
2733
if (forceRefresh) {

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/okhttp/WxCpServiceImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import me.chanjar.weixin.common.bean.WxAccessToken;
66
import me.chanjar.weixin.common.bean.result.WxError;
77
import me.chanjar.weixin.common.exception.WxErrorException;
8+
import me.chanjar.weixin.common.util.http.HttpType;
89
import me.chanjar.weixin.common.util.http.okhttp.OkhttpProxyInfo;
910
import me.chanjar.weixin.cp.api.WxCpConfigStorage;
1011
import me.chanjar.weixin.cp.api.impl.AbstractWxCpServiceImpl;
@@ -25,6 +26,11 @@ public OkhttpProxyInfo getRequestHttpProxy() {
2526
return httpProxy;
2627
}
2728

29+
@Override
30+
public HttpType getRequestType() {
31+
return HttpType.okHttp;
32+
}
33+
2834
@Override
2935
public String getAccessToken(boolean forceRefresh) throws WxErrorException {
3036
if (forceRefresh) {

weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/apache/WxMpServiceImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ public HttpHost getRequestHttpProxy() {
4646
return httpProxy;
4747
}
4848

49+
@Override
50+
public HttpType getRequestType() {
51+
return HttpType.apacheHttp;
52+
}
53+
4954
@Override
5055
public void initHttp() {
5156
WxMpConfigStorage configStorage = this.getWxMpConfigStorage();

weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/jodd/WxMpServiceImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import me.chanjar.weixin.common.bean.WxAccessToken;
66
import me.chanjar.weixin.common.bean.result.WxError;
77
import me.chanjar.weixin.common.exception.WxErrorException;
8+
import me.chanjar.weixin.common.util.http.HttpType;
89
import me.chanjar.weixin.mp.api.*;
910
import me.chanjar.weixin.mp.api.impl.*;
1011

@@ -27,6 +28,11 @@ public ProxyInfo getRequestHttpProxy() {
2728
return httpProxy;
2829
}
2930

31+
@Override
32+
public HttpType getRequestType() {
33+
return HttpType.joddHttp;
34+
}
35+
3036
@Override
3137
public void initHttp() {
3238

weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/okhttp/WxMpServiceImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import me.chanjar.weixin.common.bean.WxAccessToken;
44
import me.chanjar.weixin.common.bean.result.WxError;
55
import me.chanjar.weixin.common.exception.WxErrorException;
6+
import me.chanjar.weixin.common.util.http.HttpType;
67
import me.chanjar.weixin.common.util.http.okhttp.OkhttpProxyInfo;
78
import me.chanjar.weixin.mp.api.WxMpConfigStorage;
89
import me.chanjar.weixin.mp.api.WxMpService;
@@ -26,6 +27,11 @@ public OkhttpProxyInfo getRequestHttpProxy() {
2627
return httpProxy;
2728
}
2829

30+
@Override
31+
public HttpType getRequestType() {
32+
return HttpType.okHttp;
33+
}
34+
2935
@Override
3036
public String getAccessToken(boolean forceRefresh) throws WxErrorException {
3137
Lock lock = this.getWxMpConfigStorage().getAccessTokenLock();

0 commit comments

Comments
 (0)