|
1 | 1 | package me.chanjar.weixin.mp.api.impl; |
2 | 2 |
|
| 3 | +import java.io.IOException; |
| 4 | + |
| 5 | +import org.apache.http.HttpHost; |
| 6 | +import org.apache.http.client.config.RequestConfig; |
| 7 | +import org.apache.http.client.methods.CloseableHttpResponse; |
| 8 | +import org.apache.http.client.methods.HttpGet; |
| 9 | +import org.apache.http.conn.ssl.DefaultHostnameVerifier; |
| 10 | +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; |
| 11 | +import org.apache.http.impl.client.BasicResponseHandler; |
| 12 | +import org.apache.http.impl.client.CloseableHttpClient; |
| 13 | +import org.slf4j.Logger; |
| 14 | +import org.slf4j.LoggerFactory; |
| 15 | + |
3 | 16 | import com.google.gson.JsonArray; |
4 | 17 | import com.google.gson.JsonElement; |
5 | 18 | import com.google.gson.JsonObject; |
6 | 19 | import com.google.gson.JsonParser; |
| 20 | + |
7 | 21 | import me.chanjar.weixin.common.bean.WxAccessToken; |
8 | 22 | import me.chanjar.weixin.common.bean.WxJsapiSignature; |
9 | 23 | import me.chanjar.weixin.common.bean.result.WxError; |
|
12 | 26 | import me.chanjar.weixin.common.session.WxSessionManager; |
13 | 27 | import me.chanjar.weixin.common.util.RandomUtils; |
14 | 28 | import me.chanjar.weixin.common.util.crypto.SHA1; |
15 | | -import me.chanjar.weixin.common.util.http.*; |
16 | | -import me.chanjar.weixin.mp.api.*; |
17 | | -import me.chanjar.weixin.mp.bean.*; |
18 | | -import me.chanjar.weixin.mp.bean.result.*; |
19 | | -import org.apache.http.HttpHost; |
20 | | -import org.apache.http.client.config.RequestConfig; |
21 | | -import org.apache.http.client.methods.CloseableHttpResponse; |
22 | | -import org.apache.http.client.methods.HttpGet; |
23 | | -import org.apache.http.conn.ssl.DefaultHostnameVerifier; |
24 | | -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; |
25 | | -import org.apache.http.impl.client.BasicResponseHandler; |
26 | | -import org.apache.http.impl.client.CloseableHttpClient; |
27 | | -import org.slf4j.Logger; |
28 | | -import org.slf4j.LoggerFactory; |
29 | | - |
30 | | -import java.io.IOException; |
| 29 | +import me.chanjar.weixin.common.util.http.ApacheHttpClientBuilder; |
| 30 | +import me.chanjar.weixin.common.util.http.DefaultApacheHttpClientBuilder; |
| 31 | +import me.chanjar.weixin.common.util.http.RequestExecutor; |
| 32 | +import me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor; |
| 33 | +import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor; |
| 34 | +import me.chanjar.weixin.common.util.http.URIUtil; |
| 35 | +import me.chanjar.weixin.mp.api.WxMpCardService; |
| 36 | +import me.chanjar.weixin.mp.api.WxMpConfigStorage; |
| 37 | +import me.chanjar.weixin.mp.api.WxMpDataCubeService; |
| 38 | +import me.chanjar.weixin.mp.api.WxMpGroupService; |
| 39 | +import me.chanjar.weixin.mp.api.WxMpKefuService; |
| 40 | +import me.chanjar.weixin.mp.api.WxMpMaterialService; |
| 41 | +import me.chanjar.weixin.mp.api.WxMpMenuService; |
| 42 | +import me.chanjar.weixin.mp.api.WxMpPayService; |
| 43 | +import me.chanjar.weixin.mp.api.WxMpQrcodeService; |
| 44 | +import me.chanjar.weixin.mp.api.WxMpService; |
| 45 | +import me.chanjar.weixin.mp.api.WxMpStoreService; |
| 46 | +import me.chanjar.weixin.mp.api.WxMpUserBlacklistService; |
| 47 | +import me.chanjar.weixin.mp.api.WxMpUserService; |
| 48 | +import me.chanjar.weixin.mp.api.WxMpUserTagService; |
| 49 | +import me.chanjar.weixin.mp.bean.WxMpIndustry; |
| 50 | +import me.chanjar.weixin.mp.bean.WxMpMassGroupMessage; |
| 51 | +import me.chanjar.weixin.mp.bean.WxMpMassNews; |
| 52 | +import me.chanjar.weixin.mp.bean.WxMpMassOpenIdsMessage; |
| 53 | +import me.chanjar.weixin.mp.bean.WxMpMassPreviewMessage; |
| 54 | +import me.chanjar.weixin.mp.bean.WxMpMassVideo; |
| 55 | +import me.chanjar.weixin.mp.bean.WxMpSemanticQuery; |
| 56 | +import me.chanjar.weixin.mp.bean.WxMpTemplateMessage; |
| 57 | +import me.chanjar.weixin.mp.bean.result.WxMpMassSendResult; |
| 58 | +import me.chanjar.weixin.mp.bean.result.WxMpMassUploadResult; |
| 59 | +import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken; |
| 60 | +import me.chanjar.weixin.mp.bean.result.WxMpSemanticQueryResult; |
| 61 | +import me.chanjar.weixin.mp.bean.result.WxMpUser; |
31 | 62 |
|
32 | 63 | public class WxMpServiceImpl implements WxMpService { |
33 | 64 |
|
@@ -65,6 +96,8 @@ public class WxMpServiceImpl implements WxMpService { |
65 | 96 |
|
66 | 97 | private WxMpPayService payService = new WxMpPayServiceImpl(this); |
67 | 98 |
|
| 99 | + private WxMpStoreService storeService = new WxMpStoreServiceImpl(this); |
| 100 | + |
68 | 101 | private WxMpDataCubeService dataCubeService = new WxMpDataCubeServiceImpl(this); |
69 | 102 |
|
70 | 103 | private WxMpUserBlacklistService blackListService = new WxMpUserBlacklistServiceImpl(this); |
@@ -442,6 +475,8 @@ protected synchronized <T, E> T executeInternal(RequestExecutor<T, E> executor, |
442 | 475 | return this.execute(executor, uri, data); |
443 | 476 | } |
444 | 477 | if (error.getErrorCode() != 0) { |
| 478 | + this.log.error("\n[URL]: {}\n[PARAMS]: {}\n[RESPONSE]: {}", uri, data, |
| 479 | + error); |
445 | 480 | throw new WxErrorException(error); |
446 | 481 | } |
447 | 482 | return null; |
@@ -560,4 +595,9 @@ public WxMpUserBlacklistService getBlackListService() { |
560 | 595 | return this.blackListService; |
561 | 596 | } |
562 | 597 |
|
| 598 | + @Override |
| 599 | + public WxMpStoreService getStoreService() { |
| 600 | + return this.storeService; |
| 601 | + } |
| 602 | + |
563 | 603 | } |
0 commit comments