修改了冲突和错误

This commit is contained in:
ecoolper
2017-04-27 20:14:52 +08:00
parent 44cbf65f81
commit d01d372b65
7 changed files with 7 additions and 33 deletions

View File

@ -1,6 +1,5 @@
package me.chanjar.weixin.mp.api.impl.apache;
import java.io.IOException;
import java.util.concurrent.locks.Lock;
@ -72,13 +71,11 @@ public class WxMpServiceImpl extends AbstractWxMpService<CloseableHttpClient,Htt
+ this.getWxMpConfigStorage().getSecret();
try {
HttpGet httpGet = new HttpGet(url);
if (this.getRequestHttpProxy() != null) {
RequestConfig config = RequestConfig.custom().setProxy(this.getRequestHttpProxy()).build();
httpGet.setConfig(config);
}
try (CloseableHttpResponse response = getRequestHttpClient().execute(httpGet)) {
String resultContent = new BasicResponseHandler().handleResponse(response);
WxError error = WxError.fromJson(resultContent);
if (error.getErrorCode() != 0) {
@ -99,5 +96,4 @@ public class WxMpServiceImpl extends AbstractWxMpService<CloseableHttpClient,Htt
}
return this.getWxMpConfigStorage().getAccessToken();
}
}

View File

@ -19,7 +19,7 @@ public class WxMpBusyRetryTest {
@DataProvider(name = "getService")
public Object[][] getService() {
WxMpService service = new WxMpServiceImpl0() {
WxMpService service = new WxMpServiceImpl() {
@Override
public synchronized <T, E> T executeInternal(

View File

@ -20,7 +20,7 @@ public class ApiTestModule implements Module {
try (InputStream is1 = ClassLoader.getSystemResourceAsStream("test-config.xml")) {
TestConfigStorage config = this.fromXml(TestConfigStorage.class, is1);
config.setAccessTokenLock(new ReentrantLock());
WxMpService wxService = new WxMpServiceImpl0();
WxMpService wxService = new WxMpServiceImpl();
wxService.setWxMpConfigStorage(config);
binder.bind(WxMpService.class).toInstance(wxService);

View File

@ -5,7 +5,6 @@ import me.chanjar.weixin.mp.api.WxMpConfigStorage;
import me.chanjar.weixin.mp.api.WxMpMessageHandler;
import me.chanjar.weixin.mp.api.WxMpMessageRouter;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.impl.apache.WxMpServiceImpl;
import org.eclipse.jetty.server.Server;
@ -49,7 +48,7 @@ public class WxMpDemoServer {
.fromXml(is1);
wxMpConfigStorage = config;
wxMpService = new WxMpServiceImpl0();
wxMpService = new WxMpServiceImpl();
wxMpService.setWxMpConfigStorage(config);
WxMpMessageHandler logHandler = new DemoLogHandler();