|
@@ -80,7 +80,7 @@ public class TestController {
|
|
|
|
|
|
@Autowired
|
|
|
private IBatchService batchService;
|
|
|
- static ExecutorService executorService = Executors.newFixedThreadPool(10);
|
|
|
+ static ExecutorService executorService = Executors.newFixedThreadPool(8);
|
|
|
static ExecutorService videoService = Executors.newFixedThreadPool(5);
|
|
|
static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
|
|
|
|
|
@@ -88,15 +88,29 @@ public class TestController {
|
|
|
@GetMapping(value = "/campaignList")
|
|
|
public void campaignList() {
|
|
|
List<Long> list = new ArrayList();
|
|
|
+ list.add(6409841L);
|
|
|
+ list.add(6433033L);
|
|
|
+ list.add(6433053L);
|
|
|
+ list.add(6789970L);
|
|
|
+ list.add(6791568L);
|
|
|
+ list.add(7025551L);
|
|
|
+ list.add(7025567L);
|
|
|
+ list.add(7087866L);
|
|
|
+ list.add(7087890L);
|
|
|
+ list.add(7421646L);
|
|
|
list.add(7421660L);
|
|
|
- /*list.add(7539235L);
|
|
|
- list.add(7539110L);
|
|
|
- list.add(7539121L);
|
|
|
- list.add(7623269L);
|
|
|
- list.add(7539155L);
|
|
|
- list.add(7539225L);
|
|
|
- list.add(7539022L);
|
|
|
- list.add(7539009L);*/
|
|
|
+ list.add(7421671L);
|
|
|
+ list.add(7607727L);
|
|
|
+ list.add(7607803L);
|
|
|
+ list.add(7607818L);
|
|
|
+ list.add(7607830L);
|
|
|
+ list.add(7607849L);
|
|
|
+ list.add(7783907L);
|
|
|
+ list.add(7882964L);
|
|
|
+ list.add(7882996L);
|
|
|
+ list.add(7883032L);
|
|
|
+ list.add(7922257L);
|
|
|
+
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
Long accountId = list.get(i);
|
|
|
CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
@@ -110,19 +124,29 @@ public class TestController {
|
|
|
@GetMapping(value = "/creativeList")
|
|
|
public void creativeList() {
|
|
|
List<Long> list = new ArrayList();
|
|
|
- list.add(7421660L);
|
|
|
- /* list.add(7087866L);
|
|
|
- list.add(7025567L);
|
|
|
- list.add(7607830L);
|
|
|
- list.add(6791568L);
|
|
|
list.add(6409841L);
|
|
|
list.add(6433033L);
|
|
|
+ list.add(6433053L);
|
|
|
list.add(6789970L);
|
|
|
- list.add(7607803L);
|
|
|
- list.add(7607727L);
|
|
|
- list.add(7421671L);
|
|
|
+ list.add(6791568L);
|
|
|
+ list.add(7025551L);
|
|
|
+ list.add(7025567L);
|
|
|
+ list.add(7087866L);
|
|
|
+ list.add(7087890L);
|
|
|
list.add(7421646L);
|
|
|
- list.add(7607849L);*/
|
|
|
+ list.add(7421660L);
|
|
|
+ list.add(7421671L);
|
|
|
+ list.add(7607727L);
|
|
|
+ list.add(7607803L);
|
|
|
+ list.add(7607818L);
|
|
|
+ list.add(7607830L);
|
|
|
+ list.add(7607849L);
|
|
|
+ list.add(7783907L);
|
|
|
+ list.add(7882964L);
|
|
|
+ list.add(7882996L);
|
|
|
+ list.add(7883032L);
|
|
|
+ list.add(7922257L);
|
|
|
+
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
Long accountId = list.get(i);
|
|
|
CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
@@ -134,7 +158,7 @@ public class TestController {
|
|
|
executorService.submit(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
- kuaishouInterfaceService.getAsyncCreativeListV2(oauthToken.getAccountId(), oauthToken.getAccessToken(), campaign.getCampaignId());
|
|
|
+ kuaishouInterfaceService.getAsyncCreativeListV2(oauthToken.getAccountId(), oauthToken.getAccessToken(), campaign.getCampaignId(),1);
|
|
|
}
|
|
|
});
|
|
|
try {
|
|
@@ -203,20 +227,11 @@ public class TestController {
|
|
|
@GetMapping(value = "/updateCreative")
|
|
|
public void updateCreative() {
|
|
|
List<Long> list = new ArrayList();
|
|
|
- list.add(7421660L);
|
|
|
- /* list.add(7087866L);
|
|
|
- list.add(7025567L);
|
|
|
- list.add(7607830L);
|
|
|
- list.add(6791568L);
|
|
|
list.add(6409841L);
|
|
|
list.add(6433033L);
|
|
|
+ list.add(6433053L);
|
|
|
list.add(6789970L);
|
|
|
- list.add(7607803L);
|
|
|
- list.add(7607727L);
|
|
|
- list.add(7421671L);
|
|
|
- list.add(7421646L);
|
|
|
- list.add(7421646L);
|
|
|
- list.add(7607849L);*/
|
|
|
+
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
Long accountId = list.get(i);
|
|
|
CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
@@ -229,57 +244,55 @@ public class TestController {
|
|
|
QueryWrapper<KuaiShouCreative> creativeQueryWrapper = new QueryWrapper<>();
|
|
|
creativeQueryWrapper.eq("account_id", accountId);
|
|
|
creativeQueryWrapper.eq("campaign_id", campaign.getCampaignId());
|
|
|
+ creativeQueryWrapper.notLike("click_track_url","&ad_name=__DNAME__");
|
|
|
List<KuaiShouCreative> creativeList = creativeService.list(creativeQueryWrapper);
|
|
|
for (KuaiShouCreative creative : creativeList) {
|
|
|
- /* executorService.submit(new Runnable() {
|
|
|
+ executorService.submit(new Runnable() {
|
|
|
@Override
|
|
|
- public void run() {*/
|
|
|
- try {
|
|
|
- JSONObject json = new JSONObject();
|
|
|
- json.put("creativeId", creative.getCreativeId());
|
|
|
-
|
|
|
-
|
|
|
- String url = "";
|
|
|
- if (!Check.isNull(creative.getClickTrackUrl())) {
|
|
|
- url = creative.getClickTrackUrl().replace("&idfa_md5=__IDFA__", "").replace("&idfa_md5=__IDFA2__", "");
|
|
|
- } else {
|
|
|
- url = creative.getImpressionUrl().replace("&idfa_md5=__IDFA__", "").replace("&idfa_md5=__IDFA2__", "");
|
|
|
- }
|
|
|
-
|
|
|
- if (!Check.isNull(url)) {
|
|
|
- String[] split1 = url.split("&imei_md5=");
|
|
|
- String replaceUrll = split1[0];
|
|
|
- replaceUrll += "&imei_md5=__IMEI2__&ip=__IP__×tamp=__TS__&campaign_id=__AID__&creative_id=__CID__&ad_id=__DID__&androidid_md5=__ANDROIDID2__&callback=__CALLBACK__&ua=__UA__&oaid=__OAID__&csite=__CSITE__&advertiser_id=__ACCOUNTID__&ad_name=__DNAME__";
|
|
|
-
|
|
|
-
|
|
|
- // String replaceUrll = "https://open.snssdk.com/ug/ad/display/clicks?ad_platform=kuaishou&app_platform=android&surl_token=Y1tF&imei_md5=__IMEI2__&ip=__IP__×tamp=__TS__&campaign_id=__AID__&creative_id=__CID__&ad_id=__DID__&androidid_md5=__ANDROIDID2__&callback=__CALLBACK__&ua=__UA__&oaid=__OAID__&csite=__CSITE__&advertiser_id=__ACCOUNTID__&ad_name=__DNAME__";
|
|
|
- if (!url.contains("&advertiser_id=__ACCOUNTID__&ad_name=__DNAME__")) {
|
|
|
- if (url.contains("&pass_through=")) {
|
|
|
- String[] split = url.split("&pass_through=");
|
|
|
- replaceUrll += "&pass_through=" + split[1];
|
|
|
- }
|
|
|
-
|
|
|
- if (replaceUrll.contains("&app_platform=ios")) {
|
|
|
- replaceUrll = replaceUrll.replace("&oaid=__OAID__", "").replace("&androidid_md5=__ANDROIDID2__", "");
|
|
|
+ public void run() {
|
|
|
+ try {
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("creativeId", creative.getCreativeId());
|
|
|
+ String url = "";
|
|
|
+ if (!Check.isNull(creative.getClickTrackUrl())) {
|
|
|
+ url = creative.getClickTrackUrl().replace("&idfa_md5=__IDFA__", "").replace("&idfa_md5=__IDFA2__", "");
|
|
|
+ } else {
|
|
|
+ url = creative.getImpressionUrl().replace("&idfa_md5=__IDFA__", "").replace("&idfa_md5=__IDFA2__", "");
|
|
|
}
|
|
|
|
|
|
- if (creative.getCreativeMaterialType() == 1) {
|
|
|
- json.put("clickTrackUrl", replaceUrll);
|
|
|
- } else if (creative.getCreativeMaterialType() == 4) {
|
|
|
- json.put("impressionUrl", replaceUrll);
|
|
|
- json.put("clickTrackUrl", replaceUrll);
|
|
|
-
|
|
|
+ if (!Check.isNull(url)) {
|
|
|
+ String[] split1 = url.split("&imei_md5=");
|
|
|
+ String replaceUrll = split1[0];
|
|
|
+ replaceUrll += "&imei_md5=__IMEI2__&ip=__IP__×tamp=__TS__&campaign_id=__AID__&creative_id=__CID__&ad_id=__DID__&androidid_md5=__ANDROIDID2__&callback=__CALLBACK__&ua=__UA__&oaid=__OAID__&csite=__CSITE__&advertiser_id=__ACCOUNTID__&ad_name=__DNAME__";
|
|
|
+
|
|
|
+
|
|
|
+ // String replaceUrll = "https://open.snssdk.com/ug/ad/display/clicks?ad_platform=kuaishou&app_platform=android&surl_token=Y1tF&imei_md5=__IMEI2__&ip=__IP__×tamp=__TS__&campaign_id=__AID__&creative_id=__CID__&ad_id=__DID__&androidid_md5=__ANDROIDID2__&callback=__CALLBACK__&ua=__UA__&oaid=__OAID__&csite=__CSITE__&advertiser_id=__ACCOUNTID__&ad_name=__DNAME__";
|
|
|
+ if (!url.contains("&ad_name=__DNAME__")) {
|
|
|
+ if (url.contains("&pass_through=")) {
|
|
|
+ String[] split = url.split("&pass_through=");
|
|
|
+ replaceUrll += "&pass_through=" + split[1];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (replaceUrll.contains("&app_platform=ios")) {
|
|
|
+ replaceUrll = replaceUrll.replace("&oaid=__OAID__", "").replace("&androidid_md5=__ANDROIDID2__", "");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (creative.getCreativeMaterialType() == 1) {
|
|
|
+ json.put("clickTrackUrl", replaceUrll);
|
|
|
+ } else if (creative.getCreativeMaterialType() == 4) {
|
|
|
+ json.put("impressionUrl", replaceUrll);
|
|
|
+ json.put("clickTrackUrl", replaceUrll);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ batchService.updateCreative(json, oauthToken);
|
|
|
+ Thread.sleep(1000);
|
|
|
}
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
- System.err.println(replaceUrll);
|
|
|
- batchService.updateCreative(json, oauthToken);
|
|
|
-
|
|
|
}
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- /* }
|
|
|
- });*/
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -291,20 +304,30 @@ public class TestController {
|
|
|
@GetMapping(value = "/getProgramCreative")
|
|
|
public void getProgramCreative() {
|
|
|
List<Long> list = new ArrayList();
|
|
|
- list.add(7087890L);
|
|
|
- list.add(7087866L);
|
|
|
- list.add(7025567L);
|
|
|
- list.add(7607830L);
|
|
|
- list.add(6791568L);
|
|
|
list.add(6409841L);
|
|
|
list.add(6433033L);
|
|
|
+ list.add(6433053L);
|
|
|
list.add(6789970L);
|
|
|
- list.add(7607803L);
|
|
|
- list.add(7607727L);
|
|
|
- list.add(7421671L);
|
|
|
- list.add(7421646L);
|
|
|
+ list.add(6791568L);
|
|
|
+ list.add(7025551L);
|
|
|
+ list.add(7025567L);
|
|
|
+ list.add(7087866L);
|
|
|
+ list.add(7087890L);
|
|
|
list.add(7421646L);
|
|
|
+ list.add(7421660L);
|
|
|
+ list.add(7421671L);
|
|
|
+ list.add(7607727L);
|
|
|
+ list.add(7607803L);
|
|
|
+ list.add(7607818L);
|
|
|
+ list.add(7607830L);
|
|
|
list.add(7607849L);
|
|
|
+ list.add(7783907L);
|
|
|
+ list.add(7882964L);
|
|
|
+ list.add(7882996L);
|
|
|
+ list.add(7883032L);
|
|
|
+ list.add(7922257L);
|
|
|
+
|
|
|
+
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
Long accountId = list.get(i);
|
|
|
CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|