Browse Source

骄阳测试用例

yumeng 4 years ago
parent
commit
a187b31305

+ 1 - 1
jeecg-boot-module-system/src/main/resources/application-dev.yml

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

+ 33 - 0
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -10,6 +10,8 @@ import cn.com.ctop.common.module.message.handle.impl.EmailSendMsgHandle;
 import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportDailyMaterialService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
@@ -25,6 +27,7 @@ import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
+import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -54,6 +57,32 @@ public class SampleTest {
     private IRefreshTokenService refreshTokenService;
 
 
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @Autowired
+    private IKuaiShouReportDailyMaterialService kuaiShouReportDailyMaterialService;
+
+
+    @Test
+    public void getData() {
+        //1:查询当日数据
+        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
+        Date endDate = new Date();
+        for (int i = 0; i < 7; i++) {
+            Date getStartDate = DateUtils.addDay(endDate, -i);
+            for (CtopOauthToken token : tokens) {
+                   kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getStartDate, getStartDate);
+                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                String format = simpleDateFormat.format(getStartDate);
+                kuaiShouReportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(token.getAccountId(), token.getAccessToken(), format, format, 1);
+
+
+            }
+        }
+
+
+    }
+
     @Test
     public void loadBytedanceCreativeData() {
         refreshTokenService.getKuaiShouRefresh();
@@ -70,6 +99,10 @@ public class SampleTest {
     @Autowired
     private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
 
+
+
+
+
     @Test
     public void loadKuaishouCookie() {
         List<BindAccountLogin> list = bindAccountLoginService.getListByParams(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_PY, 1);

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

@@ -75,7 +75,6 @@ public class KuaiShouReportDailyMaterialServiceImpl extends ServiceImpl<KuaiShou
         }
 
         List<KuaiShouReportDailyMaterial> addList = new ArrayList<>();
-        long l1 = System.currentTimeMillis();
         for (int i = 0; i < details.size(); i++) {
             JSONObject detailJson = details.getJSONObject(i);
             detailJson.put("photo_like", detailJson.getInteger("like"));