Commit d491de414ffac892768f1344d966ad75af1408f4

Authored by 郑超
1 parent f7bb4bd8

update

src/main/java/com/cnlive/shenhe/job/ContentJob.java
@@ -48,7 +48,7 @@ public class ContentJob { @@ -48,7 +48,7 @@ public class ContentJob {
48 * 定时向易盾提交网站地址 48 * 定时向易盾提交网站地址
49 * //每分钟一次 49 * //每分钟一次
50 */ 50 */
51 - @Scheduled(cron = "0 0/5 * * * ? ") 51 + @Scheduled(cron = "0 0/1 * * * ? ")
52 public void videofilter() { 52 public void videofilter() {
53 logger.info("审核云提交网页审核到易盾..........."); 53 logger.info("审核云提交网页审核到易盾...........");
54 List<ShyContent> shyContentList = contentService.findShyContentWithWebPage(); 54 List<ShyContent> shyContentList = contentService.findShyContentWithWebPage();
src/main/java/com/cnlive/shenhe/serviceImpl/ContentServiceImpl.java
@@ -69,6 +69,7 @@ public class ContentServiceImpl { @@ -69,6 +69,7 @@ public class ContentServiceImpl {
69 public List<ShyContent> findShyContentWithWebPage() { 69 public List<ShyContent> findShyContentWithWebPage() {
70 List checkParamList = new ArrayList(); 70 List checkParamList = new ArrayList();
71 checkParamList.add("content"); 71 checkParamList.add("content");
  72 + checkParamList.add("moment");
72 Example example = new Example(ShyContent.class); 73 Example example = new Example(ShyContent.class);
73 Example.Criteria criteria = example.createCriteria(); 74 Example.Criteria criteria = example.createCriteria();
74 criteria.andNotIn("content_tag", checkParamList); 75 criteria.andNotIn("content_tag", checkParamList);
@@ -386,24 +387,28 @@ public class ContentServiceImpl { @@ -386,24 +387,28 @@ public class ContentServiceImpl {
386 * @return 1:文本 2:图片 3.网页 4:点播音频 387 * @return 1:文本 2:图片 3.网页 4:点播音频
387 */ 388 */
388 public void contentFilter(ShyContent shyContent) { 389 public void contentFilter(ShyContent shyContent) {
389 - String contentUrl = shyContent.getContent_url();  
390 - logger.info("审核云向易盾网站检测接口提交的url:{}", contentUrl);  
391 - //调用易盾网站检测接口  
392 - JSONObject jsonObject = YiDunAntiFraudUtil.submitYiDunUrl(contentUrl);  
393 - if (jsonObject != null) {  
394 - JSONObject result = jsonObject.getJSONObject("result");  
395 - String dataId = result.getString("dataId");  
396 - String taskId = result.getString("taskId");  
397 - ShyYidun shyYidun = new ShyYidun();  
398 - shyYidun.setId(dataId);  
399 - shyYidun.setUrl(contentUrl);  
400 - shyYidun.setTask_id(taskId);  
401 - shyYidun.setData_id(dataId);  
402 - shyYidun.setCheck_type(3);  
403 - shyYidun.setContent_id(shyContent.getId().toString());  
404 - shyYidun.setCreate_time(new Date());  
405 - logger.info("审核云保存到ShyYidun表里数据:{}", JSON.toJSONString(shyYidun));  
406 - yiDunServiceImpl.addYiDunMsg(shyYidun); 390 + try {
  391 + String contentUrl = shyContent.getContent_url();
  392 + logger.info("审核云向易盾网站检测接口提交的url:{}", contentUrl);
  393 + //调用易盾网站检测接口
  394 + JSONObject jsonObject = YiDunAntiFraudUtil.submitYiDunUrl(contentUrl);
  395 + if (jsonObject != null) {
  396 + JSONObject result = jsonObject.getJSONObject("result");
  397 + String dataId = result.getString("dataId");
  398 + String taskId = result.getString("taskId");
  399 + ShyYidun shyYidun = new ShyYidun();
  400 + shyYidun.setId(dataId);
  401 + shyYidun.setUrl(contentUrl);
  402 + shyYidun.setTask_id(taskId);
  403 + shyYidun.setData_id(dataId);
  404 + shyYidun.setCheck_type(3);
  405 + shyYidun.setContent_id(shyContent.getId().toString());
  406 + shyYidun.setCreate_time(new Date());
  407 + logger.info("审核云保存到ShyYidun表里数据:{}", JSON.toJSONString(shyYidun));
  408 + yiDunServiceImpl.addYiDunMsg(shyYidun);
  409 + }
  410 + } catch (Exception e) {
  411 + e.printStackTrace();
407 } 412 }
408 } 413 }
409 414