Przeglądaj źródła

Merge branch 'master' into test

syh 5 lat temu
rodzic
commit
5367813237

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserDataLoadJob.java

@@ -45,7 +45,7 @@ public class BytedanceAdvertiserDataLoadJob implements Job {
             //2:获取当日广告计划数据
             advertiserDataService.getAdvertiserPlan(token, "", dateString, null);
             //3:获取当日创意数据
-            creativeService.getAdvertiserCreative(token.getAccountId() + "", "", dateString);
+            creativeService.getAdvertiserCreative(token, "", dateString);
         }));
         log.info("物料数据同步完成");
     }

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceSameDayCreativeLoadJob.java

@@ -42,7 +42,7 @@ public class BytedanceSameDayCreativeLoadJob implements Job {
                 public void run() {
                     try {
                         String getDateString = DateUtils.formatDate(new Date());
-                        advertiserDataService.getAdvertiserCreative(token, getDateString);
+//                        advertiserDataService.getAdvertiserCreative(token, getDateString);
                     } catch (Exception e) {
                         e.printStackTrace();
                     } finally {

+ 1 - 11
jeecg-boot-module-system/src/main/resources/application-wps.yml

@@ -99,20 +99,10 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-#          url: jdbc:mysql://139.186.27.96:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-#          username: hcst
-#          password: test@20190531
-#          driver-class-name: com.mysql.jdbc.Driver、
-          url: jdbc:mysql://139.186.27.96:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
           username: hcst
           password: test@20190531
           driver-class-name: com.mysql.jdbc.Driver
-          # 多数据源配置
-          #multi-datasource1:
-          #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true
-          #username: root
-          #password: root
-          #driver-class-name: com.mysql.jdbc.Driver
   #redis 配置
   redis:
     database: 0

+ 1 - 1
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceAdvertisingDataLoadJob.java

@@ -47,7 +47,7 @@ public class BytedanceAdvertisingDataLoadJob {
                 //2:获取当日广告计划数据
                 advertiserDataService.getAdvertiserPlan(token, "", dateString, null);
                 //3:获取当日创意数据
-                creativeService.getAdvertiserCreative(token.getAccountId() + "", "", dateString);
+                creativeService.getAdvertiserCreative(token, "", dateString);
             } catch (Exception e) {
                 e.printStackTrace();
             }

+ 3 - 4
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceSameDayCreativeLoadJob.java

@@ -3,7 +3,7 @@ package cn.com.ctop.job.bytedance.handler;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeService;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import org.jeecg.common.util.DateUtils;
@@ -21,13 +21,12 @@ public class BytedanceSameDayCreativeLoadJob {
     private ICtopOauthTokenService tokenService;
     static ExecutorService executorService = Executors.newFixedThreadPool(6);
     @Autowired
-    private IByteDanceAdvertiserDataService advertiserDataService;
-
+    private IByteDanceCreativeService byteDanceCreativeService;
     @XxlJob("bytedanceSameDayCreative")
     public ReturnT<String> execute(String param) throws Exception {
         List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
         String getDateStr = DateUtils.formatDate(new Date());
-        tokens.forEach(token -> executorService.submit(() -> advertiserDataService.getAdvertiserCreative(token, getDateStr)));
+        tokens.forEach(token -> executorService.submit(() -> byteDanceCreativeService.getAdvertiserCreative(token, null,getDateStr)));
         return ReturnT.SUCCESS;
     }
 }

+ 20 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceCampaignController.java

@@ -47,9 +47,21 @@ public class ByteDanceCampaignController {
     public Result<IPage<ByteDanceCampaign>> queryPageList(ByteDanceCampaign byteDanceCampaign,
                                                           @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                           @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                          @RequestParam(name="startDate",defaultValue = "")String startDate,
+                                                          @RequestParam(name="endDate",defaultValue = "")String endDate,
                                                           HttpServletRequest req) {
         Result<IPage<ByteDanceCampaign>> result = new Result<>();
+        String name = byteDanceCampaign.getName();
         QueryWrapper<ByteDanceCampaign> queryWrapper = QueryGenerator.initQueryWrapper(byteDanceCampaign, req.getParameterMap());
+        if(null!=name&&!"".equalsIgnoreCase(name)){
+            queryWrapper.like("name",name);
+        }
+        if(null!=startDate&&!"".equals(startDate)){
+            queryWrapper.ge("campaign_create_time",startDate+" 00:00:00");
+        }
+        if(null!=endDate&&!"".equals(endDate)){
+            queryWrapper.le("campaign_create_time",endDate+" 11:59:59");
+        }
         queryWrapper.orderByDesc("campaign_create_time");
         Page<ByteDanceCampaign> page = new Page<>(pageNo, pageSize);
         IPage<ByteDanceCampaign> pageList = byteDanceCampaignService.page(page, queryWrapper);
@@ -106,6 +118,14 @@ public class ByteDanceCampaignController {
     }
 
     /**
+     * 修改广告组状态
+     * @return
+     */
+//    @PostMapping("/editStatus")
+//    public Map<String,Object> editStatus(){
+//
+//    }
+    /**
      * 通过id删除
      *
      * @param id

+ 3 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceCreative.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.toutiao.modules.material.entity;
 
+import cn.com.ctop.common.module.entity.CtopOauthToken;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -134,11 +135,11 @@ public class ByteDanceCreative {
 
     }
 
-    public ByteDanceCreative(JSONObject dataObject, String accountId) {
+    public ByteDanceCreative(JSONObject dataObject, CtopOauthToken token) {
         this.id = dataObject.getLong("creative_id");
         this.planId = dataObject.getLong("ad_id");
         this.toutiaoId = dataObject.getLong("advertiser_id");
-        this.accountId = accountId;
+        this.accountId = token.getAccountId()+"";
         String title = dataObject.getString("title");
         if (null != title && !"".equals(title.trim())) {
             this.title = title;

+ 0 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceAdvertiserDataService.java

@@ -19,8 +19,6 @@ public interface IByteDanceAdvertiserDataService {
 
     Map<String, Object> getAdvertiserCreativeMaterial(String accountId, String creativeIds);
 
-    Map<String, Object> getAdvertiserCreative(CtopOauthToken token, String date);
-
     Map<String, Object> advertiserPlanUpdateStatus(CtopOauthToken token, String adIds, String optStatus);
 
     Map<String, Object> advertiserPlanUpdateBid(CtopOauthToken token, String adIds, String bids);

+ 9 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceCreativeService.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.toutiao.modules.material.service;
 
+import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.toutiao.modules.material.entity.ByteDanceCreative;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -15,13 +16,17 @@ import java.util.Map;
  */
 public interface IByteDanceCreativeService extends IService<ByteDanceCreative> {
 
-    Map<String, Object> creativeCreate(String accountId, Long campaignId, String dataString);
+    Map<String, Object> creativeCreate(String accountId, Long campaignId, JSONObject data);
 
-    JSONObject createCreative(JSONObject data, String token);
-
-    Map<String, Object> getAdvertiserCreative(String accountId, String ids, String date);
+    Map<String, Object> getAdvertiserCreative(CtopOauthToken token, String ids, String date);
 
     Map<String, Object> advertiserCreativeUpdateStatus(String accountId, String creativeIds, String optStatus);
 
     void replaceBatch(List<ByteDanceCreative> creatives);
+
+    Map<String, Object> getCreativeDetail(Long accountId, Long adId);
+
+    Map<String,Object> updateCreative(Long accountId, JSONObject data);
+
+    Map<String,Object> getCreativeRejectReason(Long accountId, Long creativeId);
 }

+ 2 - 10
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceAdvertiserDataServiceImpl.java

@@ -261,15 +261,7 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         return resultMap;
     }
 
-    @Override
-    public Map<String, Object> getAdvertiserCreative(CtopOauthToken token, String date) {
-        log.info("开始获取创意信息=>accountId:{}", token.getAccountId());
-        Map<String, Object> result = new HashMap<>();
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-        getCreativeByPage(token, date, 1);
-        log.info("创意信息获取结束=>accountId:{}", token.getAccountId());
-        return result;
-    }
+
 
     private void getCreativeByPage(CtopOauthToken token, String date, int pageNum) {
         JSONObject resultObject = getCreative(token, date, pageNum);
@@ -285,7 +277,7 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         List<ByteDanceCreative> creatives = new ArrayList<>();
         for (int i = 0; i < data.size(); i++) {
             JSONObject dataObject = data.getJSONObject(i);
-            ByteDanceCreative creative = new ByteDanceCreative(dataObject, token.getAccountId() + "");
+            ByteDanceCreative creative = new ByteDanceCreative(dataObject, token);
             creatives.add(creative);
         }
         creativeMapper.replaceBatch(creatives);

+ 116 - 70
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceCreativeServiceImpl.java

@@ -2,10 +2,7 @@ package cn.com.ctop.toutiao.modules.material.service.impl;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.service.IFileInfoService;
-import cn.com.ctop.common.module.utils.HttpUtils;
-import cn.com.ctop.common.module.utils.PropertiesUtils;
-import cn.com.ctop.common.module.utils.StringUtils;
+import cn.com.ctop.common.module.utils.*;
 import cn.com.ctop.toutiao.modules.material.entity.ByteDanceCreative;
 import cn.com.ctop.toutiao.modules.material.mapper.ByteDanceCreativeMapper;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeService;
@@ -13,20 +10,10 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.http.client.ClientProtocolException;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.ContentType;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClientBuilder;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -43,18 +30,23 @@ import java.util.TreeMap;
 @Primary
 public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeMapper, ByteDanceCreative> implements IByteDanceCreativeService {
     @Autowired
-    private IFileInfoService fileInfoService;
-    @Autowired
     private ICtopOauthTokenService tokenService;
     @Autowired
     private ByteDanceCreativeMapper creativeMapper;
 
+    /**
+     * 更改创意状态
+     * @param accountId
+     * @param creativeIds
+     * @param optStatus
+     * @return
+     */
     @Override
     public Map<String, Object> advertiserCreativeUpdateStatus(String accountId, String creativeIds, String optStatus) {
         Map<String, Object> resultMap = new HashMap<>();
         JSONArray ids = new JSONArray();
         String[] getCreativeIds = creativeIds.split(StringUtils.COMMA);
-        if (null != getCreativeIds && getCreativeIds.length > 0) {
+        if (getCreativeIds.length > 0) {
             for (int i = 0; i < getCreativeIds.length; i++) {
                 ids.add(Long.parseLong(getCreativeIds[i]));
             }
@@ -88,8 +80,8 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
             return resultMap;
         }
         JSONArray returnCreativeIds = data.getJSONArray("creative_ids");
-        if (null != returnCreativeIds && returnCreativeIds.size() > 0) {
-            getAdvertiserCreative(accountId, creativeIds, null);
+        if (null != returnCreativeIds && !returnCreativeIds.isEmpty()) {
+            getAdvertiserCreative(cTopOauthToken, creativeIds, null);
         }
         resultMap.put("code", 0);
         resultMap.put("message", "广告创意状态修改成功");
@@ -101,22 +93,28 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
         creativeMapper.replaceBatch(creatives);
     }
 
+    /**
+     * 获取创意列表,入库
+     * @param token
+     * @param ids
+     * @param date
+     * @return
+     */
     @Override
-    public Map<String, Object> getAdvertiserCreative(String accountId, String ids, String date) {
+    public Map<String, Object> getAdvertiserCreative(CtopOauthToken token, String ids, String date) {
         Map<String, Object> resultMap = new HashMap<>();
-        getAdvertiserCreativeByPageNumber(accountId, 1, ids, date);
+        getAdvertiserCreativeByPageNumber(token, 1, ids, date);
         resultMap.put("code", 0);
         resultMap.put("message", "获取广告主广告创意信息完成");
         return resultMap;
     }
 
-    public void getAdvertiserCreativeByPageNumber(String accountId, Integer pageNumber, String ids, String date) {
-        CtopOauthToken cTopOauthToken = tokenService.getOauthTokenByAccountId(accountId);
+    public void getAdvertiserCreativeByPageNumber(CtopOauthToken token, Integer pageNumber, String ids, String date) {
         //2: 根据token以及用户id获取用户信息数据
         String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_creative_get");
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", "application/json");
-        headers.put("Access-Token", cTopOauthToken.getAccessToken());
+        headers.put("Access-Token", token.getAccessToken());
 
         TreeMap<String, Object> params = new TreeMap<>();
         JSONObject filtering = new JSONObject();
@@ -133,38 +131,45 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
             filtering.put("creative_create_time", date);
         }
         params.put("filtering", filtering.toJSONString());
-        params.put("advertiser_id", cTopOauthToken.getAccountId());
+        params.put("advertiser_id", token.getAccountId());
         params.put("page", pageNumber + "");
         String result = HttpUtils.httpGetRequest(url, headers, params);
         JSONObject jsonObject = JSONObject.parseObject(result);
         Integer code = jsonObject.getInteger("code");
 
         if (null == code || !code.equals(0)) {
-            log.info("获取广告主广告创意信息接口异常==》accountId:{},message:{}", accountId, jsonObject.getString("message"));
+            log.info("获取广告主广告创意信息接口异常==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
             return;
         }
         JSONArray data = jsonObject.getJSONObject("data").getJSONArray("list");
-        if (null == data || data.size() <= 0) {
-            log.info("广告主广告创意信息不存在==》accountId:{},message:{}", accountId, jsonObject.getString("message"));
+        if (null == data || data.isEmpty()) {
+            log.info("广告主广告创意信息不存在==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
             return;
         }
         for (int i = 0; i < data.size(); i++) {
             JSONObject dataObject = data.getJSONObject(i);
-            ByteDanceCreative creative = new ByteDanceCreative(dataObject, accountId);
+            ByteDanceCreative creative = new ByteDanceCreative(dataObject, token);
             this.saveOrUpdate(creative);
         }
-        getAdvertiserCreativeByPageNumber(accountId, pageNumber + 1, ids, date);
+        getAdvertiserCreativeByPageNumber(token, pageNumber + 1, ids, date);
     }
 
+    /**
+     * 创建创意
+     * @param accountId
+     * @param adId
+     * @param data
+     * @return
+     */
     @Override
-    public Map<String, Object> creativeCreate(String accountId, Long adId, String dataString) {
+    public Map<String, Object> creativeCreate(String accountId, Long adId, JSONObject data) {
         Map<String, Object> resultMap = new HashMap<>();
         //1:获取token
         CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
-        JSONObject data = JSONObject.parseObject(dataString);
         data.put("advertiser_id", token.getAccountId());
         data.put("ad_id", adId);
-        JSONObject result = createCreative(data, token.getAccessToken());
+        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);
         Integer code = result.getInteger("code");
         String message = result.getString("message");
         if (null == code || code != 0) {
@@ -180,45 +185,86 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
         return resultMap;
     }
 
+    /**
+     * 获取创意详细信息
+     * @return
+     */
     @Override
-    public JSONObject createCreative(JSONObject data, String token) {
-        // 构造请求
-        String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_creative_create_v2");
-        HttpPost httpEntity = new HttpPost(url);
-        httpEntity.setHeader("Access-Token", token);
-        CloseableHttpResponse response = null;
-        CloseableHttpClient client = null;
-        try {
-            client = HttpClientBuilder.create().build();
-            httpEntity.setEntity(new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON));
-            response = client.execute(httpEntity);
-            if (response != null && response.getStatusLine().getStatusCode() == 200) {
-                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-                StringBuffer result = new StringBuffer();
-                String line = "";
-                while ((line = bufferedReader.readLine()) != null) {
-                    result.append(line);
-                }
-                bufferedReader.close();
-                return JSONObject.parseObject(result.toString());
-            }
+    public Map<String, Object> getCreativeDetail(Long accountId, Long adId){
+        Map<String,Object>resultMap = new HashMap<>();
+        CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+        // 请求地址
+        String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_creative_read");
+        // 请求参数
+        JSONObject data = new JSONObject();
+        data.put("advertiser_id", token.getAccountId());
+        data.put("ad_id",adId);
+        JSONObject result = HttpUtils.bytedanceGetRequest(token.getAccessToken(),url,data);
+        Integer code = result.getInteger("code");
+        String message = result.getString("message");
+        if (null == code || code != 0) {
+            log.info("广告创意获取详情失败,accountId:{},message:{}", accountId, message);
+            resultMap.put("success", false);
+            resultMap.put("code", -1);
+            resultMap.put("message", message);
+            return resultMap;
+        }
+        resultMap.put("data",result.getJSONObject("data"));
+        ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS);
+        return resultMap;
+    }
 
-        } catch (ClientProtocolException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                if (response != null) {
-                    response.close();
-                }
-                if (null != client) {
-                    client.close();
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
+    /**
+     * TODO 后续需要拼接参数
+     * @param accountId
+     * @param data
+     * @return
+     */
+    @Override
+    public Map<String,Object> updateCreative(Long accountId,JSONObject data){
+        Map<String,Object>resultMap = new HashMap<>();
+        CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+        // 请求地址
+        String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_creative_update");
+        JSONObject result = HttpUtils.bytedancePostRequest(token.getAccessToken(),url,data);
+        Integer code = result.getInteger("code");
+        String message = result.getString("message");
+        if (null == code || code != 0) {
+            log.info("广告创意更新失败,accountId:{},message:{}", accountId, message);
+            resultMap.put("success", false);
+            resultMap.put("code", -1);
+            resultMap.put("message", message);
+            return resultMap;
+        }
+        resultMap.put("data",result.getJSONObject("data"));
+        ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS);
+        return resultMap;
+    }
+
+    @Override
+    public Map<String,Object> getCreativeRejectReason(Long accountId, Long creativeId){
+        Map<String,Object>resultMap = new HashMap<>();
+        CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+        JSONArray creativeIds = new JSONArray();
+        creativeIds.add(creativeId);
+        // 请求地址
+        String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_creative_reject_reason");
+        // 请求参数
+        JSONObject data = new JSONObject();
+        data.put("advertiser_id", accountId);
+        data.put("creative_ids", creativeIds);
+        JSONObject result = HttpUtils.bytedancePostRequest(token.getAccessToken(),url,data);
+        Integer code = result.getInteger("code");
+        String message = result.getString("message");
+        if (null == code || code != 0) {
+            log.info("广告创意创意审核建议获取失败,accountId:{},message:{}", accountId, message);
+            resultMap.put("success", false);
+            resultMap.put("code", -1);
+            resultMap.put("message", message);
+            return resultMap;
         }
-        return null;
+        resultMap.put("data",result.getJSONObject("data"));
+        ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS);
+        return resultMap;
     }
 }

+ 3 - 0
module-toutiao/src/main/resources/bytedance_config.properties

@@ -30,6 +30,9 @@ bytedance_v2_creative_update_status=/2/creative/update/status/
 bytedance_v2_creative_material_get=/2/creative/material/read/
 bytedance_v2_creative_create_v2=/2/creative/create_v2/
 bytedance_v2_creative_get=/2/creative/get/
+bytedance_v2_creative_read=/2/creative/read_v2/
+bytedance_v2_creative_update=/2/creative/update_v2/
+bytedance_v2_creative_reject_reason=/2/creative/reject_reason/
 ##报表相关
 bytedance_v2_advertiser_report_get=/2/report/advertiser/get/
 bytedance_v2_campaign_report_get=/2/report/campaign/get/