11package me .chanjar .weixin .mp .api .impl ;
22
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-
163import com .google .gson .JsonArray ;
174import com .google .gson .JsonElement ;
185import com .google .gson .JsonObject ;
196import com .google .gson .JsonParser ;
20-
217import me .chanjar .weixin .common .bean .WxAccessToken ;
228import me .chanjar .weixin .common .bean .WxJsapiSignature ;
239import me .chanjar .weixin .common .bean .result .WxError ;
4228import me .chanjar .weixin .mp .api .WxMpPayService ;
4329import me .chanjar .weixin .mp .api .WxMpQrcodeService ;
4430import me .chanjar .weixin .mp .api .WxMpService ;
31+ import me .chanjar .weixin .mp .api .WxMpUserBlackListService ;
4532import me .chanjar .weixin .mp .api .WxMpUserService ;
4633import me .chanjar .weixin .mp .api .WxMpUserTagService ;
4734import me .chanjar .weixin .mp .bean .WxMpIndustry ;
5744import me .chanjar .weixin .mp .bean .result .WxMpOAuth2AccessToken ;
5845import me .chanjar .weixin .mp .bean .result .WxMpSemanticQueryResult ;
5946import me .chanjar .weixin .mp .bean .result .WxMpUser ;
47+ import org .apache .http .HttpHost ;
48+ import org .apache .http .client .config .RequestConfig ;
49+ import org .apache .http .client .methods .CloseableHttpResponse ;
50+ import org .apache .http .client .methods .HttpGet ;
51+ import org .apache .http .conn .ssl .DefaultHostnameVerifier ;
52+ import org .apache .http .conn .ssl .SSLConnectionSocketFactory ;
53+ import org .apache .http .impl .client .BasicResponseHandler ;
54+ import org .apache .http .impl .client .CloseableHttpClient ;
55+ import org .slf4j .Logger ;
56+ import org .slf4j .LoggerFactory ;
57+
58+ import java .io .IOException ;
6059
6160public class WxMpServiceImpl implements WxMpService {
6261
@@ -75,7 +74,7 @@ public class WxMpServiceImpl implements WxMpService {
7574 private final Object globalJsapiTicketRefreshLock = new Object ();
7675
7776 private WxMpConfigStorage configStorage ;
78-
77+
7978 private WxMpKefuService kefuService = new WxMpKefuServiceImpl (this );
8079
8180 private WxMpMaterialService materialService = new WxMpMaterialServiceImpl (this );
@@ -96,6 +95,8 @@ public class WxMpServiceImpl implements WxMpService {
9695
9796 private WxMpDataCubeService dataCubeService = new WxMpDataCubeServiceImpl (this );
9897
98+ private WxMpUserBlackListService blackListService = new WxMpUserBlackListServiceImpl (this );
99+
99100 private CloseableHttpClient httpClient ;
100101
101102 private HttpHost httpProxy ;
@@ -312,7 +313,7 @@ public String buildQrConnectUrl(String redirectURI, String scope,
312313 if (state != null ) {
313314 url .append ("&state=" ).append (state );
314315 }
315-
316+
316317 url .append ("#wechat_redirect" );
317318 return url .toString ();
318319 }
@@ -474,7 +475,7 @@ protected synchronized <T, E> T executeInternal(RequestExecutor<T, E> executor,
474475 throw new RuntimeException (e );
475476 }
476477 }
477-
478+
478479 public HttpHost getHttpProxy () {
479480 return this .httpProxy ;
480481 }
@@ -495,7 +496,7 @@ private void initHttpClient() {
495496 if (null == apacheHttpClientBuilder ) {
496497 apacheHttpClientBuilder = DefaultApacheHttpClientBuilder .get ();
497498 }
498-
499+
499500 apacheHttpClientBuilder .httpProxyHost (this .configStorage .getHttpProxyHost ())
500501 .httpProxyPort (this .configStorage .getHttpProxyPort ())
501502 .httpProxyUsername (this .configStorage .getHttpProxyUsername ())
@@ -580,4 +581,9 @@ public WxMpDataCubeService getDataCubeService() {
580581 return this .dataCubeService ;
581582 }
582583
584+ @ Override
585+ public WxMpUserBlackListService getBlackListService () {
586+ return this .blackListService ;
587+ }
588+
583589}
0 commit comments