|
@@ -170,6 +170,7 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
|
|
|
data.put("ad_id", adId);
|
|
|
String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_creative_create_v2");
|
|
|
JSONObject result = HttpUtils.bytedancePostRequest(token.getAccessToken(),url,data);
|
|
|
+ System.out.println(result);
|
|
|
Integer code = result.getInteger("code");
|
|
|
String message = result.getString("message");
|
|
|
if (null == code || code != 0) {
|
|
@@ -272,7 +273,7 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
|
|
|
public Map<String, Object> batchCreate(JSONObject data) {
|
|
|
log.info(data.toJSONString());
|
|
|
Map<String,Object>result = new HashMap<>();
|
|
|
- Long accountId = data.getLong("advertiserId");
|
|
|
+ Long accountId = data.getLong("accountId");
|
|
|
CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
|
|
|
if(null == token){
|
|
|
ResultMapUtils.setResultMap(result,StatusCode.COMMON_PARAM_ERROR);
|
|
@@ -285,8 +286,13 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
|
|
|
}
|
|
|
//拼接参数
|
|
|
JSONObject params = initParams(data);
|
|
|
-
|
|
|
- return null;
|
|
|
+ JSONArray array = new JSONArray();
|
|
|
+ for(int i=0;i<planIds.size();i++){
|
|
|
+ Map<String,Object> getData = creativeCreate(accountId+"",planIds.getLong(i),params);
|
|
|
+ array.add(getData);
|
|
|
+ }
|
|
|
+ result.put("data",array);
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
private JSONObject initParams(JSONObject data) {
|
|
@@ -351,12 +357,12 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
|
|
|
if(null!=generateDerivedAd&&generateDerivedAd!=0){
|
|
|
params.put("generate_derived_ad",generateDerivedAd);
|
|
|
}
|
|
|
- String playableUrl = data.getString("playable_url");
|
|
|
+ String playableUrl = data.getString("playableUrl");
|
|
|
if(null!=playableUrl&&!"".equals(playableUrl.trim())){
|
|
|
params.put("playable_url",playableUrl);
|
|
|
}
|
|
|
Long isPresentedVideo = data.getLong("isPresentedVideo");
|
|
|
- if(null!=isCommentDisable&&isPresentedVideo!=0){
|
|
|
+ if(null!=isPresentedVideo&&isPresentedVideo!=0){
|
|
|
params.put("is_presented_video",isPresentedVideo);
|
|
|
}
|
|
|
Long creativeAutoGenerateSwitch = data.getLong("creativeAutoGenerateSwitch");
|