Forráskód Böngészése

添加获取用户定向包接口

syh 4 éve
szülő
commit
0b8d5b0e69

+ 0 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -76,8 +76,6 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/appium/crawler/*", "anon");
 
         filterChainDefinitionMap.put("/ctop/kuaishouChannelRegInfo/*", "anon");
-
-
         filterChainDefinitionMap.put("/ctop/byteDance/homePage/report/*", "anon");
         filterChainDefinitionMap.put("/ctop/material/top/cost", "anon");
 

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialCutFrameService.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.io.IOException;
 import java.util.List;
-import java.util.Map;
 
 /**
  * 截屏
@@ -30,4 +29,5 @@ public interface IMaterialCutFrameService extends IService<MaterialCutFrame> {
 
     MaterialCutFrame getCutFrameByCode(String code);
 
+    boolean updateTencentCutFrame(String videoMD5);
 }

+ 12 - 5
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/controller/BytedanceAudienceTemplateController.java

@@ -1,21 +1,28 @@
 package cn.com.ctop.toutiao.modules.batch.controller;
 
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import com.alibaba.fastjson.JSONObject;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.HashMap;
 import java.util.Map;
 
 @RestController
-@RequestMapping("ctop/audience/template")
+@RequestMapping("ctop/audience")
 public class BytedanceAudienceTemplateController {
-    @PostMapping("create")
+    @Autowired
+    private IByteDanceAdvertiserDataService advertiserDataService;
+    @PostMapping("/template/create")
     public Map<String,Object> createAudiencePackageTemplate(HttpServletRequest request, JSONObject data){
         Map<String,Object> result = new HashMap<>();
 
         return result;
     }
+
+    @GetMapping("list")
+    public Map<String,Object>getAudienceList(@RequestParam(value = "accountId",defaultValue = "")String accountId){
+        return advertiserDataService.advertiserCustomAudienceSelect(accountId);
+    }
 }

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

@@ -453,7 +453,6 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         return resultMap;
     }
 
-
     /**
      * 查询人群包信息
      *
@@ -462,8 +461,15 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
     @Override
     public Map<String, Object> advertiserCustomAudienceSelect(String accountId) {
         Map<String, Object> resultMap = new HashMap<>();
+        if(null == accountId||accountId.trim().equals("")){
+            ResultMapUtils.setResultMap(resultMap,StatusCode.COMMON_PARAM_ERROR);
+            return resultMap;
+        }
         CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
-
+        if(null==token){
+            ResultMapUtils.setResultMap(resultMap,StatusCode.COMMON_PARAM_ERROR);
+            return resultMap;
+        }
         String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_dmp_custom_audience_select");
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", "application/json");
@@ -477,17 +483,17 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         String result = HttpUtils.httpGetRequest(url, headers, params);
         JSONObject jsonObject = JSONObject.parseObject(result);
         Integer code = jsonObject.getInteger("code");
-
+        String message = jsonObject.getString("message");
         if (null == code || !code.equals(0)) {
-            log.info("获取人群包信息接口异常==》accountId:{},message:{}", token.getAdvertiserId(), jsonObject.getString("message"));
+            log.info("获取人群包信息接口异常==》accountId:{},message:{}", accountId, message);
             resultMap.put("success", false);
-            resultMap.put("message", "获取人群包信息接口异常");
+            resultMap.put("message", message);
             resultMap.put("code", -1);
             return resultMap;
         }
         JSONArray data = jsonObject.getJSONObject("data").getJSONArray("custom_audience_list");
         if (null == data || data.isEmpty()) {
-            log.info("人群包信息不存在==》accountId:{},message:{}", token.getAdvertiserId(), jsonObject.getString("message"));
+            log.info("人群包信息不存在==》accountId:{},message:{}", accountId, message);
             resultMap.put("success", false);
             resultMap.put("message", "人群包信息不存在");
             resultMap.put("code", -1);