|
@@ -272,19 +272,56 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
}
|
|
}
|
|
return videoCnt;
|
|
return videoCnt;
|
|
}
|
|
}
|
|
|
|
+
|
|
private JSONObject getCreativeParams(AiBytedanceAdvertiserStrategy strategy, Long adId,ByteDanceVideoInfo videoInfo,CtopOauthToken token) {
|
|
private JSONObject getCreativeParams(AiBytedanceAdvertiserStrategy strategy, Long adId,ByteDanceVideoInfo videoInfo,CtopOauthToken token) {
|
|
JSONObject params = new JSONObject();
|
|
JSONObject params = new JSONObject();
|
|
params.put("advertiser_id", strategy.getAccountId());
|
|
params.put("advertiser_id", strategy.getAccountId());
|
|
params.put("ad_id", adId);
|
|
params.put("ad_id", adId);
|
|
|
|
|
|
|
|
|
|
|
|
+ /*基础创意*/
|
|
|
|
|
|
- String sceneInventory = strategy.getCreativeSceneInventory();
|
|
|
|
- if(!Check.isNull(sceneInventory)){
|
|
|
|
- params.put("scene_inventory",sceneInventory);
|
|
|
|
|
|
+ //行业类别
|
|
|
|
+ String thirdIndustryId = strategy.getCreativeThirdIndustryId();
|
|
|
|
+ if(!Check.isNull(thirdIndustryId)){
|
|
|
|
+ params.put("third_industry_id",thirdIndustryId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //关键词 添加随机关键词逻辑
|
|
|
|
+ String adKeywords = strategy.getCreativeAdKeywords();
|
|
|
|
+ if(!Check.isNull(adKeywords)){
|
|
|
|
+ String [] keywords = adKeywords.split(",");
|
|
|
|
+ if(keywords.length>0){
|
|
|
|
+ if(keywords.length<=20){
|
|
|
|
+ params.put("ad_keywords",keywords);
|
|
|
|
+ }else {
|
|
|
|
+ List<String>keywordList = Arrays.asList(keywords);
|
|
|
|
+ Collections.shuffle(keywordList);
|
|
|
|
+ List<String> getKeyWords = keywordList.subList(0,20);
|
|
|
|
+ params.put("ad_keywords",getKeyWords);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //广告来源
|
|
|
|
+ String source = strategy.getCreativeSource();
|
|
|
|
+ if(!Check.isNull(source)){
|
|
|
|
+ params.put("source",source);
|
|
|
|
+ }
|
|
|
|
+ //推广抖音号
|
|
|
|
+ String iesCoreUserId = strategy.getCreativeIesCoreUserId();
|
|
|
|
+ if(!Check.isNull(iesCoreUserId)){
|
|
|
|
+ params.put("ies_core_user_id",iesCoreUserId);
|
|
|
|
+ }
|
|
|
|
+ //主页作品列表隐藏广告内容
|
|
|
|
+ Integer isFeedAndFavSee = strategy.getCreativeIsFeedAndFavSee();
|
|
|
|
+ if(null!=isFeedAndFavSee&&isFeedAndFavSee!=0){
|
|
|
|
+ params.put("is_feed_and_fav_see",isFeedAndFavSee);
|
|
|
|
+ }
|
|
|
|
+ //是否开启自动生成素材
|
|
|
|
+ Integer creativeAutoGenerateSwitch = strategy.getCreativeAutoGenerateSwitch();
|
|
|
|
+ if(null!=creativeAutoGenerateSwitch&&creativeAutoGenerateSwitch!=1){
|
|
|
|
+ params.put("creative_auto_generate_switch",creativeAutoGenerateSwitch);
|
|
}
|
|
}
|
|
- //程序化创意 非dpa
|
|
|
|
- params.put("creative_material_mode","STATIC_ASSEMBLE");
|
|
|
|
//是否自动生成视频素材
|
|
//是否自动生成视频素材
|
|
Integer isPresentedVideo = strategy.getCreativeIsPresentedVideo();
|
|
Integer isPresentedVideo = strategy.getCreativeIsPresentedVideo();
|
|
if(null!=isPresentedVideo&&isPresentedVideo!=0){
|
|
if(null!=isPresentedVideo&&isPresentedVideo!=0){
|
|
@@ -295,32 +332,44 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
if(null!=generateDerivedAd&&generateDerivedAd!=0){
|
|
if(null!=generateDerivedAd&&generateDerivedAd!=0){
|
|
params.put("generate_derived_ad",generateDerivedAd);
|
|
params.put("generate_derived_ad",generateDerivedAd);
|
|
}
|
|
}
|
|
- //视频素材
|
|
|
|
- JSONArray imageArray = new JSONArray();
|
|
|
|
- JSONObject imageObject = new JSONObject();
|
|
|
|
|
|
+ //搭配试玩素材url
|
|
|
|
+ String playableUrl = strategy.getCreativePlayableUrl();
|
|
|
|
+ if(!Check.isNull(playableUrl)){
|
|
|
|
+ params.put("playable_url",playableUrl);
|
|
|
|
+ }
|
|
|
|
+ //应用名
|
|
|
|
+ String appName = strategy.getCreativeAppName();
|
|
|
|
+ if(!Check.isNull(appName)){
|
|
|
|
+ params.put("app_name",appName);
|
|
|
|
+ }
|
|
|
|
+ //Android应用下载详情页
|
|
|
|
+ String webUrl = strategy.getCreativeWebUrl();
|
|
|
|
+ if(!Check.isNull(webUrl)){
|
|
|
|
+ params.put("web_url",webUrl);
|
|
|
|
+ }
|
|
|
|
+ //落地页链接
|
|
|
|
+ if(!Check.isNull(strategy.getAdExternalUrl())){
|
|
|
|
+ params.put("external_url",strategy.getAdExternalUrl());
|
|
|
|
+ }
|
|
|
|
|
|
- if ("video".equalsIgnoreCase(videoInfo.getMaterialType())){
|
|
|
|
- //视频类型
|
|
|
|
- //1-竖版视频 2-横版视频
|
|
|
|
-// String imageMode = videoInfo.getType() == 1 ? "CREATIVE_IMAGE_MODE_VIDEO_VERTICAL" : "CREATIVE_IMAGE_MODE_VIDEO";
|
|
|
|
- String imageMode = strategy.getCreativeImageMode();
|
|
|
|
- imageObject.put("image_mode",imageMode);
|
|
|
|
- imageObject.put("video_id",videoInfo.getVid());
|
|
|
|
- //获取视频封面id
|
|
|
|
- String imageId = getSuggestImageId(token,videoInfo.getVid());
|
|
|
|
- if(!Check.isNull(imageId)){
|
|
|
|
- imageObject.put("image_id",imageId);
|
|
|
|
- }
|
|
|
|
- }else if ("image".equalsIgnoreCase(videoInfo.getMaterialType())){
|
|
|
|
- //1-大图横图; 2-大图竖图
|
|
|
|
-// String imageMode = videoInfo.getType() == 1 ? "CREATIVE_IMAGE_MODE_LARGE" : "CREATIVE_IMAGE_MODE_LARGE_VERTICAL";
|
|
|
|
- String imageMode = strategy.getCreativeImageMode();
|
|
|
|
- imageObject.put("image_mode",imageMode);
|
|
|
|
- imageObject.put("image_ids",new String[]{videoInfo.getId()});
|
|
|
|
|
|
+ //是否关闭评论,0为开启,1为关闭,默认值:0
|
|
|
|
+ Integer isCommentDisable = strategy.getCreativeIsCommentDisable();
|
|
|
|
+ if(!Check.isNull(isCommentDisable)&&isCommentDisable!=0){
|
|
|
|
+ params.put("is_comment_disable",isCommentDisable);
|
|
}
|
|
}
|
|
|
|
+ //允许客户端下载视频功能
|
|
|
|
+ Integer adDownloadStatus = strategy.getCreativeDownloadStatus();
|
|
|
|
+ if(!Check.isNull(adDownloadStatus)&&adDownloadStatus!=0){
|
|
|
|
+ params.put("ad_download_status",adDownloadStatus);
|
|
|
|
+ }
|
|
|
|
+ //创意展现方式
|
|
|
|
+ String creativeDisplayMode = strategy.getCreativeDisplayMode();
|
|
|
|
+ if(!Check.isNull(creativeDisplayMode)){
|
|
|
|
+ params.put("creative_display_mode",creativeDisplayMode);
|
|
|
|
+ }
|
|
|
|
+ JSONObject ad_data = new JSONObject();
|
|
|
|
+ ad_data.put("ad_data",params);
|
|
|
|
|
|
- imageArray.add(imageObject);
|
|
|
|
- params.put("image_list",imageArray);
|
|
|
|
JSONArray titleArray = new JSONArray();
|
|
JSONArray titleArray = new JSONArray();
|
|
List<BytedanceVideoSlogenInfo> slogenInfos = slogenInfoService.listByParams(videoInfo.getSignature(),1);
|
|
List<BytedanceVideoSlogenInfo> slogenInfos = slogenInfoService.listByParams(videoInfo.getSignature(),1);
|
|
//使用指定文案
|
|
//使用指定文案
|
|
@@ -335,7 +384,8 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
if(null!=creativeWordsIds&&!creativeWordsIds.trim().equals("")){
|
|
if(null!=creativeWordsIds&&!creativeWordsIds.trim().equals("")){
|
|
JSONArray creativeWordsArray = JSON.parseArray(creativeWordsIds);
|
|
JSONArray creativeWordsArray = JSON.parseArray(creativeWordsIds);
|
|
if(null!=creativeWordsArray&&!creativeWordsArray.isEmpty()){
|
|
if(null!=creativeWordsArray&&!creativeWordsArray.isEmpty()){
|
|
- titleObject.put("creative_word_ids",creativeWordsArray);
|
|
|
|
|
|
+ JSONObject creativeObject = new JSONObject();
|
|
|
|
+ titleObject.put("word_list",creativeWordsArray);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
titleArray.add(titleObject);
|
|
titleArray.add(titleObject);
|
|
@@ -355,12 +405,18 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
String creativeWordsIds = byteDanceGeneralCopywriter.get(i).getCreativeWordIds();
|
|
String creativeWordsIds = byteDanceGeneralCopywriter.get(i).getCreativeWordIds();
|
|
if(null!=creativeWordsIds&&!creativeWordsIds.trim().equals("")){
|
|
if(null!=creativeWordsIds&&!creativeWordsIds.trim().equals("")){
|
|
JSONArray creativeWordsArray = JSON.parseArray(creativeWordsIds);
|
|
JSONArray creativeWordsArray = JSON.parseArray(creativeWordsIds);
|
|
- if(null!=creativeWordsArray&&!creativeWordsArray.isEmpty()){
|
|
|
|
- titleObject.put("creative_word_ids",creativeWordsArray);
|
|
|
|
|
|
+ if(null!=creativeWordsArray && !creativeWordsArray.isEmpty()){
|
|
|
|
+ for (Object creative : creativeWordsArray) {
|
|
|
|
+ JSONObject creativeObject = new JSONObject();
|
|
|
|
+ creativeObject.put("word_id",creative);
|
|
|
|
+ creativeWordsArray.add(creativeObject);
|
|
|
|
+ }
|
|
|
|
+ titleObject.put("word_list",creativeWordsArray);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
titleArray.add(titleObject);
|
|
titleArray.add(titleObject);
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
// 图片 使用通用文案 最多10条
|
|
// 图片 使用通用文案 最多10条
|
|
}else if ("image".equalsIgnoreCase(videoInfo.getMaterialType())){
|
|
}else if ("image".equalsIgnoreCase(videoInfo.getMaterialType())){
|
|
@@ -373,154 +429,88 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
if(null!=creativeWordsIds&&!creativeWordsIds.trim().equals("")){
|
|
if(null!=creativeWordsIds&&!creativeWordsIds.trim().equals("")){
|
|
JSONArray creativeWordsArray = JSON.parseArray(creativeWordsIds);
|
|
JSONArray creativeWordsArray = JSON.parseArray(creativeWordsIds);
|
|
if(null!=creativeWordsArray&&!creativeWordsArray.isEmpty()){
|
|
if(null!=creativeWordsArray&&!creativeWordsArray.isEmpty()){
|
|
- titleObject.put("creative_word_ids",creativeWordsArray);
|
|
|
|
|
|
+ for (Object creative : creativeWordsArray) {
|
|
|
|
+ JSONObject creativeObject = new JSONObject();
|
|
|
|
+ creativeObject.put("word_id",creative);
|
|
|
|
+ creativeWordsArray.add(creativeObject);
|
|
|
|
+ }
|
|
|
|
+ titleObject.put("word_list",creativeWordsArray);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
titleArray.add(titleObject);
|
|
titleArray.add(titleObject);
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if(!Check.isNull(titleArray)){
|
|
if(!Check.isNull(titleArray)){
|
|
- params.put("title_list",titleArray);
|
|
|
|
- }
|
|
|
|
- //广告来源
|
|
|
|
- String source = strategy.getCreativeSource();
|
|
|
|
- if(!Check.isNull(source)){
|
|
|
|
- params.put("source",source);
|
|
|
|
- }
|
|
|
|
- //推广抖音号
|
|
|
|
- String iesCoreUserId = strategy.getCreativeIesCoreUserId();
|
|
|
|
- if(!Check.isNull(iesCoreUserId)){
|
|
|
|
- params.put("ies_core_user_id",iesCoreUserId);
|
|
|
|
- }
|
|
|
|
- //主页作品列表隐藏广告内容
|
|
|
|
- Integer isFeedAndFavSee = strategy.getCreativeIsFeedAndFavSee();
|
|
|
|
- if(null!=isFeedAndFavSee&&isFeedAndFavSee!=0){
|
|
|
|
- params.put("is_feed_and_fav_see",isFeedAndFavSee);
|
|
|
|
- }
|
|
|
|
- //是否开启自动生成素材
|
|
|
|
- Integer creativeAutoGenerateSwitch = strategy.getCreativeAutoGenerateSwitch();
|
|
|
|
- if(null!=creativeAutoGenerateSwitch&&creativeAutoGenerateSwitch!=1){
|
|
|
|
- params.put("creative_auto_generate_switch",creativeAutoGenerateSwitch);
|
|
|
|
|
|
+ params.put("title_materials",titleArray);
|
|
|
|
+ }
|
|
|
|
+ JSONArray imageMaterials = new JSONArray();
|
|
|
|
+ JSONObject object = new JSONObject();
|
|
|
|
+ //类型
|
|
|
|
+
|
|
|
|
+ if ("image".equalsIgnoreCase(videoInfo.getMaterialType())){
|
|
|
|
+ //图片素材
|
|
|
|
+ object.put("image_mode",strategy.getCreativeImageMode());
|
|
|
|
+ String[] imageIds = new String[]{videoInfo.getId()};
|
|
|
|
+ JSONArray image_info = new JSONArray();
|
|
|
|
+ for (String imgId : imageIds) {
|
|
|
|
+ JSONObject imageObject = new JSONObject();
|
|
|
|
+ imageObject.put("image_id",imgId);
|
|
|
|
+ image_info.add(imageObject);
|
|
|
|
+ }
|
|
|
|
+ object.put("image_info",image_info);
|
|
|
|
+ imageMaterials.add(object);
|
|
|
|
+ params.put("image_materials",imageMaterials);
|
|
}
|
|
}
|
|
- String appName = strategy.getCreativeAppName();
|
|
|
|
- if(!Check.isNull(appName)){
|
|
|
|
- params.put("app_name",appName);
|
|
|
|
|
|
+
|
|
|
|
+ if ("video".equalsIgnoreCase(videoInfo.getMaterialType())){
|
|
|
|
+ //视频
|
|
|
|
+ object.put("image_mode",strategy.getCreativeImageMode());
|
|
|
|
+ JSONObject videoObj = new JSONObject();
|
|
|
|
+ JSONObject vidIdObj = new JSONObject();
|
|
|
|
+ vidIdObj.put("video_id",videoInfo.getVid());
|
|
|
|
+ videoObj.put("video_info",vidIdObj);
|
|
|
|
+ //视频封面
|
|
|
|
+ JSONObject imgObj = new JSONObject();
|
|
|
|
+ //获取视频封面id
|
|
|
|
+ String imageId = getSuggestImageId(token,videoInfo.getVid());
|
|
|
|
+ if(!Check.isNull(imageId)){
|
|
|
|
+ JSONObject imgId = new JSONObject();
|
|
|
|
+ imgId.put("image_id",imageId);
|
|
|
|
+ imgObj.put("image_info",imgId);
|
|
|
|
+ }
|
|
|
|
+ object.put("image_info",imgObj);
|
|
|
|
+ object.put("video_info",videoObj);
|
|
|
|
+ imageMaterials.add(object);
|
|
|
|
+ params.put("video_materials",imageMaterials);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //副标题
|
|
String subTitle = strategy.getCreativeSubTitle();
|
|
String subTitle = strategy.getCreativeSubTitle();
|
|
if(!Check.isNull(subTitle)){
|
|
if(!Check.isNull(subTitle)){
|
|
- params.put("sub_title",subTitle);
|
|
|
|
|
|
+ JSONObject titleObj = new JSONObject();
|
|
|
|
+ titleObj.put("sub_title",subTitle);
|
|
|
|
+ params.put("sub_title_material",titleObj);
|
|
}
|
|
}
|
|
|
|
|
|
- String webUrl = strategy.getCreativeWebUrl();
|
|
|
|
- if(!Check.isNull(webUrl)){
|
|
|
|
- params.put("web_url",webUrl);
|
|
|
|
|
|
+ //组件id
|
|
|
|
+ JSONArray component = new JSONArray();
|
|
|
|
+ String componentIdStr = strategy.getComponentId();
|
|
|
|
+ String[] componentId = componentIdStr.split(",");
|
|
|
|
+ for (String strId : componentId) {
|
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
|
+ obj.put("component_id",new Long(strId));
|
|
|
|
+ component.add(obj);
|
|
}
|
|
}
|
|
|
|
+ params.put("component_materials",component);
|
|
|
|
|
|
- String actionText = strategy.getCreativeActionText();
|
|
|
|
- if(!Check.isNull(actionText)){
|
|
|
|
- params.put("action_text",actionText);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //搭配试玩素材url
|
|
|
|
- String playableUrl = strategy.getCreativePlayableUrl();
|
|
|
|
- if(!Check.isNull(playableUrl)){
|
|
|
|
- params.put("playable_url",playableUrl);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Integer isCommentDisable = strategy.getCreativeIsCommentDisable();
|
|
|
|
- if(!Check.isNull(isCommentDisable)&&isCommentDisable!=0){
|
|
|
|
- params.put("is_comment_disable",isCommentDisable);
|
|
|
|
- }
|
|
|
|
- String creativeDisplayMode = strategy.getCreativeDisplayMode();
|
|
|
|
- if(!Check.isNull(creativeDisplayMode)){
|
|
|
|
- params.put("creative_display_mode",creativeDisplayMode);
|
|
|
|
- }
|
|
|
|
-// 允许客户端下载视频功能
|
|
|
|
-// Integer adDownloadStatus = strategy.getCreativeAdDownloadStatus();
|
|
|
|
-// if(!Check.isNull(adDownloadStatus)&&adDownloadStatus!=0){
|
|
|
|
-// params.put("ad_download_status",adDownloadStatus);
|
|
|
|
-// }
|
|
|
|
- //商品推广卡片
|
|
|
|
- String imageCode = strategy.getCreativeProductImageCode();
|
|
|
|
- if(!Check.isNull(imageCode)){
|
|
|
|
- //1:根据imageCode获取图片id
|
|
|
|
- JSONObject promotionCard = new JSONObject();
|
|
|
|
- String iconImageId = getBytedanceImageIdByCode(imageCode,token);
|
|
|
|
- if(!Check.isNull(iconImageId)){
|
|
|
|
- promotionCard.put("product_image_id",iconImageId);
|
|
|
|
- }
|
|
|
|
- String productSellingPoints = strategy.getCreativeProductSellingPoints();
|
|
|
|
- if(!Check.isNull(productSellingPoints)){
|
|
|
|
- String[] pointString = productSellingPoints.split(",");
|
|
|
|
- if(pointString.length>0){
|
|
|
|
- promotionCard.put("product_selling_points",pointString);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- String productDescription = strategy.getCreativeProductDescription();
|
|
|
|
- if(!Check.isNull(productDescription)){
|
|
|
|
- promotionCard.put("product_description",productDescription);
|
|
|
|
- }
|
|
|
|
- Boolean enableStorePack = strategy.getCreativeEnablePersonalAction();
|
|
|
|
- if(null!=enableStorePack){
|
|
|
|
- promotionCard.put("enable_store_pack",enableStorePack);
|
|
|
|
- }
|
|
|
|
- String callToAction = strategy.getCreativeCallToAction();
|
|
|
|
- if(!Check.isNull(callToAction)){
|
|
|
|
- promotionCard.put("call_to_action",callToAction);
|
|
|
|
- }
|
|
|
|
- Boolean enablePersonalAction = strategy.getCreativeEnablePersonalAction();
|
|
|
|
- if(null!=enablePersonalAction){
|
|
|
|
- promotionCard.put("enable_personal_action",enablePersonalAction);
|
|
|
|
- }
|
|
|
|
- params.put("promotion_card",promotionCard);
|
|
|
|
- }
|
|
|
|
- //行业类别
|
|
|
|
- String thirdIndustryId = strategy.getCreativeThirdIndustryId();
|
|
|
|
- if(!Check.isNull(thirdIndustryId)){
|
|
|
|
- params.put("third_industry_id",thirdIndustryId);
|
|
|
|
- }
|
|
|
|
- //关键词 添加随机关键词逻辑
|
|
|
|
- String adKeywords = strategy.getCreativeAdKeywords();
|
|
|
|
- if(!Check.isNull(adKeywords)){
|
|
|
|
- String [] keywords = adKeywords.split(",");
|
|
|
|
- if(keywords.length>0){
|
|
|
|
- if(keywords.length<=20){
|
|
|
|
- params.put("ad_keywords",keywords);
|
|
|
|
- }else {
|
|
|
|
- List<String>keywordList = Arrays.asList(keywords);
|
|
|
|
- Collections.shuffle(keywordList);
|
|
|
|
- List<String> getKeyWords = keywordList.subList(0,20);
|
|
|
|
- params.put("ad_keywords",getKeyWords);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- String trackUrl = strategy.getCreativeTrackUrl();
|
|
|
|
- if(!Check.isNull(trackUrl)){
|
|
|
|
- params.put("track_url",trackUrl);
|
|
|
|
- }
|
|
|
|
- String actionTrackUrl = strategy.getCreativeActionTrackUrl();
|
|
|
|
- if(!Check.isNull(actionTrackUrl)){
|
|
|
|
- params.put("action_track_url",actionTrackUrl);
|
|
|
|
- }
|
|
|
|
- String videoPlayEffectiveTrackUrl = strategy.getCreativeVideoPlayEffectiveTrackUrl();
|
|
|
|
- if(!Check.isNull(videoPlayEffectiveTrackUrl)){
|
|
|
|
- params.put("video_play_effective_track_url",videoPlayEffectiveTrackUrl);
|
|
|
|
- }
|
|
|
|
-// String videoPlayDoneTrackUrl = strategy.getCreativeVideoPlayDoneTrackUrl();
|
|
|
|
-// if(!Check.isNull(videoPlayDoneTrackUrl)){
|
|
|
|
-// params.put("video_play_done_track_url",videoPlayDoneTrackUrl);
|
|
|
|
-// }
|
|
|
|
- String videoPlayTrackUrl = strategy.getCreativeVideoPlayTrackUrl();
|
|
|
|
- if(!Check.isNull(videoPlayTrackUrl)){
|
|
|
|
- params.put("video_play_track_url",videoPlayTrackUrl);
|
|
|
|
- }
|
|
|
|
return params;
|
|
return params;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
private String getBytedanceImageIdByCode(String imageCode, CtopOauthToken token) {
|
|
private String getBytedanceImageIdByCode(String imageCode, CtopOauthToken token) {
|
|
//1:根据code获取图片信息
|
|
//1:根据code获取图片信息
|
|
BytedanceImageInfo bytedanceImageInfo = bytedanceImageInfoService.getByParams(imageCode);
|
|
BytedanceImageInfo bytedanceImageInfo = bytedanceImageInfoService.getByParams(imageCode);
|
|
@@ -572,20 +562,29 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
params.put("name",adName);
|
|
params.put("name",adName);
|
|
//竞价策略 默认优先跑量
|
|
//竞价策略 默认优先跑量
|
|
params.put("flow_control_mode","FLOW_CONTROL_MODE_FAST");
|
|
params.put("flow_control_mode","FLOW_CONTROL_MODE_FAST");
|
|
|
|
+
|
|
//投放范围
|
|
//投放范围
|
|
if(null!=strategy.getAdDeliveryRange()&&!"".equals(strategy.getAdDeliveryRange().trim())){
|
|
if(null!=strategy.getAdDeliveryRange()&&!"".equals(strategy.getAdDeliveryRange().trim())){
|
|
params.put("delivery_range",strategy.getAdDeliveryRange());
|
|
params.put("delivery_range",strategy.getAdDeliveryRange());
|
|
- /* if(!"UNION".equals(strategy.getAdDeliveryRange())){
|
|
|
|
|
|
+ //搜索快投
|
|
|
|
+ if(!"UNION".equals(strategy.getAdDeliveryRange())){
|
|
params.put("feed_delivery_search","DISABLED");
|
|
params.put("feed_delivery_search","DISABLED");
|
|
- }*/
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
- params.put("inventory_catalog","MANUAL");
|
|
|
|
- Integer smartInventory = strategy.getCreativeSmartInventory();
|
|
|
|
- if(null!=smartInventory&&smartInventory!=0){
|
|
|
|
- params.put("smart_inventory","NORMAL");
|
|
|
|
|
|
+ //点击监测链接
|
|
|
|
+ String actionTrackUrl = strategy.getCreativeActionTrackUrl();
|
|
|
|
+ if(!Check.isNull(actionTrackUrl)){
|
|
|
|
+ params.put("action_track_url",actionTrackUrl);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ //广告位大类
|
|
|
|
+ if (!Check.isNull(strategy.getInventoryCatalog())){
|
|
|
|
+ params.put("inventory_catalog",strategy.getInventoryCatalog());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //广告投放位置
|
|
String inventoryType = strategy.getCreativeInventoryType();
|
|
String inventoryType = strategy.getCreativeInventoryType();
|
|
if ("CREATIVE_IMAGE_MODE_UNION_SPLASH".equalsIgnoreCase(strategy.getCreativeImageMode())) {
|
|
if ("CREATIVE_IMAGE_MODE_UNION_SPLASH".equalsIgnoreCase(strategy.getCreativeImageMode())) {
|
|
params.put("inventory_type", new String[]{"INVENTORY_UNION_SPLASH_SLOT"});
|
|
params.put("inventory_type", new String[]{"INVENTORY_UNION_SPLASH_SLOT"});
|
|
@@ -597,12 +596,20 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //优选广告位
|
|
|
|
+ if (!Check.isNull(strategy.getCreativeSmartInventory())){
|
|
|
|
+ params.put("smart_inventory",strategy.getCreativeSmartInventory());
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ // 投放形式
|
|
if(!Check.isNull(strategy.getAdUnionVideoType())){
|
|
if(!Check.isNull(strategy.getAdUnionVideoType())){
|
|
params.put("union_video_type",strategy.getAdUnionVideoType());
|
|
params.put("union_video_type",strategy.getAdUnionVideoType());
|
|
}
|
|
}
|
|
- //投放目标
|
|
|
|
|
|
+
|
|
|
|
+ //下载方式
|
|
params.put("download_type",strategy.getAdDownloadType());
|
|
params.put("download_type",strategy.getAdDownloadType());
|
|
|
|
+
|
|
|
|
+
|
|
if(!Check.isNull(strategy.getAdDownloadUrl())){
|
|
if(!Check.isNull(strategy.getAdDownloadUrl())){
|
|
params.put("download_url",strategy.getAdDownloadUrl());
|
|
params.put("download_url",strategy.getAdDownloadUrl());
|
|
}
|
|
}
|
|
@@ -614,9 +621,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
if(!Check.isNull(strategy.getAdQuickAppUrl())){
|
|
if(!Check.isNull(strategy.getAdQuickAppUrl())){
|
|
params.put("quick_app_url",strategy.getAdQuickAppUrl());
|
|
params.put("quick_app_url",strategy.getAdQuickAppUrl());
|
|
}
|
|
}
|
|
- if(!Check.isNull(strategy.getAdExternalUrl())){
|
|
|
|
- params.put("external_url",strategy.getAdExternalUrl());
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
if(!Check.isNull(strategy.getAdAppType())){
|
|
if(!Check.isNull(strategy.getAdAppType())){
|
|
params.put("app_type",strategy.getAdAppType());
|
|
params.put("app_type",strategy.getAdAppType());
|
|
}
|
|
}
|
|
@@ -1055,10 +1060,9 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
if(null != strategy.getCampaignDeliveryRelatedNum()&&!"".equals(strategy.getCampaignDeliveryRelatedNum().trim())){
|
|
if(null != strategy.getCampaignDeliveryRelatedNum()&&!"".equals(strategy.getCampaignDeliveryRelatedNum().trim())){
|
|
campaignParam.put("delivery_related_num",strategy.getCampaignDeliveryRelatedNum());
|
|
campaignParam.put("delivery_related_num",strategy.getCampaignDeliveryRelatedNum());
|
|
}
|
|
}
|
|
|
|
+ //营销目的 --行动转化
|
|
|
|
|
|
campaignParam.put("marketing_purpose","CONVERSION");
|
|
campaignParam.put("marketing_purpose","CONVERSION");
|
|
-
|
|
|
|
- log.info("token获取失败=>accountId:{}", strategy.getAccountId());
|
|
|
|
//创建组
|
|
//创建组
|
|
Result campaignData = marketingService.createCampaign(token, campaignParam);
|
|
Result campaignData = marketingService.createCampaign(token, campaignParam);
|
|
log.info("===创建组==={}",campaignData);
|
|
log.info("===创建组==={}",campaignData);
|
|
@@ -1798,4 +1802,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|