Quellcode durchsuchen

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

zhaoxian vor 1 Jahr
Ursprung
Commit
b42dff8310

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

@@ -202,20 +202,24 @@ public class ByteDanceVideoInfoController {
             if (!isValidToken) {
                 return new CallbackResponse(new BaseResponse(400, "invalid token"), 0);
             }
-            System.out.println("----------------------byte格式:"+AuthTokenUtil.readAsBytes(cacher));;
-            String s = new String(AuthTokenUtil.readAsBytes(cacher));
-            System.out.println("-------------内容" + s);
             JSONObject result = (JSONObject) JSONObject.parse(new String(AuthTokenUtil.readAsBytes(cacher)));
-            log.info("结果:" + result);
-      /*      if (!Check.isNull(result)) {
-                JSONObject content = result.getJSONObject("data").getJSONObject("content");
-                if (!Check.isNull(content)) {
-                    Long agentId = content.getLong("agent_id");
-                    JSONArray illegalMaterialIds = content.getJSONArray("illegal_material_ids");//违规素材集合
-                    Long promotionId = content.getLong("promotion_id");//计划id
-                    byteDanceVideoInfoService.getIllegalVideosPushInfo(agentId, illegalMaterialIds, promotionId);
+            log.info("转译结果:" + result);
+            if (!Check.isNull(result)) {
+                JSONObject data = result.getJSONObject("data");
+                if (!Check.isNull(data)) {
+                    JSONObject content = data.getJSONObject("content");
+                    if (!Check.isNull(content)) {
+                        Long agentId = content.getLong("agent_id");
+                        JSONArray illegalMaterialIds = content.getJSONArray("illegal_material_ids");//违规素材集合
+                        Long promotionId = content.getLong("promotion_id");//计划id
+                        byteDanceVideoInfoService.getIllegalVideosPushInfo(agentId, illegalMaterialIds, promotionId);
+                    } else {
+                        log.error("content数据为空");
+                    }
+                } else {
+                    log.error("data数据为空");
                 }
-            }*/
+            }
         } catch (IOException e) {
             e.printStackTrace();
         }