添加枚举HttpType

This commit is contained in:
ecoolper
2017-05-03 21:11:56 +08:00
parent 2384b4b863
commit 6b7c86da95
6 changed files with 35 additions and 0 deletions

View File

@ -46,6 +46,11 @@ public class WxMpServiceImpl extends AbstractWxMpServiceImpl<CloseableHttpClient
return httpProxy;
}
@Override
public HttpType getRequestType() {
return HttpType.apacheHttp;
}
@Override
public void initHttp() {
WxMpConfigStorage configStorage = this.getWxMpConfigStorage();

View File

@ -5,6 +5,7 @@ import jodd.http.net.SocketHttpConnectionProvider;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.util.http.HttpType;
import me.chanjar.weixin.mp.api.*;
import me.chanjar.weixin.mp.api.impl.*;
@ -27,6 +28,11 @@ public class WxMpServiceImpl extends AbstractWxMpServiceImpl<HttpConnectionProvi
return httpProxy;
}
@Override
public HttpType getRequestType() {
return HttpType.joddHttp;
}
@Override
public void initHttp() {

View File

@ -3,6 +3,7 @@ package me.chanjar.weixin.mp.api.impl.okhttp;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.util.http.HttpType;
import me.chanjar.weixin.common.util.http.okhttp.OkhttpProxyInfo;
import me.chanjar.weixin.mp.api.WxMpConfigStorage;
import me.chanjar.weixin.mp.api.WxMpService;
@ -26,6 +27,11 @@ public class WxMpServiceImpl extends AbstractWxMpServiceImpl<ConnectionPool, Okh
return httpProxy;
}
@Override
public HttpType getRequestType() {
return HttpType.okHttp;
}
@Override
public String getAccessToken(boolean forceRefresh) throws WxErrorException {
Lock lock = this.getWxMpConfigStorage().getAccessTokenLock();