|
@@ -2,10 +2,11 @@ package org.jeecg;
|
|
|
|
|
|
import cn.com.ctop.common.module.entity.BindAccountLogin;
|
|
import cn.com.ctop.common.module.entity.BindAccountLogin;
|
|
import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
|
|
+import cn.com.ctop.common.module.entity.UserAllocation;
|
|
import cn.com.ctop.common.module.service.IBindAccountLoginService;
|
|
import cn.com.ctop.common.module.service.IBindAccountLoginService;
|
|
import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
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.common.module.utils.CtopAdConstant;
|
|
-import cn.com.ctop.common.module.utils.HttpUtils;
|
|
|
|
import cn.com.ctop.crawler.modules.pangolin.entity.PangolinApp;
|
|
import cn.com.ctop.crawler.modules.pangolin.entity.PangolinApp;
|
|
import cn.com.ctop.crawler.modules.pangolin.service.PangolinAppService;
|
|
import cn.com.ctop.crawler.modules.pangolin.service.PangolinAppService;
|
|
import cn.com.ctop.crawler.modules.pangolin.service.PangolinCrawlerService;
|
|
import cn.com.ctop.crawler.modules.pangolin.service.PangolinCrawlerService;
|
|
@@ -15,8 +16,6 @@ import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService
|
|
import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
|
|
import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
|
|
import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
|
|
import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
|
|
import cn.com.ctop.toutiao.modules.report.service.IReportService;
|
|
import cn.com.ctop.toutiao.modules.report.service.IReportService;
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.DateUtils;
|
|
@@ -29,7 +28,6 @@ import org.springframework.test.context.junit4.SpringRunner;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
-import java.util.Map;
|
|
|
|
import java.util.concurrent.CountDownLatch;
|
|
import java.util.concurrent.CountDownLatch;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.Executors;
|
|
import java.util.concurrent.Executors;
|
|
@@ -46,55 +44,17 @@ public class SampleTest {
|
|
private ICtopOauthTokenService oauthTokenService;
|
|
private ICtopOauthTokenService oauthTokenService;
|
|
@Autowired
|
|
@Autowired
|
|
private IReportService reportService;
|
|
private IReportService reportService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IUserAllocationService userAllocationService;
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void testOceanEngineJob() {
|
|
public void testOceanEngineJob() {
|
|
- try {
|
|
|
|
- String url = "https://ad.e.kuaishou.com/rest/openapi/v1/tool/key_frame";
|
|
|
|
- JSONArray ptotoArr = new JSONArray();
|
|
|
|
- ptotoArr.add("5188991225263567823");
|
|
|
|
-
|
|
|
|
- Map<String, String> headers = new HashMap<>();
|
|
|
|
- headers.put("Access-Token", "e251db4aa139eb36623818581003bcec");
|
|
|
|
- headers.put("Content-Type", "application/json");
|
|
|
|
- JSONObject requestJson = new JSONObject();
|
|
|
|
- requestJson.put("advertiser_id", 161468);
|
|
|
|
- requestJson.put("photo_ids", ptotoArr);
|
|
|
|
- // requestJson.put("type", type);
|
|
|
|
- String result = HttpUtils.kuaiShouhttpPostRequest(url, requestJson.toJSONString(), headers);
|
|
|
|
- System.err.println(result);
|
|
|
|
- // CtopOauthToken byId = oauthTokenService.getById(1654059015242756L);
|
|
|
|
-
|
|
|
|
- /* SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
- Date start = simpleDateFormat.parse("2020-01-01");
|
|
|
|
- Date end = simpleDateFormat.parse("2020-06-03");*/
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /*String nowDate = "2020-06-03";
|
|
|
|
- String endDate = "2020-01-01";
|
|
|
|
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
- Date start = simpleDateFormat.parse(nowDate);
|
|
|
|
- Date end = simpleDateFormat.parse(endDate);
|
|
|
|
- List<Date> dates = DateUtils.findDates(end, start);
|
|
|
|
- for (int i = 0; i < dates.size(); i++) {
|
|
|
|
- String formatDate = simpleDateFormat.format(dates.get(i));
|
|
|
|
- Date parse = simpleDateFormat.parse(formatDate);
|
|
|
|
- reportService.getAdvertiserReport(byId, parse, parse, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
|
- }*/
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- String account = "3248395570@qq.com";
|
|
|
|
- /* String password = "Ydxq-704127411";
|
|
|
|
- oceanEngineService.login(account,password);
|
|
|
|
- oceanEngineService.douyinHotHandler(1,1);
|
|
|
|
- oceanEngineService.effectCaseHandler(1);
|
|
|
|
- oceanEngineService.hotMaterialHandler(1,4,"抖音");
|
|
|
|
- oceanEngineService.hotMaterialHandler(1,8,"头条");
|
|
|
|
- oceanEngineService.hotMaterialHandler(1,1,"西瓜");
|
|
|
|
- oceanEngineService.hotMaterialHandler(1,3,"火山");
|
|
|
|
- oceanEngineService.hotMaterialHandler(1,9,"穿山甲");
|
|
|
|
- log.info("巨量创意抓取完成");*/
|
|
|
|
|
|
+ List<UserAllocation>tokens = userAllocationService.getByProjectId(107L,null);
|
|
|
|
+ Date startDate = DateUtils.getDate();
|
|
|
|
+ tokens.forEach(token -> {
|
|
|
|
+ CtopOauthToken getToken = oauthTokenService.getTokenByAccountId(token.getAccountId());
|
|
|
|
+ reportService.getAdvertiserReport(getToken,startDate,startDate,CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|