|
@@ -5,6 +5,8 @@ import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
|
|
import cn.com.ctop.common.module.service.*;
|
|
import cn.com.ctop.common.module.service.*;
|
|
import cn.com.ctop.common.module.utils.*;
|
|
import cn.com.ctop.common.module.utils.*;
|
|
import cn.com.ctop.common.module.vo.ResFileDTO;
|
|
import cn.com.ctop.common.module.vo.ResFileDTO;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaign;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreative;
|
|
import cn.com.ctop.kuaishou.modules.batch.service.*;
|
|
import cn.com.ctop.kuaishou.modules.batch.service.*;
|
|
import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
|
|
import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
|
|
@@ -13,6 +15,7 @@ import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanDailyReportServi
|
|
import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanHourlyReportService;
|
|
import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanHourlyReportService;
|
|
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.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.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
@@ -68,12 +71,110 @@ public class TestController {
|
|
private IMaterialImageInfoService iMaterialImageInfoService;
|
|
private IMaterialImageInfoService iMaterialImageInfoService;
|
|
@Autowired
|
|
@Autowired
|
|
private IBytedanceReportService bytedanceReportService;
|
|
private IBytedanceReportService bytedanceReportService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IKuaiShouCreativeService creativeService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IBatchService batchService;
|
|
static ExecutorService executorService = Executors.newFixedThreadPool(15);
|
|
static ExecutorService executorService = Executors.newFixedThreadPool(15);
|
|
static ExecutorService videoService = Executors.newFixedThreadPool(5);
|
|
static ExecutorService videoService = Executors.newFixedThreadPool(5);
|
|
static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
|
|
static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @GetMapping(value = "/campaignList")
|
|
|
|
+ public void campaignList() {
|
|
|
|
+ List<Long> list = new ArrayList();
|
|
|
|
+ list.add(6828954L);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
|
+ Long accountId = list.get(i);
|
|
|
|
+ CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
|
|
+ kuaishouInterfaceService.getCampaignList(oauthToken, null, null);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @GetMapping(value = "/creativeList")
|
|
|
|
+ public void creativeList() {
|
|
|
|
+ List<Long> list = new ArrayList();
|
|
|
|
+ list.add(6828954L);
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
|
+ Long accountId = list.get(i);
|
|
|
|
+ CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
|
|
+ QueryWrapper<KuaiShouCampaign> campaignQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ campaignQueryWrapper.eq("account_id", accountId);
|
|
|
|
+
|
|
|
|
+ List<KuaiShouCampaign> list1 = campaignService.list(campaignQueryWrapper);
|
|
|
|
+ for (KuaiShouCampaign campaign : list1) {
|
|
|
|
+ kuaishouInterfaceService.getAsyncCreativeListV2(oauthToken.getAccountId(), oauthToken.getAccessToken(), campaign.getCampaignId());
|
|
|
|
+ /* try {
|
|
|
|
+ // Thread.sleep(1000L);
|
|
|
|
+ } catch (InterruptedException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }*/
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @GetMapping(value = "/updateCreative")
|
|
|
|
+ public void updateCreative() {
|
|
|
|
+ List<Long> list = new ArrayList();
|
|
|
|
+ list.add(6828954L);
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
|
+ Long accountId = list.get(i);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
|
+ String clickTrackUrl = null;
|
|
|
|
+ if (accountId == 6828954L) {
|
|
|
|
+ clickTrackUrl = "https://uri6.com/tkio/yQ7VZva?imei=__IMEI2__&androidid=__ANDROIDID2__&oaid=__OAID__&mac=__MAC__&ip=__IP__&ry_adcreative_id=__CID__&ry_adplan_id=__DID__&ry_adplan_name=__DNAME__&ry_adgroup_id=__AID__&callback=__CALLBACK__&kscsite=__CSITE__&noredirect=true";
|
|
|
|
+ }
|
|
|
|
+ json.put("clickTrackUrl", clickTrackUrl);
|
|
|
|
+
|
|
|
|
+ CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
|
|
+ QueryWrapper<KuaiShouCreative> creativeQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ creativeQueryWrapper.eq("account_id", accountId);
|
|
|
|
+ /* if (accountId == 3727345L) {
|
|
|
|
+ creativeQueryWrapper.eq("click_track_url", "https://vdd.qq.com/aid/kuaishou_click_detail?app=tenvideo&imeimd5=__IMEI2__&idfamd5=__IDFA2__&androidid=__ANDROIDID2__&callback_url=__CALLBACK__&campaign_id=__DID__&adgroup_id=__AID__&creative_id=__CID__&account_id=3727345×tamp=__TS__");
|
|
|
|
+ } else if (accountId == 6004204L) {
|
|
|
|
+ creativeQueryWrapper.eq("click_track_url", "https://vdd.qq.com/aid/kuaishou_click_detail?app=tenvideo&imeimd5=__IMEI2__&idfamd5=__IDFA2__&androidid=__ANDROIDID2__&callback_url=__CALLBACK__&campaign_id=__DID__&adgroup_id=__AID__&creative_id=__CID__&account_id=6004204×tamp=__TS__");
|
|
|
|
+ } else if (accountId == 6399167L) {
|
|
|
|
+ creativeQueryWrapper.eq("click_track_url", "https://vdd.qq.com/aid/kuaishou_click_detail?app=tenvideo&imeimd5=__IMEI2__&idfamd5=__IDFA2__&androidid=__ANDROIDID2__&callback_url=__CALLBACK__&campaign_id=__DID__&adgroup_id=__AID__&creative_id=__CID__&account_id=6399167×tamp=__TS__");
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ List<KuaiShouCreative> list1 = creativeService.list(creativeQueryWrapper);
|
|
|
|
+ for (KuaiShouCreative creative : list1) {
|
|
|
|
+ executorService.submit(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ try {
|
|
|
|
+ json.put("creativeId", creative.getCreativeId());
|
|
|
|
+ batchService.updateCreative(json, oauthToken);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
@GetMapping(value = "/getCut")
|
|
@GetMapping(value = "/getCut")
|
|
public void getCut() {
|
|
public void getCut() {
|
|
QueryWrapper<MaterialInfo> materialInfoQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<MaterialInfo> materialInfoQueryWrapper = new QueryWrapper<>();
|
|
@@ -111,11 +212,6 @@ public class TestController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
@GetMapping(value = "/t")
|
|
@GetMapping(value = "/t")
|
|
public String test() {
|
|
public String test() {
|
|
Result<String> result = new Result<>();
|
|
Result<String> result = new Result<>();
|
|
@@ -819,7 +915,6 @@ public class TestController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
@GetMapping(value = "/getAppList")
|
|
@GetMapping(value = "/getAppList")
|
|
public void getAppList() throws JobExecutionException {
|
|
public void getAppList() throws JobExecutionException {
|
|
try {
|
|
try {
|
|
@@ -835,7 +930,7 @@ public class TestController {
|
|
|
|
|
|
tokens.forEach(token -> {
|
|
tokens.forEach(token -> {
|
|
|
|
|
|
- kuaishouInterfaceService.getAppList(token.getAccountId(),token.getAccessToken());
|
|
|
|
|
|
+ kuaishouInterfaceService.getAppList(token.getAccountId(), token.getAccessToken());
|
|
//suzhaoService.submit(new Runnable() {
|
|
//suzhaoService.submit(new Runnable() {
|
|
// @Override
|
|
// @Override
|
|
// public void run() {
|
|
// public void run() {
|