|
@@ -15,6 +15,7 @@ import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService
|
|
|
import cn.com.ctop.kuaishou.modules.material.entity.KuaishouAccessToken;
|
|
|
import cn.com.ctop.kuaishou.modules.material.entity.KuaishouResultToken;
|
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouDailyAgentService;
|
|
|
+import cn.com.ctop.manage.modules.material.service.IMaterialUploadService;
|
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
|
|
|
import cn.com.ctop.toutiao.modules.material.service.IBytedanceEffectVideoInfoService;
|
|
|
import cn.com.ctop.toutiao.modules.report.entity.BytedanceAccountReportTaskRecord;
|
|
@@ -36,8 +37,6 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
import java.math.BigDecimal;
|
|
@@ -119,9 +118,23 @@ public class TestController {
|
|
|
private IBindAccountAuthService bindAccountAuthService;
|
|
|
@Autowired
|
|
|
private UserAllocationMapper allocationMapper;
|
|
|
+ @Autowired
|
|
|
+ private IMaterialUploadService materialUploadService;
|
|
|
+
|
|
|
+ @GetMapping("/uploadVideo")
|
|
|
+ public String uploadVideo(Long projectId) {
|
|
|
+ // 832
|
|
|
+ JSONArray idList = materialInfoService.getIdListByProject(projectId);
|
|
|
+ JSONArray accountArray = new JSONArray();
|
|
|
+ accountArray.add(9864909L);
|
|
|
+
|
|
|
+ materialUploadService.uploadAccount("2", idList, accountArray, "2e3b982046a44b5faadaa77a7c0da114");
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@GetMapping("/testKuaishou")
|
|
|
- public String kuaishouCallback( @RequestParam("auth_code") String authCode, @RequestParam("state") String state) {
|
|
|
+ public String kuaishouCallback(@RequestParam("auth_code") String authCode, @RequestParam("state") String state) {
|
|
|
try {
|
|
|
JSONObject json = JSONObject.parseObject(state);
|
|
|
if (Check.isNull(json)) {
|
|
@@ -231,8 +244,8 @@ public class TestController {
|
|
|
|
|
|
|
|
|
@GetMapping("/getBytedanceMatReport")
|
|
|
- public Map<String,Object>getData(){
|
|
|
- List<BytedanceAccountReportTaskRecord> records = reportTaskRecordService.listByParams(100,"ACCOUNT_DAILY");
|
|
|
+ public Map<String, Object> getData() {
|
|
|
+ List<BytedanceAccountReportTaskRecord> records = reportTaskRecordService.listByParams(100, "ACCOUNT_DAILY");
|
|
|
executorService = Executors.newFixedThreadPool(1);
|
|
|
CountDownLatch countDownLatch = new CountDownLatch(records.size());
|
|
|
records.forEach(record -> executorService.submit(() -> {
|
|
@@ -240,7 +253,7 @@ public class TestController {
|
|
|
// reportService.getAdvertiserReport(record, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
// log.info("账户数据获取完成:account:{},时间:{}-{}",record.getAccountId(),record.getStartDate(),record.getEndDate());
|
|
|
bytedanceReportService.bytedanceMaterialReportV2(record);
|
|
|
- log.info("素材数据获取完成:account:{},时间:{}-{}",record.getAccountId(),record.getStartDate(),record.getEndDate());
|
|
|
+ log.info("素材数据获取完成:account:{},时间:{}-{}", record.getAccountId(), record.getStartDate(), record.getEndDate());
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
} finally {
|
|
@@ -258,8 +271,8 @@ public class TestController {
|
|
|
bytedanceReportMaterialDailyMapper.updateImageReportProjectName();
|
|
|
bytedanceReportMaterialDailyMapper.updateImageReportPlaneId();
|
|
|
bytedanceReportMaterialDailyMapper.updateImageReportPlaneName();
|
|
|
- Map<String,Object> result = new HashMap<>();
|
|
|
- ResultMapUtils.setResultMap(new HashMap<>(),StatusCode.COMMON_SUCCESS);
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ ResultMapUtils.setResultMap(new HashMap<>(), StatusCode.COMMON_SUCCESS);
|
|
|
return result;
|
|
|
}
|
|
|
|