|
@@ -7,6 +7,7 @@ import cn.com.ctop.common.module.service.ISendMessageService;
|
|
|
import cn.com.ctop.common.module.service.IUserAllocationService;
|
|
|
import cn.com.ctop.common.module.utils.Check;
|
|
|
import cn.com.ctop.common.module.utils.HttpUtils;
|
|
|
+import cn.com.ctop.common.module.utils.PropertiesUtils;
|
|
|
import cn.com.ctop.toutiao.modules.material.entity.ByteDanceVideoInfo;
|
|
|
import cn.com.ctop.toutiao.modules.material.mapper.ByteDanceVideoInfoMapper;
|
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceVideoInfoService;
|
|
@@ -58,8 +59,12 @@ public class ByteDanceVideoInfoServiceImpl extends ServiceImpl<ByteDanceVideoInf
|
|
|
|
|
|
@Override
|
|
|
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/";
|
|
|
+ String adid = PropertiesUtils.getValue("bytedance_config", "admin_account_id");
|
|
|
+ CtopOauthToken token = oauthTokenService.getTokenByAccountId(Long.valueOf(adid));
|
|
|
+
|
|
|
+ //广告违规素材推送
|
|
|
+ String url = PropertiesUtils.getValue("bytedance_config", "bytedance_rapi_url") +
|
|
|
+ PropertiesUtils.getValue("bytedance_config", "bytedance_v2_risk_promotion_list");
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
param.put("agent_id", agentId);
|
|
|
param.put("business_type", "AD");
|
|
@@ -69,8 +74,6 @@ public class ByteDanceVideoInfoServiceImpl extends ServiceImpl<ByteDanceVideoInf
|
|
|
param.put("end_date", today);
|
|
|
|
|
|
JSONObject filtering = new JSONObject();
|
|
|
-// JSONArray arr = new JSONArray();
|
|
|
-// arr.add(7361676756829896740l);
|
|
|
filtering.put("illegal_material_ids", list);
|
|
|
param.put("filtering", filtering);
|
|
|
|
|
@@ -89,6 +92,8 @@ public class ByteDanceVideoInfoServiceImpl extends ServiceImpl<ByteDanceVideoInf
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private static Map<String, String> sendMap = new HashMap<>();
|
|
|
+
|
|
|
//违规信息入库
|
|
|
private void storageIllegalInfo(JSONArray array, Long promotionId) {
|
|
|
try {
|
|
@@ -113,8 +118,14 @@ public class ByteDanceVideoInfoServiceImpl extends ServiceImpl<ByteDanceVideoInf
|
|
|
JSONObject info = getmaterialData(data, materialObj);
|
|
|
list.add(info);
|
|
|
if (promotionId.equals(promotion_id)) {
|
|
|
- //发送企业微信提醒 obj
|
|
|
- sendMsg(info);
|
|
|
+ //发送企业微信提醒
|
|
|
+ //素材ID+计划
|
|
|
+ String key = info.getString("materialId") + promotion_id;
|
|
|
+ String val = sendMap.get(key);
|
|
|
+ if (Check.isNull(val)) {
|
|
|
+ sendMsg(info);
|
|
|
+ sendMap.put(key, "send");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|