Sfoglia il codice sorgente

测试快手删评论代码逻辑

syh 4 anni fa
parent
commit
03174a4881

+ 9 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java

@@ -1199,5 +1199,13 @@ public class TestController {
 
         return result;
     }
-
+    @Autowired
+    private IKuaiShouCommentService kuaiShouCommentService;
+    @GetMapping("deleteComment")
+    public Map<String,Object>deleteComment(Long accountId){
+        Map<String,Object>result = new HashMap<>();
+        kuaiShouCommentService.shieldComment(accountId);
+        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        return result;
+    }
 }

+ 2 - 2
jeecg-boot-module-system/src/main/resources/application-wps.yml

@@ -56,7 +56,7 @@ spring:
   autoconfigure:
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
   datasource:
-    url: jdbc:mysql://139.186.27.96:4000/jiaoyang?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+    url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
     username: hcst
     password: hcst@2020
     driver-class-name: com.mysql.jdbc.Driver
@@ -96,7 +96,7 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://139.186.27.96:4000/jiaoyang?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
           username: hcst
           password: hcst@2020
           driver-class-name: com.mysql.jdbc.Driver

+ 7 - 5
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -8,6 +8,7 @@ import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCommentService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
@@ -16,7 +17,6 @@ import cn.com.ctop.kuaishou.modules.report.service.IKuaishouCostGroupService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
 import cn.com.ctop.kuaishou.modules.report.service.IRuleKuaiShouPlanService;
 import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
-import cn.com.ctop.oa.modules.service.IWechatDepartmentService;
 import cn.com.ctop.oa.modules.service.IWechatNoListService;
 import cn.com.ctop.oa.modules.service.IWechatUserListService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
@@ -321,8 +321,6 @@ public class SampleTest {
     @Autowired
     private IWechatCheckinDataService wechatCheckinDataService;
     @Autowired
-    private IWechatDepartmentService wechatDepartmentService;
-    @Autowired
     private IWechatUserListService wechatUserInfoService;
     @Autowired
     private IWechatNoListService wechatNoListService;
@@ -346,10 +344,14 @@ public class SampleTest {
 
     @Test
     public void kuaishouRuleData() {
-        //kuaiShouPlanService.cleanRuleDataPlan(3429620L,"2020-12-07","2020-12-07",1);
         kuaiShouPlanService.cleanRuleDataUnit(3429620L, "2020-12-07", "2020-12-07", 1);
-        // kuaiShouPlanService.cleanRuleDataTarget(3429620L,"2020-12-07","2020-12-07",1);
+    }
 
+    @Autowired
+    private IKuaiShouCommentService kuaiShouCommentService;
+    @Test
+    public void kuaishouDeleteComment(){
+        kuaiShouCommentService.shieldComment(8018853L);
     }
 
 

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

@@ -30,8 +30,11 @@ public class IKuaiShouCommentServiceImpl implements IKuaiShouCommentService {
     @Override
     public void shieldComment(Long accountId) {
         try {
+            Long start = System.currentTimeMillis();
             CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
             queryComments(oauthToken.getAccessToken(), accountId, 1, 500, 1);
+            Long end = System.currentTimeMillis();
+            log.info("总用时:{}毫秒",end-start);
         } catch (Exception e) {
             log.error("屏蔽评论异常", e);
         }
@@ -52,7 +55,8 @@ public class IKuaiShouCommentServiceImpl implements IKuaiShouCommentService {
         header.put("Content-Type", "application/json");
         JSONObject params = new JSONObject();
         params.put("advertiser_id", accountId);
-        params.put("shield_status", NoEn.NO1.valueInt());//未隐藏数据
+        //未隐藏数据
+        params.put("shield_status", NoEn.NO1.valueInt());
         params.put("page", page);
         params.put("page_size", pageSize);
         String result = HttpUtils.httpPostRequest(url, params, header);

+ 0 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml

@@ -968,7 +968,6 @@
 
     <select id="getKuaishouCreativeInfoByUnitId"
             resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountDTO">
-
         select
         #{yn} as 'yn',
         concat(#{startDate}, '~' ,#{endDate}) as 'statDate',
@@ -1062,7 +1061,6 @@
         </if>
         group by a.creative_id
         order by sum(a.charge) desc
-
     </select>