|
@@ -1,16 +1,11 @@
|
|
|
package org.jeecg;
|
|
|
|
|
|
import cn.com.ctop.common.module.entity.BindAccountLogin;
|
|
|
-import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
|
import cn.com.ctop.common.module.service.IBindAccountLoginService;
|
|
|
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
|
import cn.com.ctop.crawler.modules.oceanengine.service.IOceanEngineService;
|
|
|
import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
|
|
|
-import cn.com.ctop.toutiao.modules.report.service.IBytedanceFundDailyService;
|
|
|
-import com.xxl.job.core.log.XxlJobLogger;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.jeecg.common.util.DateUtils;
|
|
|
import org.junit.Test;
|
|
|
import org.junit.runner.RunWith;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -93,40 +88,6 @@ public class SampleTest {
|
|
|
Long end = System.currentTimeMillis();
|
|
|
log.info("总用时:{}毫秒",end-start);
|
|
|
}
|
|
|
- @Autowired
|
|
|
- private ICtopOauthTokenService tokenService;
|
|
|
- @Autowired
|
|
|
- private IBytedanceFundDailyService bytedanceFundDailyService;
|
|
|
- @Test
|
|
|
- public void testBase64(){
|
|
|
- List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
|
|
|
- if (null == tokens || tokens.size() <= 0) {
|
|
|
- XxlJobLogger.log("头条账户流水数据异常:未获取到可用的token");
|
|
|
- return ;
|
|
|
- }
|
|
|
- executorService = Executors.newFixedThreadPool(4);
|
|
|
- countDownLatch = new CountDownLatch(tokens.size());
|
|
|
- tokens.forEach(token -> {
|
|
|
- executorService.submit(() -> {
|
|
|
- try {
|
|
|
- for(int i=0;i<12;i++){
|
|
|
- String getDate = DateUtils.addDay("2020-05-28",-i);
|
|
|
- bytedanceFundDailyService.loadFundDataByPage(token, getDate, getDate,1);
|
|
|
- }
|
|
|
- }catch (Exception e){
|
|
|
-
|
|
|
- }finally {
|
|
|
- countDownLatch.countDown();
|
|
|
- }
|
|
|
-
|
|
|
- });
|
|
|
- });
|
|
|
- try {
|
|
|
- countDownLatch.await();
|
|
|
- } catch (InterruptedException e) {
|
|
|
- }
|
|
|
- System.out.println("执行完成");
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
|