|
@@ -1,5 +1,6 @@
|
|
|
package org.jeecg.modules.bytedance.advertise.dockapi;
|
|
|
|
|
|
+import android.widget.CheckBox;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -538,20 +539,23 @@ public class MarketingServiceImpl implements MarketingService{
|
|
|
* @description: 获取广告计划
|
|
|
*
|
|
|
* @param token
|
|
|
- * @param planSearchVoList 广告计划 入参
|
|
|
+ * @param
|
|
|
* @return: org.jeecg.common.api.vo.Result
|
|
|
* @author: zianY
|
|
|
*/
|
|
|
@Override
|
|
|
- public Result getPlanList(CtopOauthToken token, List<PlanSearchVo> planSearchVoList, Integer pageNo, Integer pageSize) {
|
|
|
+ public Result getPlanList(CtopOauthToken token, PlanSearchVo planSearchVo, Integer pageNo, Integer pageSize) {
|
|
|
JSONObject params = new JSONObject();
|
|
|
params.put("advertiser_id", token.getAccountId());
|
|
|
- params.put("filtering", planSearchVoList);
|
|
|
+ params.put("filtering", planSearchVo);
|
|
|
params.put("page", pageNo);
|
|
|
params.put("page_size", pageSize);
|
|
|
- JSONObject jsonObject = HttpUtils.bytedancePostRequest(token.getAccessToken(),
|
|
|
+ JSONObject jsonObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(),
|
|
|
urlPath + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_get_plan"),
|
|
|
params);
|
|
|
+ if (Check.isNull(jsonObject)){
|
|
|
+ return Result.errorMsg(jsonObject.get("message").toString());
|
|
|
+ }
|
|
|
Integer code = jsonObject.getInteger("code");
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
if (code != 0) {
|
|
@@ -709,7 +713,7 @@ public class MarketingServiceImpl implements MarketingService{
|
|
|
//广告计划名称
|
|
|
params.put("name", strategy.getAdName());
|
|
|
//计划状态 默认值: "enable"开启状态 允许值: "enable"开启,"disable"关闭
|
|
|
- params.put("operation", BytedanceConstant.OPERATION_ENABLE);
|
|
|
+ //params.put("operation", BytedanceConstant.OPERATION_ENABLE);
|
|
|
// 投放范围 "DEFAULT"默认, "UNION"穿山甲
|
|
|
params.put("delivery_range", strategy.getAdDeliveryRange() == null ? "DEFAULT" : strategy.getAdDeliveryRange());
|
|
|
//投放形式(穿山甲视频创意类型) 当delivery_range为"UNION"时必填
|
|
@@ -743,8 +747,9 @@ public class MarketingServiceImpl implements MarketingService{
|
|
|
//直达链接(点击唤起APP)
|
|
|
params.put("open_url", strategy.getAdOpenUrl());
|
|
|
//搜索快投功能,允许值:HAS_OPEN:启用,DISABLED:不启用
|
|
|
- params.put("feed_delivery_search", "搜索快投");
|
|
|
+ //params.put("feed_delivery_search", "搜索快投");
|
|
|
//用户定向
|
|
|
+ params.put("audience_package_id",strategy.getAdAudiencePackageId());
|
|
|
//允许值: "CITY"省市, "COUNTY"区县, "BUSINESS_DISTRICT"商圈,"NONE"不限
|
|
|
params.put("district", strategy.getAdScheduleType());
|
|
|
//性别 允许值: "GENDER_FEMALE", "GENDER_MALE", "NONE"
|
|
@@ -795,10 +800,10 @@ public class MarketingServiceImpl implements MarketingService{
|
|
|
Integer code = jsonObject.getInteger("code");
|
|
|
if (null == code || !code.equals(0)) {
|
|
|
log.error("广告计划修改失败==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
|
|
|
- Result.error(jsonObject.getString("message"));
|
|
|
+ return Result.error(jsonObject.getString("message"));
|
|
|
}
|
|
|
//byteDanceAdvertisePlan.setId(jsonObject.getJSONObject("data").getLong("ad_id"));
|
|
|
- return Result.successMsg("广告计划修改成功成功",jsonObject.getString("data"));
|
|
|
+ return Result.successMsg("广告计划修改成功",jsonObject.getString("data"));
|
|
|
}
|
|
|
|
|
|
|