Sfoglia il codice sorgente

修改定时任务逻辑代码

syh 5 anni fa
parent
commit
5e3a429b59

+ 0 - 11
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/app/service/impl/KuaishouAppServiceImpl.java

@@ -45,7 +45,6 @@ public class KuaishouAppServiceImpl implements IKuaishouAppService {
     public void adFetch(KuaishouAppAccount kuaishouAppAccount, Integer page) {
         String videoFeeds = kuaishouCrawlerService.getVideoFeeds(kuaishouAppAccount, page);
         ObjectMapper mapper = new ObjectMapper();
-        int i = 0;
         mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
         try {
             AppResult appResult = mapper.readValue(videoFeeds, new TypeReference<AppResult>() {
@@ -81,7 +80,6 @@ public class KuaishouAppServiceImpl implements IKuaishouAppService {
                             ad.setAppName(ad.getAppName().replace(".apk","").replace(".APK","").replace("ios","").replace("IOS",""));
                             System.out.println(ad.getAdCover());
                             appAdService.saveOrUpdate(ad);
-                            i++;
                             try {
                                 KuaishouAdAccount kuaishouAdAccount = kuaishouAdAccountService.getById(ad.getUserId());
                                 if (kuaishouAdAccount == null) {
@@ -98,10 +96,6 @@ public class KuaishouAppServiceImpl implements IKuaishouAppService {
                     }
                 }
             }
-            log.info("account:{} 抓取数据个数:{}", kuaishouAppAccount.getId(), i);
-            if (i == 0) {
-                log.info("accountId:{};返回数据:{}", kuaishouAppAccount.getId(), videoFeeds);
-            }
         } catch (IOException e) {
             e.printStackTrace();
         }
@@ -153,7 +147,6 @@ public class KuaishouAppServiceImpl implements IKuaishouAppService {
         ObjectMapper mapper = new ObjectMapper();
         mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
         try {
-            int i = 0;
             AppResult appResult = mapper.readValue(videoFeeds, new TypeReference<AppResult>() {
             });
             if (appResult != null && appResult.getFeeds() != null) {
@@ -202,10 +195,6 @@ public class KuaishouAppServiceImpl implements IKuaishouAppService {
                     }
                 }
             }
-            log.info("account:{} 抓取数据个数:{}", kuaishouIosAccount.getId(), i);
-            if (i == 0) {
-                log.info("accountId:{};返回数据:{}", kuaishouIosAccount.getId(), videoFeeds);
-            }
         } catch (IOException e) {
             e.printStackTrace();
         }