|
@@ -319,15 +319,20 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
}
|
|
|
private JSONObject getCreativeParams(AiBytedanceAdvertiserStrategy strategy, Long adId,ByteDanceVideoInfo videoInfo,CtopOauthToken token) {
|
|
|
JSONObject params = new JSONObject();
|
|
|
- params.put("advertiser_id",strategy.getAccountId());
|
|
|
- params.put("ad_id",adId);
|
|
|
+ params.put("advertiser_id", strategy.getAccountId());
|
|
|
+ params.put("ad_id", adId);
|
|
|
String inventoryType = strategy.getCreativeInventoryType();
|
|
|
- if(null!=inventoryType&&!"".equals(inventoryType)){
|
|
|
+ if ("CREATIVE_IMAGE_MODE_UNION_SPLASH".equalsIgnoreCase(strategy.getCreativeImageMode())) {
|
|
|
+ params.put("inventory_type", new String[]{"INVENTORY_UNION_SPLASH_SLOT"});
|
|
|
+ } else {
|
|
|
+ if (null != inventoryType && !"".equals(inventoryType)) {
|
|
|
String[] inventoryTypeString = inventoryType.split(",");
|
|
|
- if(inventoryTypeString.length>0){
|
|
|
- params.put("inventory_type",inventoryTypeString);
|
|
|
+ if (inventoryTypeString.length > 0) {
|
|
|
+ params.put("inventory_type", inventoryTypeString);
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
Integer smartInventory = strategy.getCreativeSmartInventory();
|
|
|
if(null!=smartInventory&&smartInventory!=0){
|
|
|
params.put("smart_inventory",smartInventory);
|
|
@@ -395,17 +400,18 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
titleArray.add(titleObject);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
// 视频 指定文案不够的时候 使用通用文案 最多3条
|
|
|
if ("video".equalsIgnoreCase(videoInfo.getMaterialType())){
|
|
|
- for(int i = 0; i < 3; i++){
|
|
|
- if(titleArray.size() >= 10){
|
|
|
- break;
|
|
|
- }
|
|
|
- ByteDanceGeneralCopywriter byteDanceGeneralCopywriter = byteDanceGeneralCopywriterMapper.getRandOne(strategy.getAccountId());
|
|
|
- if(!Check.isNull(byteDanceGeneralCopywriter)){
|
|
|
+ List<ByteDanceGeneralCopywriter> byteDanceGeneralCopywriter = byteDanceGeneralCopywriterMapper.getRandThree(strategy.getAccountId());
|
|
|
+ if(!Check.isNull(byteDanceGeneralCopywriter)){
|
|
|
+ for(int i = 0; i < byteDanceGeneralCopywriter.size(); i++){
|
|
|
+ if(titleArray.size() >= 10){
|
|
|
+ break;
|
|
|
+ }
|
|
|
JSONObject titleObject = new JSONObject();
|
|
|
- titleObject.put("title",byteDanceGeneralCopywriter.getTextCopywriter());
|
|
|
- String creativeWordsIds = byteDanceGeneralCopywriter.getCreativeWordIds();
|
|
|
+ titleObject.put("title",byteDanceGeneralCopywriter.get(i).getTextCopywriter());
|
|
|
+ String creativeWordsIds = byteDanceGeneralCopywriter.get(i).getCreativeWordIds();
|
|
|
if(null!=creativeWordsIds&&!creativeWordsIds.trim().equals("")){
|
|
|
JSONArray creativeWordsArray = JSON.parseArray(creativeWordsIds);
|
|
|
if(null!=creativeWordsArray&&!creativeWordsArray.isEmpty()){
|