mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-30 18:19:04 +08:00
修改了冲突和错误
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user