|
@@ -6,7 +6,7 @@ import cn.com.ctop.common.module.entity.MaterialImageInfo;
|
|
import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
import cn.com.ctop.common.module.service.IMaterialCutFrameService;
|
|
import cn.com.ctop.common.module.service.IMaterialCutFrameService;
|
|
import cn.com.ctop.common.module.service.IMaterialImageInfoService;
|
|
import cn.com.ctop.common.module.service.IMaterialImageInfoService;
|
|
-import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountTargetTemplate;
|
|
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
|
|
import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouStrategyMapCreative;
|
|
import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouStrategyMapCreative;
|
|
import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouAccountCreativeOverrunInfo;
|
|
import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouAccountCreativeOverrunInfo;
|
|
import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouNewCreateCampaign;
|
|
import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouNewCreateCampaign;
|
|
@@ -21,7 +21,6 @@ import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.DateUtils;
|
|
-import org.jeecg.common.util.JsonResourceUtil;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -57,17 +56,19 @@ public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCre
|
|
@Autowired
|
|
@Autowired
|
|
private IKuaishouAccountCreativeOverrunInfoService overrunInfoService;
|
|
private IKuaishouAccountCreativeOverrunInfoService overrunInfoService;
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 单应用上新
|
|
|
|
+ * @param strategy
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
- public void kuaishouAiAdsNewMaterialCreativity(AiKuaishouAccountTargetTemplate targetTemplate) {
|
|
|
|
- Long accountId = targetTemplate.getAccountId();
|
|
|
|
|
|
+ public void kuaishouAiAdsNewMaterialCreativityMultileAppids(AiKuaishouAdvertiserStrategy strategy) {
|
|
|
|
+ Long accountId = strategy.getAccountId();
|
|
CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId.toString());
|
|
CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId.toString());
|
|
if(null == token){
|
|
if(null == token){
|
|
log.info("token获取失败=>accountId:{}",accountId);
|
|
log.info("token获取失败=>accountId:{}",accountId);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- // 2、执行素材的同步数据服务
|
|
|
|
- // 2.1 执行 非素造的 视频拉取服务,时间过滤支持 yyyy-MM-dd, 拉取当天凌晨到此刻的数据
|
|
|
|
kuaishouInterfaceService.getVideoList(token, DateUtils.date2Str(),DateUtils.date2Str());
|
|
kuaishouInterfaceService.getVideoList(token, DateUtils.date2Str(),DateUtils.date2Str());
|
|
|
|
|
|
// 2.2 执行 素造的 视频拉取服务,时间过滤执行 yyyy-MM-dd HH:mm:ss
|
|
// 2.2 执行 素造的 视频拉取服务,时间过滤执行 yyyy-MM-dd HH:mm:ss
|
|
@@ -77,8 +78,11 @@ public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCre
|
|
Long now = System.currentTimeMillis();
|
|
Long now = System.currentTimeMillis();
|
|
String startTime = DateUtils.formatDate(new Date(now + timeStart*60*1000),"yyyy-MM-dd HH:mm:ss");
|
|
String startTime = DateUtils.formatDate(new Date(now + timeStart*60*1000),"yyyy-MM-dd HH:mm:ss");
|
|
String endTime = DateUtils.formatDate(new Date(now + timeEnd*60*1000),"yyyy-MM-dd HH:mm:ss");
|
|
String endTime = DateUtils.formatDate(new Date(now + timeEnd*60*1000),"yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ if(null!=strategy.getSingleAppid()&&strategy.getSingleAppid() == 1){
|
|
|
|
+ //单一应用
|
|
|
|
+ }
|
|
// 3、获取5分钟内,ctop_kuaishou_video_get 的视频数据,记为 N,如果有数据则执行下面步骤
|
|
// 3、获取5分钟内,ctop_kuaishou_video_get 的视频数据,记为 N,如果有数据则执行下面步骤
|
|
- List<KuaiShouVideoGet> newVideos = videoGetService.getNewVideoBetweenTime(accountId,startTime,endTime);
|
|
|
|
|
|
+ List<KuaiShouVideoGet> newVideos = videoGetService.getNewVideoBetweenTime(accountId,startTime,endTime,strategy.getChannelType(),null);
|
|
int newVideosCnt = newVideos.size();
|
|
int newVideosCnt = newVideos.size();
|
|
if (newVideosCnt == 0){
|
|
if (newVideosCnt == 0){
|
|
log.info("账户:{},{} 到 {} 这段时间没有上新素材",accountId, startTime, endTime);
|
|
log.info("账户:{},{} 到 {} 这段时间没有上新素材",accountId, startTime, endTime);
|
|
@@ -106,14 +110,16 @@ public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCre
|
|
String timestamp = DateUtils.formatDate(campaignDate,"yyyyMMddHHmmss");
|
|
String timestamp = DateUtils.formatDate(campaignDate,"yyyyMMddHHmmss");
|
|
JSONObject campaignParams = new JSONObject();
|
|
JSONObject campaignParams = new JSONObject();
|
|
campaignParams.put("advertiser_id",token.getAccountId());
|
|
campaignParams.put("advertiser_id",token.getAccountId());
|
|
- String campaignName = targetTemplate.getTitlePrefix() + "素材上新"+ targetTemplate.getTitleMiddle()+ timestamp;
|
|
|
|
|
|
+ String campaignName = strategy.getCampaignName().replace("自定义","素材上新")+timestamp;
|
|
campaignParams.put("campaign_name",campaignName);
|
|
campaignParams.put("campaign_name",campaignName);
|
|
- campaignParams.put("type",Integer.parseInt(targetTemplate.getMarketingGoal()));
|
|
|
|
|
|
+ campaignParams.put("type",strategy.getCampaignType());
|
|
|
|
+ //TODO 目前设定为不限
|
|
campaignParams.put("day_budget",0L);
|
|
campaignParams.put("day_budget",0L);
|
|
Map<String, Object> campaignCreateResult = kuaishouInterfaceService.campaignCreate(token.getAccessToken(), token.getAccountId(), campaignParams);
|
|
Map<String, Object> campaignCreateResult = kuaishouInterfaceService.campaignCreate(token.getAccessToken(), token.getAccountId(), campaignParams);
|
|
Integer code = (Integer) campaignCreateResult.get("code");
|
|
Integer code = (Integer) campaignCreateResult.get("code");
|
|
String message = (String) campaignCreateResult.get("message");
|
|
String message = (String) campaignCreateResult.get("message");
|
|
if(code != 0 ){
|
|
if(code != 0 ){
|
|
|
|
+ //TODO 写入日志信息表
|
|
log.info("计划创建失败=>message:{}",message);
|
|
log.info("计划创建失败=>message:{}",message);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -122,7 +128,7 @@ public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCre
|
|
|
|
|
|
//3、在“上新”计划中新增广告组,一个素材搭配5张封面,组成一个广告组
|
|
//3、在“上新”计划中新增广告组,一个素材搭配5张封面,组成一个广告组
|
|
String timestamp = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
|
|
String timestamp = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
|
|
- String unitNamePrefix = targetTemplate.getTitlePrefix() + "素材上新"+ targetTemplate.getTitleMiddle()+ timestamp;
|
|
|
|
|
|
+ String unitNamePrefix = strategy.getGroupName().replace("自定义","素材上新")+ timestamp;
|
|
int unitCnt = 0;
|
|
int unitCnt = 0;
|
|
for(KuaiShouVideoGet videoItem: newVideos){
|
|
for(KuaiShouVideoGet videoItem: newVideos){
|
|
KuaishouAccountCreativeOverrunInfo overrunInfo = overrunInfoService.getByParams(accountId,DateUtils.formatDate(new Date()));
|
|
KuaishouAccountCreativeOverrunInfo overrunInfo = overrunInfoService.getByParams(accountId,DateUtils.formatDate(new Date()));
|
|
@@ -131,7 +137,7 @@ public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCre
|
|
}
|
|
}
|
|
unitCnt ++;
|
|
unitCnt ++;
|
|
String unitName = unitNamePrefix + "-" + unitCnt;
|
|
String unitName = unitNamePrefix + "-" + unitCnt;
|
|
- JSONObject unitParams = createUnitParams(token, newCampaignId, targetTemplate, unitName);
|
|
|
|
|
|
+ JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName);
|
|
Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams,1);
|
|
Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams,1);
|
|
Integer unitCode = (Integer) unitCreateResult.get("code");
|
|
Integer unitCode = (Integer) unitCreateResult.get("code");
|
|
String unitMessage = (String) unitCreateResult.get("message");
|
|
String unitMessage = (String) unitCreateResult.get("message");
|
|
@@ -143,19 +149,117 @@ public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCre
|
|
|
|
|
|
// 每个组,搭配5个创意
|
|
// 每个组,搭配5个创意
|
|
List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
|
|
List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
|
|
- List<MaterialImageInfo> orgFrameList = materialImageInfoService.getListByVideoSignature(videoItem.getSignature());
|
|
|
|
- if ((null == cutFrameList||cutFrameList.isEmpty())&&(null == orgFrameList|| orgFrameList.isEmpty())){
|
|
|
|
|
|
+ if ((null == cutFrameList||cutFrameList.isEmpty())){
|
|
log.info("未获取到视频封面=>videoSignature:{}",videoItem.getSignature());
|
|
log.info("未获取到视频封面=>videoSignature:{}",videoItem.getSignature());
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- JSONObject creativeParams = creativeParams(token, unitId, videoItem, targetTemplate);
|
|
|
|
- createCreativeByImage(cutFrameList, orgFrameList,token, creativeParams, newCampaignId, unitId, videoItem,targetTemplate.getImageNumber());
|
|
|
|
|
|
+ JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy);
|
|
|
|
+ createCreativeByImage(cutFrameList,token, creativeParams, newCampaignId, unitId, videoItem,strategy.getImageCnt());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 单应用上新
|
|
|
|
+ * @param strategy
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
- public void kuaishouAiAdsHotMaterialCreativity(AiKuaishouAccountTargetTemplate targetTemplate) {
|
|
|
|
- Long accountId = targetTemplate.getAccountId();
|
|
|
|
|
|
+ public void kuaishouAiAdsNewMaterialCreativity(AiKuaishouAdvertiserStrategy strategy) {
|
|
|
|
+ Long accountId = strategy.getAccountId();
|
|
|
|
+ CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId.toString());
|
|
|
|
+ if(null == token){
|
|
|
|
+ log.info("token获取失败=>accountId:{}",accountId);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ kuaishouInterfaceService.getVideoList(token, DateUtils.date2Str(),DateUtils.date2Str());
|
|
|
|
+
|
|
|
|
+ // 2.2 执行 素造的 视频拉取服务,时间过滤执行 yyyy-MM-dd HH:mm:ss
|
|
|
|
+ // 时间差,单位为分钟
|
|
|
|
+ int timeStart = -10;
|
|
|
|
+ int timeEnd = -5;
|
|
|
|
+ Long now = System.currentTimeMillis();
|
|
|
|
+ String startTime = DateUtils.formatDate(new Date(now + timeStart*60*1000),"yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ String endTime = DateUtils.formatDate(new Date(now + timeEnd*60*1000),"yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ // 3、获取5分钟内,ctop_kuaishou_video_get 的视频数据,记为 N,如果有数据则执行下面步骤
|
|
|
|
+ List<KuaiShouVideoGet> newVideos = videoGetService.getNewVideoBetweenTime(accountId,startTime,endTime,strategy.getChannelType(),null);
|
|
|
|
+ int newVideosCnt = newVideos.size();
|
|
|
|
+ if (newVideosCnt == 0){
|
|
|
|
+ log.info("账户:{},{} 到 {} 这段时间没有上新素材",accountId, startTime, endTime);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //2、判断该账户下当天有没有“上新”计划,没有则创建一个“上新”计划
|
|
|
|
+ // time_filter_type 传入 "start_date",与 "end_date" 字段,且此字段为1时,按照创建时间进行筛选
|
|
|
|
+ JSONArray campaignList = kuaishouInterfaceService.getCampaignList(token, new Date(), new Date(),1);
|
|
|
|
+ boolean isHaveNewCampaign = false;
|
|
|
|
+ Long newCampaignId = 0L;
|
|
|
|
+ if (null!=campaignList&&campaignList.size()>0){
|
|
|
|
+ for(int i = 0;i<campaignList.size();i++){
|
|
|
|
+ JSONObject jsonObject = campaignList.getJSONObject(i);
|
|
|
|
+ if (jsonObject.getString("campaign_name").contains("素材上新")){
|
|
|
|
+ isHaveNewCampaign = true;
|
|
|
|
+ newCampaignId = jsonObject.getLong("campaign_id");
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 不存在“上新”计划,则创建一个计划
|
|
|
|
+ if (!isHaveNewCampaign){
|
|
|
|
+ Date campaignDate = new Date();
|
|
|
|
+ String timestamp = DateUtils.formatDate(campaignDate,"yyyyMMddHHmmss");
|
|
|
|
+ JSONObject campaignParams = new JSONObject();
|
|
|
|
+ campaignParams.put("advertiser_id",token.getAccountId());
|
|
|
|
+ String campaignName = strategy.getCampaignName().replace("自定义","素材上新")+timestamp;
|
|
|
|
+ campaignParams.put("campaign_name",campaignName);
|
|
|
|
+ campaignParams.put("type",strategy.getCampaignType());
|
|
|
|
+ //TODO 目前设定为不限
|
|
|
|
+ campaignParams.put("day_budget",0L);
|
|
|
|
+ Map<String, Object> campaignCreateResult = kuaishouInterfaceService.campaignCreate(token.getAccessToken(), token.getAccountId(), campaignParams);
|
|
|
|
+ Integer code = (Integer) campaignCreateResult.get("code");
|
|
|
|
+ String message = (String) campaignCreateResult.get("message");
|
|
|
|
+ if(code != 0 ){
|
|
|
|
+ //TODO 写入日志信息表
|
|
|
|
+ log.info("计划创建失败=>message:{}",message);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ newCampaignId = (Long) campaignCreateResult.get("campaignId");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //3、在“上新”计划中新增广告组,一个素材搭配5张封面,组成一个广告组
|
|
|
|
+ String timestamp = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
|
|
|
|
+ String unitNamePrefix = strategy.getGroupName().replace("自定义","素材上新")+ timestamp;
|
|
|
|
+ int unitCnt = 0;
|
|
|
|
+ for(KuaiShouVideoGet videoItem: newVideos){
|
|
|
|
+ KuaishouAccountCreativeOverrunInfo overrunInfo = overrunInfoService.getByParams(accountId,DateUtils.formatDate(new Date()));
|
|
|
|
+ if(null!=overrunInfo){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ unitCnt ++;
|
|
|
|
+ String unitName = unitNamePrefix + "-" + unitCnt;
|
|
|
|
+ JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName);
|
|
|
|
+ Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams,1);
|
|
|
|
+ Integer unitCode = (Integer) unitCreateResult.get("code");
|
|
|
|
+ String unitMessage = (String) unitCreateResult.get("message");
|
|
|
|
+ if(unitCode != 0 ){
|
|
|
|
+ log.info("组创建失败=>accountId:{};message:{}",accountId,unitMessage);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ Long unitId = (Long) unitCreateResult.get("unitId");
|
|
|
|
+
|
|
|
|
+ // 每个组,搭配5个创意
|
|
|
|
+ List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
|
|
|
|
+ if ((null == cutFrameList||cutFrameList.isEmpty())){
|
|
|
|
+ log.info("未获取到视频封面=>videoSignature:{}",videoItem.getSignature());
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy);
|
|
|
|
+ createCreativeByImage(cutFrameList,token, creativeParams, newCampaignId, unitId, videoItem,strategy.getImageCnt());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void kuaishouAiAdsHotMaterialCreativity(AiKuaishouAdvertiserStrategy strategy) {
|
|
|
|
+ Long accountId = strategy.getAccountId();
|
|
CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId.toString());
|
|
CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId.toString());
|
|
if(null == token){
|
|
if(null == token){
|
|
log.info("token获取失败=>accountId:{}",accountId);
|
|
log.info("token获取失败=>accountId:{}",accountId);
|
|
@@ -189,9 +293,9 @@ public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCre
|
|
String timestamp = DateUtils.formatDate(campaignDate,"yyyyMMddHHmmss");
|
|
String timestamp = DateUtils.formatDate(campaignDate,"yyyyMMddHHmmss");
|
|
JSONObject campaignParams = new JSONObject();
|
|
JSONObject campaignParams = new JSONObject();
|
|
campaignParams.put("advertiser_id",token.getAccountId());
|
|
campaignParams.put("advertiser_id",token.getAccountId());
|
|
- String campaignName = targetTemplate.getTitlePrefix() + "爆量素材"+ targetTemplate.getTitleMiddle() + timestamp;
|
|
|
|
|
|
+ String campaignName = strategy.getCampaignName().replace("自定义","爆量素材")+ timestamp;
|
|
campaignParams.put("campaign_name",campaignName);
|
|
campaignParams.put("campaign_name",campaignName);
|
|
- campaignParams.put("type",Integer.parseInt(targetTemplate.getMarketingGoal()));
|
|
|
|
|
|
+ campaignParams.put("type",strategy.getCampaignType());
|
|
campaignParams.put("day_budget",0L);
|
|
campaignParams.put("day_budget",0L);
|
|
Map<String, Object> campaignCreateResult = kuaishouInterfaceService.campaignCreate(token.getAccessToken(), token.getAccountId(), campaignParams);
|
|
Map<String, Object> campaignCreateResult = kuaishouInterfaceService.campaignCreate(token.getAccessToken(), token.getAccountId(), campaignParams);
|
|
Integer code = (Integer) campaignCreateResult.get("code");
|
|
Integer code = (Integer) campaignCreateResult.get("code");
|
|
@@ -205,7 +309,7 @@ public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCre
|
|
|
|
|
|
//3、在“上新”计划中新增广告组,一个素材搭配5张封面,组成一个广告组
|
|
//3、在“上新”计划中新增广告组,一个素材搭配5张封面,组成一个广告组
|
|
String timestamp = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
|
|
String timestamp = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
|
|
- String unitNamePrefix = targetTemplate.getTitlePrefix() + "爆量素材"+ targetTemplate.getTitleMiddle()+timestamp;
|
|
|
|
|
|
+ String unitNamePrefix = strategy.getGroupName().replace("自定义","爆量素材")+timestamp;
|
|
int unitCnt = 0;
|
|
int unitCnt = 0;
|
|
for(KuaiShouVideoGet videoItem: highQualityVideos){
|
|
for(KuaiShouVideoGet videoItem: highQualityVideos){
|
|
KuaishouAccountCreativeOverrunInfo overrunInfo = overrunInfoService.getByParams(accountId,DateUtils.formatDate(new Date()));
|
|
KuaishouAccountCreativeOverrunInfo overrunInfo = overrunInfoService.getByParams(accountId,DateUtils.formatDate(new Date()));
|
|
@@ -214,7 +318,7 @@ public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCre
|
|
}
|
|
}
|
|
unitCnt ++;
|
|
unitCnt ++;
|
|
String unitName = unitNamePrefix + "-" + unitCnt;
|
|
String unitName = unitNamePrefix + "-" + unitCnt;
|
|
- JSONObject unitParams = createUnitParams(token, newCampaignId, targetTemplate, unitName);
|
|
|
|
|
|
+ JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName);
|
|
Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams,1);
|
|
Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams,1);
|
|
Integer unitCode = (Integer) unitCreateResult.get("code");
|
|
Integer unitCode = (Integer) unitCreateResult.get("code");
|
|
String unitMessage = (String) unitCreateResult.get("message");
|
|
String unitMessage = (String) unitCreateResult.get("message");
|
|
@@ -231,14 +335,15 @@ public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCre
|
|
log.info("未获取到视频封面=>videoSignature:{}",videoItem.getSignature());
|
|
log.info("未获取到视频封面=>videoSignature:{}",videoItem.getSignature());
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- JSONObject creativeParams = creativeParams(token, unitId, videoItem, targetTemplate);
|
|
|
|
- createCreativeByImage(cutFrameList, orgFrameList,token, creativeParams, newCampaignId, unitId, videoItem,targetTemplate.getImageNumber());
|
|
|
|
|
|
+ JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy);
|
|
|
|
+ createCreativeByImage(cutFrameList,token, creativeParams, newCampaignId, unitId, videoItem,strategy.getImageCnt());
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
- public void kuaishouAiAddNewMaterialCreativity(AiKuaishouAccountTargetTemplate targetTemplate,Integer matNum) {
|
|
|
|
- Long accountId = targetTemplate.getAccountId();
|
|
|
|
|
|
+ public void kuaishouAiAddZeroMaterialCreativity(AiKuaishouAdvertiserStrategy strategy,Integer matNum) {
|
|
|
|
+ Long accountId = strategy.getAccountId();
|
|
CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId.toString());
|
|
CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId.toString());
|
|
if(null == token){
|
|
if(null == token){
|
|
log.info("token获取失败=>accountId:{}",accountId);
|
|
log.info("token获取失败=>accountId:{}",accountId);
|
|
@@ -273,9 +378,9 @@ public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCre
|
|
String timestamp = DateUtils.formatDate(campaignDate,"yyyyMMddHHmmss");
|
|
String timestamp = DateUtils.formatDate(campaignDate,"yyyyMMddHHmmss");
|
|
JSONObject campaignParams = new JSONObject();
|
|
JSONObject campaignParams = new JSONObject();
|
|
campaignParams.put("advertiser_id",token.getAccountId());
|
|
campaignParams.put("advertiser_id",token.getAccountId());
|
|
- String campaignName = targetTemplate.getTitlePrefix() + "素材上新"+ targetTemplate.getTitleMiddle()+ timestamp;
|
|
|
|
|
|
+ String campaignName = strategy.getCampaignName().replace("自定义","素材上新")+timestamp;
|
|
campaignParams.put("campaign_name",campaignName);
|
|
campaignParams.put("campaign_name",campaignName);
|
|
- campaignParams.put("type",Integer.parseInt(targetTemplate.getMarketingGoal()));
|
|
|
|
|
|
+ campaignParams.put("type",strategy.getCampaignType());
|
|
campaignParams.put("day_budget",0L);
|
|
campaignParams.put("day_budget",0L);
|
|
Map<String, Object> campaignCreateResult = kuaishouInterfaceService.campaignCreate(token.getAccessToken(), token.getAccountId(), campaignParams);
|
|
Map<String, Object> campaignCreateResult = kuaishouInterfaceService.campaignCreate(token.getAccessToken(), token.getAccountId(), campaignParams);
|
|
Integer code = (Integer) campaignCreateResult.get("code");
|
|
Integer code = (Integer) campaignCreateResult.get("code");
|
|
@@ -287,9 +392,9 @@ public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCre
|
|
newCampaignId = (Long) campaignCreateResult.get("campaignId");
|
|
newCampaignId = (Long) campaignCreateResult.get("campaignId");
|
|
}
|
|
}
|
|
|
|
|
|
- //3、在“上新”计划中新增广告组,一个素材搭配5张封面,组成一个广告组
|
|
|
|
|
|
+ //3、在“上新”计划中新增广告组,一个素材搭配n张封面,组成一个广告组
|
|
String timestamp = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
|
|
String timestamp = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
|
|
- String unitNamePrefix = targetTemplate.getTitlePrefix() + "素材上新"+ targetTemplate.getTitleMiddle()+ timestamp;
|
|
|
|
|
|
+ String unitNamePrefix = strategy.getGroupName().replace("自定义","素材上新")+timestamp;
|
|
int unitCnt = 0;
|
|
int unitCnt = 0;
|
|
for(KuaishouVideoRelateCreatives videoItem: kuaishouVideoRelateCreatives){
|
|
for(KuaishouVideoRelateCreatives videoItem: kuaishouVideoRelateCreatives){
|
|
KuaishouAccountCreativeOverrunInfo overrunInfo = overrunInfoService.getByParams(accountId,DateUtils.formatDate(new Date()));
|
|
KuaishouAccountCreativeOverrunInfo overrunInfo = overrunInfoService.getByParams(accountId,DateUtils.formatDate(new Date()));
|
|
@@ -302,7 +407,7 @@ public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCre
|
|
log.info("未获取到视频信息=>photoId:{}",videoItem.getPhotoId());
|
|
log.info("未获取到视频信息=>photoId:{}",videoItem.getPhotoId());
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- // 每个组,搭配5个创意
|
|
|
|
|
|
+ // 每个组,搭配n个创意
|
|
List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoGet.getSignature());
|
|
List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoGet.getSignature());
|
|
List<MaterialImageInfo> orgFrameList = materialImageInfoService.getListByVideoSignature(videoGet.getSignature());
|
|
List<MaterialImageInfo> orgFrameList = materialImageInfoService.getListByVideoSignature(videoGet.getSignature());
|
|
if ((null == cutFrameList||cutFrameList.isEmpty())&&(null == orgFrameList|| orgFrameList.isEmpty())){
|
|
if ((null == cutFrameList||cutFrameList.isEmpty())&&(null == orgFrameList|| orgFrameList.isEmpty())){
|
|
@@ -310,7 +415,7 @@ public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCre
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
String unitName = unitNamePrefix + "-" + unitCnt;
|
|
String unitName = unitNamePrefix + "-" + unitCnt;
|
|
- JSONObject unitParams = createUnitParams(token, newCampaignId, targetTemplate, unitName);
|
|
|
|
|
|
+ JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName);
|
|
Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams,1);
|
|
Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams,1);
|
|
Integer unitCode = (Integer) unitCreateResult.get("code");
|
|
Integer unitCode = (Integer) unitCreateResult.get("code");
|
|
String unitMessage = (String) unitCreateResult.get("message");
|
|
String unitMessage = (String) unitCreateResult.get("message");
|
|
@@ -319,39 +424,40 @@ public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCre
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
Long unitId = (Long) unitCreateResult.get("unitId");
|
|
Long unitId = (Long) unitCreateResult.get("unitId");
|
|
- JSONObject creativeParams = creativeParams(token, unitId, videoGet, targetTemplate);
|
|
|
|
- createCreativeByImage(cutFrameList, orgFrameList,token, creativeParams, newCampaignId, unitId, videoGet,targetTemplate.getImageNumber());
|
|
|
|
- videoItem.setCreativeCount(5);
|
|
|
|
|
|
+ JSONObject creativeParams = creativeParams(token, unitId, videoGet, strategy);
|
|
|
|
+ createCreativeByImage(cutFrameList,token, creativeParams, newCampaignId, unitId, videoGet,strategy.getImageCnt());
|
|
|
|
+ videoItem.setCreativeCount(videoItem.getCreativeCount()+strategy.getImageCnt());
|
|
relateCreativesService.updateById(videoItem);
|
|
relateCreativesService.updateById(videoItem);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private JSONObject creativeParams(CtopOauthToken token,Long unitId,KuaiShouVideoGet videoItem,AiKuaishouAccountTargetTemplate targetTemplate){
|
|
|
|
|
|
+ private JSONObject creativeParams(CtopOauthToken token,Long unitId,KuaiShouVideoGet videoItem,AiKuaishouAdvertiserStrategy strategy){
|
|
JSONObject creativeParams = new JSONObject();
|
|
JSONObject creativeParams = new JSONObject();
|
|
creativeParams.put("advertiser_id",token.getAccountId());
|
|
creativeParams.put("advertiser_id",token.getAccountId());
|
|
creativeParams.put("unit_id",unitId);
|
|
creativeParams.put("unit_id",unitId);
|
|
creativeParams.put("photo_id",videoItem.getPhotoId());
|
|
creativeParams.put("photo_id",videoItem.getPhotoId());
|
|
creativeParams.put("creative_material_type",videoItem.getMaterialType());
|
|
creativeParams.put("creative_material_type",videoItem.getMaterialType());
|
|
- creativeParams.put("action_bar_text",targetTemplate.getActionBarText());
|
|
|
|
- creativeParams.put("description",targetTemplate.getCreativeDescription());
|
|
|
|
|
|
+ creativeParams.put("action_bar_text",strategy.getActionBarText());
|
|
|
|
+ creativeParams.put("description",strategy.getDescription());
|
|
// 安卓下载中间页ID
|
|
// 安卓下载中间页ID
|
|
- JSONArray siteIdArray = JSONArray.parseArray(targetTemplate.getSiteId());
|
|
|
|
- if(null == siteIdArray||!siteIdArray.isEmpty()){
|
|
|
|
- JSONObject siteObject = siteIdArray.getJSONObject(0);
|
|
|
|
- Long siteId = siteObject.getLong("siteId");
|
|
|
|
- if(null!=siteId){
|
|
|
|
- creativeParams.put("site_id",siteId);
|
|
|
|
- }
|
|
|
|
|
|
+ if(null!=strategy.getSiteId()){
|
|
|
|
+ creativeParams.put("site_id",strategy.getSiteId());
|
|
|
|
+ }
|
|
|
|
+ if(null != strategy.getClickTrackUrl()&&!"".equals(strategy.getClickTrackUrl())){
|
|
|
|
+ creativeParams.put("click_track_url",strategy.getClickTrackUrl());
|
|
}
|
|
}
|
|
- if(null != targetTemplate.getClickTrackUrl()&&!"".equals(targetTemplate.getClickTrackUrl())){
|
|
|
|
- creativeParams.put("click_track_url",targetTemplate.getClickTrackUrl());
|
|
|
|
|
|
+ if(null != strategy.getImpressionUrl()&&!"".equals(strategy.getImpressionUrl())){
|
|
|
|
+ creativeParams.put("impression_url",strategy.getImpressionUrl());
|
|
}
|
|
}
|
|
- if(null != targetTemplate.getImpressionUrl()&&!"".equals(targetTemplate.getImpressionUrl())){
|
|
|
|
- creativeParams.put("impression_url",targetTemplate.getImpressionUrl());
|
|
|
|
|
|
+ if(null != strategy.getActionbarClickUrl()&&!"".equals(strategy.getActionbarClickUrl())){
|
|
|
|
+ creativeParams.put("actionbar_click_url",strategy.getActionbarClickUrl());
|
|
}
|
|
}
|
|
- if(null != targetTemplate.getActionbarClickUrl()&&!"".equals(targetTemplate.getActionbarClickUrl())){
|
|
|
|
- creativeParams.put("actionbar_click_url",targetTemplate.getActionbarClickUrl());
|
|
|
|
|
|
+ if(null!=strategy.getCreativeCategory()){
|
|
|
|
+ creativeParams.put("creative_category",strategy.getCreativeCategory());
|
|
|
|
+ }
|
|
|
|
+ if(null!=strategy.getCreativeTag()&&!"".equals(strategy.getCreativeTag())){
|
|
|
|
+ creativeParams.put("creative_tag",JSONArray.parseArray(strategy.getCreativeTag()));
|
|
}
|
|
}
|
|
return creativeParams;
|
|
return creativeParams;
|
|
}
|
|
}
|
|
@@ -379,80 +485,110 @@ public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCre
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private JSONObject createUnitParams(CtopOauthToken token, Long campaignId, AiKuaishouAccountTargetTemplate targetTemplate,
|
|
|
|
|
|
+ private JSONObject createUnitParams(CtopOauthToken token, Long campaignId, AiKuaishouAdvertiserStrategy strategy,
|
|
String unitName) {
|
|
String unitName) {
|
|
// 拼装创建组的入参 json
|
|
// 拼装创建组的入参 json
|
|
JSONObject unitParams = new JSONObject();
|
|
JSONObject unitParams = new JSONObject();
|
|
unitParams.put("advertiser_id",token.getAccountId());
|
|
unitParams.put("advertiser_id",token.getAccountId());
|
|
unitParams.put("campaign_id",campaignId);
|
|
unitParams.put("campaign_id",campaignId);
|
|
unitParams.put("unit_name", unitName);
|
|
unitParams.put("unit_name", unitName);
|
|
- unitParams.put("bid_type",targetTemplate.getBidType());
|
|
|
|
- unitParams.put("ocpx_action_type",targetTemplate.getOcpxActionType());
|
|
|
|
|
|
+ unitParams.put("bid_type",strategy.getBidType());
|
|
|
|
+ unitParams.put("ocpx_action_type",strategy.getOcpxActionType());
|
|
|
|
|
|
- if(null!=targetTemplate.getUseAppMarket()&&!"".equals(targetTemplate.getUseAppMarket())){
|
|
|
|
- unitParams.put("use_app_market",Integer.parseInt(targetTemplate.getUseAppMarket()));
|
|
|
|
|
|
+ if(null!=strategy.getUseAppMarket()){
|
|
|
|
+ unitParams.put("use_app_market",strategy.getUseAppMarket());
|
|
}
|
|
}
|
|
- if(null!=targetTemplate.getAppStore()&&!"".equals(targetTemplate.getAppStore())){
|
|
|
|
- unitParams.put("app_store",JSONArray.parseArray(targetTemplate.getAppStore()));
|
|
|
|
|
|
+ if(null!=strategy.getAppStore()&&!"".equals(strategy.getAppStore())){
|
|
|
|
+ unitParams.put("app_store",JSONArray.parseArray(strategy.getAppStore()));
|
|
}
|
|
}
|
|
|
|
|
|
// 在本策略中,都是 OCPM 的出价方式
|
|
// 在本策略中,都是 OCPM 的出价方式
|
|
- unitParams.put("cpa_bid",targetTemplate.getCpaBid());
|
|
|
|
- unitParams.put("scene_id",JSONArray.parseArray(targetTemplate.getSceneId()));
|
|
|
|
|
|
+ unitParams.put("cpa_bid",strategy.getCpaBid());
|
|
|
|
+ unitParams.put("scene_id",JSONArray.parseArray(strategy.getSceneId()));
|
|
unitParams.put("unit_type",4);
|
|
unitParams.put("unit_type",4);
|
|
|
|
|
|
// 格式为yyyy-MM-dd,需大于等于当前时间
|
|
// 格式为yyyy-MM-dd,需大于等于当前时间
|
|
unitParams.put("begin_time",DateUtils.formatDate(new Date()));
|
|
unitParams.put("begin_time",DateUtils.formatDate(new Date()));
|
|
|
|
|
|
- JSONArray appIds = JSONArray.parseArray(targetTemplate.getAppIds());
|
|
|
|
|
|
+ JSONArray appIds = JSONArray.parseArray(strategy.getAppIds());
|
|
if(null!=appIds&&!appIds.isEmpty()){
|
|
if(null!=appIds&&!appIds.isEmpty()){
|
|
unitParams.put("app_id",appIds.getLong(0));
|
|
unitParams.put("app_id",appIds.getLong(0));
|
|
}
|
|
}
|
|
unitParams.put("show_mode",2);
|
|
unitParams.put("show_mode",2);
|
|
unitParams.put("speed",1);
|
|
unitParams.put("speed",1);
|
|
|
|
+ //是否开启智能抽帧
|
|
|
|
+ if(null!=strategy.getSmartCover()){
|
|
|
|
+ unitParams.put("smart_cover",strategy.getSmartCover());
|
|
|
|
+ }
|
|
|
|
+ //是否开启素材挖掘
|
|
|
|
+ if(null!=strategy.getAssetMining()){
|
|
|
|
+ unitParams.put("asset_mining",strategy.getAssetMining());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
// 设置定向内容
|
|
// 设置定向内容
|
|
JSONObject targetJsonObject = new JSONObject();
|
|
JSONObject targetJsonObject = new JSONObject();
|
|
- targetJsonObject.put("region",JSONArray.parseArray(targetTemplate.getRegion()));
|
|
|
|
- targetJsonObject.put("ages_range",JSONArray.parseArray(targetTemplate.getAgesRange()));
|
|
|
|
- targetJsonObject.put("gender",targetTemplate.getGender());
|
|
|
|
- targetJsonObject.put("platform_os",targetTemplate.getPlatformOs());
|
|
|
|
- JSONArray population = JSONArray.parseArray(targetTemplate.getPopulation());
|
|
|
|
- if(null!=population&&!population.isEmpty()){
|
|
|
|
|
|
+ if(null!=strategy.getRegion()&&!"".equals(strategy.getRegion())){
|
|
|
|
+ targetJsonObject.put("region",JSONArray.parseArray(strategy.getRegion()));
|
|
|
|
+ }
|
|
|
|
+ if(null!=strategy.getAgesRange()&&!"".equals(strategy.getAgesRange())){
|
|
|
|
+ targetJsonObject.put("ages_range",JSONArray.parseArray(strategy.getAgesRange()));
|
|
|
|
+ }
|
|
|
|
+ if(null!=strategy.getGender()){
|
|
|
|
+ targetJsonObject.put("gender",strategy.getGender());
|
|
|
|
+ }
|
|
|
|
+ if(null!=strategy.getPlatformOs()){
|
|
|
|
+ targetJsonObject.put("platform_os",strategy.getPlatformOs());
|
|
|
|
+ }
|
|
|
|
+ if(null!=strategy.getAndroidOsv()){
|
|
|
|
+ targetJsonObject.put("android_osv",strategy.getAndroidOsv());
|
|
|
|
+ }
|
|
|
|
+ if(null!=strategy.getIosOsv()){
|
|
|
|
+ targetJsonObject.put("ios_osv",strategy.getIosOsv());
|
|
|
|
+ }
|
|
|
|
+ if(null!=strategy.getDeviceBrand()&&!"".equals(strategy.getDeviceBrand())&&!"[]".equals(strategy.getDeviceBrand())){
|
|
|
|
+ targetJsonObject.put("device_brand",JSONArray.parseArray(strategy.getDeviceBrand()));
|
|
|
|
+ }
|
|
|
|
+ if(null!=strategy.getDevicePrice()&&!"".equals(strategy.getDevicePrice())&&!"[]".equals(strategy.getDevicePrice())){
|
|
|
|
+ targetJsonObject.put("device_price",JSONArray.parseArray(strategy.getDevicePrice()));
|
|
|
|
+ }
|
|
|
|
+ if(null!=strategy.getPopulation()&&!"".equals(strategy.getPopulation())){
|
|
|
|
+ JSONArray population = JSONArray.parseArray(strategy.getPopulation());
|
|
targetJsonObject.put("population",population);
|
|
targetJsonObject.put("population",population);
|
|
}
|
|
}
|
|
- if(null!=targetTemplate.getFilterConvertedLevel()&&targetTemplate.getFilterConvertedLevel()!=0){
|
|
|
|
- targetJsonObject.put("filter_converted_level",targetTemplate.getFilterConvertedLevel());
|
|
|
|
|
|
+ if(null!=strategy.getFilterConvertedLevel()&&strategy.getFilterConvertedLevel()!=0){
|
|
|
|
+ targetJsonObject.put("filter_converted_level",strategy.getFilterConvertedLevel());
|
|
}
|
|
}
|
|
- JSONArray excludePopulation = JSONArray.parseArray(targetTemplate.getExcludePopulation());
|
|
|
|
- if(null!=excludePopulation&&!excludePopulation.isEmpty()){
|
|
|
|
|
|
+ if(null!=strategy.getExcludePopulation()&&!"".equals(strategy.getExcludePopulation())){
|
|
|
|
+ JSONArray excludePopulation = JSONArray.parseArray(strategy.getExcludePopulation());
|
|
targetJsonObject.put("exclude_population",excludePopulation);
|
|
targetJsonObject.put("exclude_population",excludePopulation);
|
|
}
|
|
}
|
|
|
|
+ //是否开启智能扩量
|
|
|
|
+ if(null!=strategy.getIsOpen()&&strategy.getIsOpen().equals(1)){
|
|
|
|
+ JSONObject intelliExtend = new JSONObject();
|
|
|
|
+ intelliExtend.put("is_open",1);
|
|
|
|
+ if(null!=strategy.getNoAgeBreak()&&strategy.getNoAgeBreak().equals(1)){
|
|
|
|
+ intelliExtend.put("no_age_break",1);
|
|
|
|
+ }
|
|
|
|
+ if(null!=strategy.getNoGenderBreak()&&strategy.getNoGenderBreak().equals(1)){
|
|
|
|
+ intelliExtend.put("no_gender_break",1);
|
|
|
|
+ }
|
|
|
|
+ if(null!=strategy.getNoAreaBreak()&&strategy.getNoAreaBreak().equals(1)){
|
|
|
|
+ intelliExtend.put("no_area_break",1);
|
|
|
|
+ }
|
|
|
|
+ targetJsonObject.put("intelli_extend",intelliExtend);
|
|
|
|
+ }
|
|
unitParams.put("target",targetJsonObject);
|
|
unitParams.put("target",targetJsonObject);
|
|
return unitParams;
|
|
return unitParams;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private void createCreativeByImage(List<MaterialCutFrame> cutFrameList, List<MaterialImageInfo> orgFrameList,
|
|
|
|
- CtopOauthToken token, JSONObject creativeParams,
|
|
|
|
|
|
+ private void createCreativeByImage(List<MaterialCutFrame> cutFrameList, CtopOauthToken token, JSONObject creativeParams,
|
|
Long campaignId, Long unitId, KuaiShouVideoGet videoItem,
|
|
Long campaignId, Long unitId, KuaiShouVideoGet videoItem,
|
|
int imageNumber){
|
|
int imageNumber){
|
|
int creativeCnt = 1;
|
|
int creativeCnt = 1;
|
|
- if (null!=orgFrameList&&!orgFrameList.isEmpty()) {
|
|
|
|
- for (int i = 0; i < orgFrameList.size(); i++) {
|
|
|
|
- String imageCode = orgFrameList.get(i).getCode();
|
|
|
|
- String imageUrl = orgFrameList.get(i).getUrl();
|
|
|
|
- String imageToken = getImageToken(imageUrl,imageCode,token.getAccountId(),token.getAccessToken());
|
|
|
|
- creativeParams.put("image_token",imageToken);
|
|
|
|
- createCreative(token, creativeParams, campaignId, unitId, creativeCnt,videoItem);
|
|
|
|
- creativeCnt++;
|
|
|
|
- if (creativeCnt > imageNumber) {
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
- if ((null!=cutFrameList&&!cutFrameList.isEmpty()) && (creativeCnt<=15)){
|
|
|
|
|
|
+ if ((null!=cutFrameList&&!cutFrameList.isEmpty())){
|
|
for (int i = 0; i < cutFrameList.size(); i++) {
|
|
for (int i = 0; i < cutFrameList.size(); i++) {
|
|
String imageCode = cutFrameList.get(i).getSignature();
|
|
String imageCode = cutFrameList.get(i).getSignature();
|
|
String imageUrl = cutFrameList.get(i).getUrl();
|
|
String imageUrl = cutFrameList.get(i).getUrl();
|