|
@@ -88,20 +88,20 @@ public class TestController {
|
|
@GetMapping(value = "/campaignList")
|
|
@GetMapping(value = "/campaignList")
|
|
public void campaignList() {
|
|
public void campaignList() {
|
|
List<Long> list = new ArrayList();
|
|
List<Long> list = new ArrayList();
|
|
- list.add(7531960L);
|
|
|
|
- list.add(7539235L);
|
|
|
|
|
|
+ list.add(7421660L);
|
|
|
|
+ /*list.add(7539235L);
|
|
list.add(7539110L);
|
|
list.add(7539110L);
|
|
list.add(7539121L);
|
|
list.add(7539121L);
|
|
list.add(7623269L);
|
|
list.add(7623269L);
|
|
list.add(7539155L);
|
|
list.add(7539155L);
|
|
list.add(7539225L);
|
|
list.add(7539225L);
|
|
list.add(7539022L);
|
|
list.add(7539022L);
|
|
- list.add(7539009L);
|
|
|
|
|
|
+ list.add(7539009L);*/
|
|
for (int i = 0; i < list.size(); i++) {
|
|
for (int i = 0; i < list.size(); i++) {
|
|
Long accountId = list.get(i);
|
|
Long accountId = list.get(i);
|
|
CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
- // kuaishouInterfaceService.getCampaignList(oauthToken, null, null);
|
|
|
|
- kuaishouInterfaceService.getGroupList(oauthToken, null, null);
|
|
|
|
|
|
+ kuaishouInterfaceService.getCampaignList(oauthToken, null, null);
|
|
|
|
+ // kuaishouInterfaceService.getGroupList(oauthToken, null, null);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -110,7 +110,7 @@ public class TestController {
|
|
@GetMapping(value = "/creativeList")
|
|
@GetMapping(value = "/creativeList")
|
|
public void creativeList() {
|
|
public void creativeList() {
|
|
List<Long> list = new ArrayList();
|
|
List<Long> list = new ArrayList();
|
|
- list.add(7607727L);
|
|
|
|
|
|
+ list.add(7421660L);
|
|
/* list.add(7087866L);
|
|
/* list.add(7087866L);
|
|
list.add(7025567L);
|
|
list.add(7025567L);
|
|
list.add(7607830L);
|
|
list.add(7607830L);
|
|
@@ -153,15 +153,7 @@ public class TestController {
|
|
@GetMapping(value = "/updateUnit")
|
|
@GetMapping(value = "/updateUnit")
|
|
public void updateUnit() throws Exception {
|
|
public void updateUnit() throws Exception {
|
|
List<Long> list = new ArrayList();
|
|
List<Long> list = new ArrayList();
|
|
- list.add(7531960L);
|
|
|
|
- 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(7421660L);
|
|
for (int i = 0; i < list.size(); i++) {
|
|
for (int i = 0; i < list.size(); i++) {
|
|
Long accountId = list.get(i);
|
|
Long accountId = list.get(i);
|
|
CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
@@ -211,7 +203,7 @@ public class TestController {
|
|
@GetMapping(value = "/updateCreative")
|
|
@GetMapping(value = "/updateCreative")
|
|
public void updateCreative() {
|
|
public void updateCreative() {
|
|
List<Long> list = new ArrayList();
|
|
List<Long> list = new ArrayList();
|
|
- list.add(7607727L);
|
|
|
|
|
|
+ list.add(7421660L);
|
|
/* list.add(7087866L);
|
|
/* list.add(7087866L);
|
|
list.add(7025567L);
|
|
list.add(7025567L);
|
|
list.add(7607830L);
|
|
list.add(7607830L);
|
|
@@ -237,7 +229,6 @@ public class TestController {
|
|
QueryWrapper<KuaiShouCreative> creativeQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<KuaiShouCreative> creativeQueryWrapper = new QueryWrapper<>();
|
|
creativeQueryWrapper.eq("account_id", accountId);
|
|
creativeQueryWrapper.eq("account_id", accountId);
|
|
creativeQueryWrapper.eq("campaign_id", campaign.getCampaignId());
|
|
creativeQueryWrapper.eq("campaign_id", campaign.getCampaignId());
|
|
- // creativeQueryWrapper.like("click_track_url", "&csite=__CSITE__&csite=__CSITE__");
|
|
|
|
List<KuaiShouCreative> creativeList = creativeService.list(creativeQueryWrapper);
|
|
List<KuaiShouCreative> creativeList = creativeService.list(creativeQueryWrapper);
|
|
for (KuaiShouCreative creative : creativeList) {
|
|
for (KuaiShouCreative creative : creativeList) {
|
|
/* executorService.submit(new Runnable() {
|
|
/* executorService.submit(new Runnable() {
|
|
@@ -246,36 +237,43 @@ public class TestController {
|
|
try {
|
|
try {
|
|
JSONObject json = new JSONObject();
|
|
JSONObject json = new JSONObject();
|
|
json.put("creativeId", creative.getCreativeId());
|
|
json.put("creativeId", creative.getCreativeId());
|
|
- String a = "";
|
|
|
|
- String b = "";
|
|
|
|
|
|
|
|
|
|
|
|
- String clickTrackUrl = creative.getClickTrackUrl();
|
|
|
|
|
|
+ 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 (!clickTrackUrl.contains("&csite=__CSITE__")) {
|
|
|
|
- if (!Check.isNull(clickTrackUrl)) {
|
|
|
|
- b = clickTrackUrl;
|
|
|
|
- } else {
|
|
|
|
- b = creative.getImpressionUrl();
|
|
|
|
- }
|
|
|
|
- if (b.contains("&pass_through")) {
|
|
|
|
- String[] split = b.split("&pass_through");
|
|
|
|
- a = split[0] + "&csite=__CSITE__" + "&pass_through" + split[1];
|
|
|
|
|
|
+ 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__";
|
|
|
|
|
|
- } else {
|
|
|
|
- a = b + "&csite=__CSITE__";
|
|
|
|
- }
|
|
|
|
- // a = clickTrackUrl.replace("&csite=__CSITE__&csite=__CSITE__", "&csite=__CSITE__");
|
|
|
|
|
|
|
|
- if (creative.getCreativeMaterialType() == 1) {
|
|
|
|
- json.put("clickTrackUrl", a);
|
|
|
|
- } else if (creative.getCreativeMaterialType() == 4) {
|
|
|
|
- json.put("impressionUrl", a);
|
|
|
|
- json.put("clickTrackUrl", a);
|
|
|
|
- }
|
|
|
|
|
|
+ // 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__", "");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (creative.getCreativeMaterialType() == 1) {
|
|
|
|
+ json.put("clickTrackUrl", replaceUrll);
|
|
|
|
+ } else if (creative.getCreativeMaterialType() == 4) {
|
|
|
|
+ json.put("impressionUrl", replaceUrll);
|
|
|
|
+ json.put("clickTrackUrl", replaceUrll);
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ System.err.println(replaceUrll);
|
|
batchService.updateCreative(json, oauthToken);
|
|
batchService.updateCreative(json, oauthToken);
|
|
- Thread.sleep(1000);
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -317,6 +315,27 @@ public class TestController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
+
|
|
|
|
+ String url = "https://open.snssdk.com/ug/ad/display/clicks?ad_platform=kuaishou&app_platform=android&surl_token=Y1tF&imei_md5=__IMEI2__&ip=__IP__×tamp=__TS__&androidid_md5=__ANDROIDID2__&callback=__CALLBACK__&ua=__UA__&oaid=__OAID__&csite=__CSITE__";
|
|
|
|
+ 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];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ System.err.println(replaceUrll);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|