|
@@ -1,7 +1,6 @@
|
|
|
package com.tzld.longarticle.recommend.server.remote;
|
|
|
|
|
|
import com.aliyun.odps.utils.StringUtils;
|
|
|
-import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
|
import com.google.common.reflect.TypeToken;
|
|
|
import com.tzld.longarticle.recommend.server.common.HttpPoolFactory;
|
|
|
import com.tzld.longarticle.recommend.server.model.WxUserGetResponse;
|
|
@@ -14,9 +13,9 @@ import org.apache.http.client.methods.HttpGet;
|
|
|
import org.apache.http.client.utils.URIBuilder;
|
|
|
import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
import org.apache.http.util.EntityUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
/**
|
|
@@ -28,14 +27,14 @@ public class WxUserManagementRemoteService {
|
|
|
|
|
|
private final CloseableHttpClient client = HttpPoolFactory.defaultPool();
|
|
|
|
|
|
- @ApolloJsonValue("${gzhAccessToken:{}}")
|
|
|
- private Map<String, String> accessTokenMap;
|
|
|
+ @Autowired
|
|
|
+ private WxAccessTokenRemoteService wxAccessTokenRemoteService;
|
|
|
|
|
|
public WxUserGetResponse getAllUserLimit10000(String gzhId) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
- String accessToken = accessTokenMap.get(gzhId);
|
|
|
+ String accessToken = wxAccessTokenRemoteService.getAccessToken(gzhId);
|
|
|
if (StringUtils.isBlank(accessToken)) {
|
|
|
log.error("gzh {} access_token not config", gzhId);
|
|
|
return null;
|
|
@@ -66,7 +65,7 @@ public class WxUserManagementRemoteService {
|
|
|
public WxUserGetResponse getAllUserLimit10000(String gzhId, String nextOpenId) {
|
|
|
try {
|
|
|
|
|
|
- String accessToken = accessTokenMap.get(gzhId);
|
|
|
+ String accessToken = wxAccessTokenRemoteService.getAccessToken(gzhId);
|
|
|
if (StringUtils.isBlank(accessToken)) {
|
|
|
log.error("gzh {} access_token not config", gzhId);
|
|
|
return null;
|