Commit d491de414ffac892768f1344d966ad75af1408f4
1 parent
f7bb4bd8
update
Showing
2 changed files
with
24 additions
and
19 deletions
src/main/java/com/cnlive/shenhe/job/ContentJob.java
| ... | ... | @@ -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 | 52 | public void videofilter() { |
| 53 | 53 | logger.info("审核云提交网页审核到易盾..........."); |
| 54 | 54 | List<ShyContent> shyContentList = contentService.findShyContentWithWebPage(); | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/ContentServiceImpl.java
| ... | ... | @@ -69,6 +69,7 @@ public class ContentServiceImpl { |
| 69 | 69 | public List<ShyContent> findShyContentWithWebPage() { |
| 70 | 70 | List checkParamList = new ArrayList(); |
| 71 | 71 | checkParamList.add("content"); |
| 72 | + checkParamList.add("moment"); | |
| 72 | 73 | Example example = new Example(ShyContent.class); |
| 73 | 74 | Example.Criteria criteria = example.createCriteria(); |
| 74 | 75 | criteria.andNotIn("content_tag", checkParamList); |
| ... | ... | @@ -386,24 +387,28 @@ public class ContentServiceImpl { |
| 386 | 387 | * @return 1:文本 2:图片 3.网页 4:点播音频 |
| 387 | 388 | */ |
| 388 | 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 | ... | ... |