Browse Source

调整批量

yumeng 5 years ago
parent
commit
219ec54288

+ 25 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java

@@ -1696,5 +1696,30 @@ public class BatchController {
         return result;
     }
 
+    @GetMapping(value = "/pullPopulationList")
+    public Result pullPopulationList(Long accountId) {
+        Result result = new Result<>();
+        try {
+
+            CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+            if (Check.isNull(oauthToken)) {
+                throw new Exception("未获取到账户信息");
+            }
+            Thread thread = new Thread() {
+                @Override
+                public void run() {
+                    iKuaishouInterfaceService.getPopulationList(accountId, oauthToken.getAccessToken());
+                }
+            };
+            thread.start();
+
+            result.setSuccess(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+        return result;
+    }
+
 
 }

+ 1 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -2833,6 +2833,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     @Override
     public void getPopulationList(Long accountId, String accessToken) {
         try {
+            log.info("获取人群包列表,accountId:{}", accountId);
             String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.POPULATION_LIST;
             Map<String, String> headers = new HashMap<>();
             headers.put("Access-Token", accessToken);