Explorar o código

违规广告 入库+发微信消息

zhaoxian hai 1 ano
pai
achega
db8ad55355

+ 6 - 3
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceVideoInfoController.java

@@ -31,6 +31,7 @@ import org.springframework.web.bind.annotation.RestController;
 import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
 import java.util.Arrays;
+import java.util.List;
 
 /**
  * @Description: 今日头条视频素材信息
@@ -211,8 +212,9 @@ public class ByteDanceVideoInfoController {
                     if (!Check.isNull(content)) {
                         Long agentId = content.getLong("agent_id");
                         JSONArray illegalMaterialIds = content.getJSONArray("illegal_material_ids");//违规素材集合
+                        List<Long> list = JSONArray.parseArray(illegalMaterialIds.toJSONString(), Long.class);
                         Long promotionId = content.getLong("promotion_id");//计划id
-                        byteDanceVideoInfoService.getIllegalVideosPushInfo(agentId, illegalMaterialIds, promotionId);
+                        byteDanceVideoInfoService.getIllegalVideosPushInfo(agentId, list, promotionId);
                     } else {
                         log.error("content数据为空");
                     }
@@ -232,7 +234,8 @@ public class ByteDanceVideoInfoController {
      * 获取广告违规素材详情
      */
     @RequestMapping(value = "/getIllegalVideosPushInfo")
-    public void getIllegalVideosPushInfo(Long agentId, @RequestBody JSONArray illegalMaterialIds, Long promotionId) {
-        byteDanceVideoInfoService.getIllegalVideosPushInfo(agentId, illegalMaterialIds, promotionId);
+    public void getIllegalVideosPushInfo(Long agentId, @RequestBody List<Long> list, Long promotionId) {
+        byteDanceVideoInfoService.getIllegalVideosPushInfo(agentId, list, promotionId);
     }
+
 }

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceVideoInfoService.java

@@ -18,6 +18,6 @@ public interface IByteDanceVideoInfoService extends IService<ByteDanceVideoInfo>
 
     ByteDanceVideoInfo getOneByParams(Long materialId);
 
-    void getIllegalVideosPushInfo(Long agentId, JSONArray illegalMaterialIds,Long promotionId);
+    void getIllegalVideosPushInfo(Long agentId, List<Long> list,Long promotionId);
 
 }

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceVideoInfoServiceImpl.java

@@ -57,7 +57,7 @@ public class ByteDanceVideoInfoServiceImpl extends ServiceImpl<ByteDanceVideoInf
     }
 
     @Override
-    public void getIllegalVideosPushInfo(Long agentId, JSONArray illegalMaterialIds, Long promotionId) {
+    public void getIllegalVideosPushInfo(Long agentId, List<Long> list, Long promotionId) {
         CtopOauthToken token = oauthTokenService.getTokenByAccountId(73970348172l);
         String url = "https://api.oceanengine.com/open_api/2/agent/query/risk_promotion_list/";
         Map<String, Object> param = new HashMap<>();
@@ -71,7 +71,7 @@ public class ByteDanceVideoInfoServiceImpl extends ServiceImpl<ByteDanceVideoInf
         JSONObject filtering = new JSONObject();
 //        JSONArray arr = new JSONArray();
 //        arr.add(7361676756829896740l);
-        filtering.put("illegal_material_ids", illegalMaterialIds);
+        filtering.put("illegal_material_ids", list);
         param.put("filtering", filtering);
 
         Map<String, String> header = new HashMap<>();