Commit 4152f3aca5c6c2e9aa5475951b704869dae00859
1 parent
cce9aac5
易盾网页审核状态修改
Showing
4 changed files
with
51 additions
and
29 deletions
src/main/java/com/cnlive/shenhe/job/ContentJob.java
| ... | ... | @@ -33,8 +33,10 @@ public class ContentJob { |
| 33 | 33 | @Scheduled(fixedRate = 60 * 1000) |
| 34 | 34 | public void updateVideos() { |
| 35 | 35 | ShyContent shyContent = new ShyContent(); |
| 36 | - shyContent.setShenhe_type(CommonConst.AUDIT_TYPE_FREE);// 审核类型为免审 | |
| 37 | - shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE);// 领取状态为未领取 | |
| 36 | + // 审核类型为免审 | |
| 37 | + shyContent.setShenhe_type(CommonConst.AUDIT_TYPE_FREE); | |
| 38 | + // 领取状态为未领取 | |
| 39 | + shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE); | |
| 38 | 40 | List<ShyContent> shyContentList = contentService.findshyContent(shyContent); |
| 39 | 41 | if (shyContentList.size() > 0) { |
| 40 | 42 | for (ShyContent content : shyContentList) { |
| ... | ... | @@ -48,14 +50,17 @@ public class ContentJob { |
| 48 | 50 | |
| 49 | 51 | /** |
| 50 | 52 | * 定时向易盾提交网站地址 |
| 53 | + * //每分钟一次 | |
| 51 | 54 | */ |
| 52 | - @Scheduled(cron = "0 0/1 * * * ? ")//每分钟一次 | |
| 55 | + @Scheduled(cron = "0 0/1 * * * ? ") | |
| 53 | 56 | public void videofilter() { |
| 57 | + logger.info("提交网页审核到易盾..........."); | |
| 54 | 58 | ShyContent shyContent = new ShyContent(); |
| 55 | 59 | //机审 |
| 56 | 60 | shyContent.setShenhe_type(CommonConst.AUDIT_TYPE_MACHANE); |
| 57 | 61 | //待审 |
| 58 | 62 | shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE); |
| 63 | + | |
| 59 | 64 | List<ShyContent> shyContentList = contentService.findshyContent(shyContent); |
| 60 | 65 | if (shyContentList != null && shyContentList.size() > 0) { |
| 61 | 66 | for (ShyContent content : shyContentList) { |
| ... | ... | @@ -64,7 +69,6 @@ public class ContentJob { |
| 64 | 69 | shyYidun.setContent_id(content.getId().toString()); |
| 65 | 70 | ShyYidun shyYidun1 = yiDunServiceImpl.getidunMsgByContentId(shyYidun); |
| 66 | 71 | if (shyYidun1 == null) { |
| 67 | - logger.info("定时发送易盾检测的content_id:" + content.getId()); | |
| 68 | 72 | contentService.contentFilter(content); |
| 69 | 73 | } |
| 70 | 74 | } |
| ... | ... | @@ -79,12 +83,14 @@ public class ContentJob { |
| 79 | 83 | public void autoRetReceive() { |
| 80 | 84 | logger.info("图文自动退领的进入....."); |
| 81 | 85 | ShyContent shyContent = new ShyContent(); |
| 82 | - shyContent.setReceive_status(CommonConst.RECEIVE_AFTER);//领取状态为,已领 | |
| 86 | + //领取状态为,已领 | |
| 87 | + shyContent.setReceive_status(CommonConst.RECEIVE_AFTER); | |
| 83 | 88 | List<ShyContent> shyContentList = contentService.findshyContent(shyContent); |
| 84 | 89 | if (shyContentList.size() > 0) { |
| 85 | 90 | for (ShyContent shyContent2 : shyContentList) { |
| 86 | 91 | logger.info("自动退领的content_id:" + shyContent2.getId()); |
| 87 | - shyContent2.setReceive_status(CommonConst.RECEIVE_BEFORE);//未领取 | |
| 92 | + //未领取 | |
| 93 | + shyContent2.setReceive_status(CommonConst.RECEIVE_BEFORE); | |
| 88 | 94 | shyContent2.setAuditor_id(null); |
| 89 | 95 | contentService.updateshyContent(shyContent2); |
| 90 | 96 | } | ... | ... |
src/main/java/com/cnlive/shenhe/job/YiDunUrlResultJob.java
| ... | ... | @@ -101,6 +101,7 @@ public class YiDunUrlResultJob { |
| 101 | 101 | newYiDunMsg.setResult_type(String.valueOf(result)); |
| 102 | 102 | if (result == 1) { |
| 103 | 103 | desc = "易盾网站审核通过了"; |
| 104 | + shyContent.setReceive_status(2); | |
| 104 | 105 | shyContent.setShenhe_msg(desc); |
| 105 | 106 | newYiDunMsg.setDesc_msg(desc); |
| 106 | 107 | //修改图文状态 |
| ... | ... | @@ -172,7 +173,8 @@ public class YiDunUrlResultJob { |
| 172 | 173 | } |
| 173 | 174 | } |
| 174 | 175 | shyContent.setShenhe_type(CommonConst.AUDIT_TYPE_USER); |
| 175 | - //拒绝原因 | |
| 176 | + //拒绝原因 3=拒审 | |
| 177 | + shyContent.setReceive_status(3); | |
| 176 | 178 | shyContent.setShenhe_msg(desc); |
| 177 | 179 | newYiDunMsg.setDesc_msg(desc); |
| 178 | 180 | } | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/ContentServiceImpl.java
| ... | ... | @@ -66,7 +66,7 @@ public class ContentServiceImpl { |
| 66 | 66 | //************************************** |
| 67 | 67 | public List<ShyContent> findshyContent(ShyContent shyContent) { |
| 68 | 68 | |
| 69 | - return shyContentMapper.selectByRowBounds(shyContent, new RowBounds(0, 100)); | |
| 69 | + return shyContentMapper.selectByRowBounds(shyContent, new RowBounds(0, 50)); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | //*************************** |
| ... | ... | @@ -375,7 +375,8 @@ public class ContentServiceImpl { |
| 375 | 375 | * @return |
| 376 | 376 | */ |
| 377 | 377 | public void contentFilter(ShyContent shyContent) { |
| 378 | - String contentUrl = localhost_url + "/api/content/detail/" + shyContent.getId() + ".html"; | |
| 378 | +// String contentUrl = localhost_url + "/api/content/detail/" + shyContent.getId() + ".html"; | |
| 379 | + String contentUrl = shyContent.getContent_url(); | |
| 379 | 380 | logger.info("向易盾网站检测接口提交的url:" + contentUrl); |
| 380 | 381 | //调用易盾网站检测接口 |
| 381 | 382 | JSONObject jsonObject = YiDunAntiFraudUtil.submitYiDunUrl(contentUrl); | ... | ... |
src/main/java/com/cnlive/shenhe/utils/YiDunAntiFraudUtil.java
| ... | ... | @@ -83,31 +83,42 @@ public class YiDunAntiFraudUtil { |
| 83 | 83 | private final static String AUDIOONDEMAND_URL_SUBMIT = "http://as.dun.163.com/v3/audio/submit"; |
| 84 | 84 | |
| 85 | 85 | public static void main(String[] args) { |
| 86 | + Map<String, String> params = new HashMap<String, String>(5); | |
| 87 | + // 1.设置公共参数 | |
| 88 | + params.put("secretId", SECRETID); | |
| 89 | + params.put("version", "v1.0"); | |
| 90 | + params.put("timestamp", String.valueOf(System.currentTimeMillis())); | |
| 91 | + params.put("nonce", String.valueOf(new Random().nextInt())); | |
| 86 | 92 | |
| 93 | + // 2.生成签名信息 | |
| 94 | + String signature1 = YiDunAntiFraudUtil.genSignature(SECRETKEY, params); | |
| 95 | + params.put("signature", signature1); | |
| 96 | + String s1 = HttpClientUtils.post_str(URL_RESULT, params); | |
| 97 | + logger.info("查询易盾网站检测结果:{}", s1); | |
| 87 | 98 | //智能文本识别审核测试 |
| 88 | 99 | //getTextFilter("王八蛋"); |
| 89 | 100 | |
| 90 | 101 | //智能图片识别审核测试 |
| 91 | - JSONArray jsonArray = new JSONArray(); | |
| 92 | - JSONObject image1 = new JSONObject(); | |
| 93 | - image1.put("name", UUID.randomUUID()); | |
| 94 | - image1.put("type", 1); | |
| 95 | - image1.put("data", "http://article-bj.bj.bcebos.com//20200326/7f3d23bbb28421e6e2a6f131273554fb_15.jpg?authorization=bce-auth-v1%2F1eda661c3697440eaaca912ccb6f959c%2F2020-03-30T05%3A42%3A21Z%2F604800%2F%2F39f195e2327ef87270bd095fa64dfdcadad6f01a0d6dc6a4313306f164591cc5"); | |
| 96 | - jsonArray.add(image1); | |
| 97 | - JSONObject image2 = new JSONObject(); | |
| 98 | - image2.put("name", UUID.randomUUID()); | |
| 99 | - image2.put("type", 1); | |
| 100 | - image2.put("data", "http://test.qnvod.cnlive.com/shen/802/2020/03/01/8a8a878c6dce5cfe017096cd07940c84/000002.jpg"); | |
| 101 | - jsonArray.add(image2); | |
| 102 | - JSONObject image3 = new JSONObject(); | |
| 103 | - image3.put("name", UUID.randomUUID()); | |
| 104 | - image3.put("type", 1); | |
| 105 | - image3.put("data", "https://wjj.ys2.cnliveimg.com/769/img/0/2020/03/21/158474856886077030277.jpg"); | |
| 106 | - jsonArray.add(image3); | |
| 107 | - System.out.println(jsonArray); | |
| 108 | - JSONObject imagesFilter = getImagesFilter(jsonArray.toString()); | |
| 109 | -// System.out.println(image1); | |
| 110 | - System.out.println(imagesFilter); | |
| 102 | +// JSONArray jsonArray = new JSONArray(); | |
| 103 | +// JSONObject image1 = new JSONObject(); | |
| 104 | +// image1.put("name", UUID.randomUUID()); | |
| 105 | +// image1.put("type", 1); | |
| 106 | +// image1.put("data", "http://article-bj.bj.bcebos.com//20200326/7f3d23bbb28421e6e2a6f131273554fb_15.jpg?authorization=bce-auth-v1%2F1eda661c3697440eaaca912ccb6f959c%2F2020-03-30T05%3A42%3A21Z%2F604800%2F%2F39f195e2327ef87270bd095fa64dfdcadad6f01a0d6dc6a4313306f164591cc5"); | |
| 107 | +// jsonArray.add(image1); | |
| 108 | +// JSONObject image2 = new JSONObject(); | |
| 109 | +// image2.put("name", UUID.randomUUID()); | |
| 110 | +// image2.put("type", 1); | |
| 111 | +// image2.put("data", "http://test.qnvod.cnlive.com/shen/802/2020/03/01/8a8a878c6dce5cfe017096cd07940c84/000002.jpg"); | |
| 112 | +// jsonArray.add(image2); | |
| 113 | +// JSONObject image3 = new JSONObject(); | |
| 114 | +// image3.put("name", UUID.randomUUID()); | |
| 115 | +// image3.put("type", 1); | |
| 116 | +// image3.put("data", "https://wjj.ys2.cnliveimg.com/769/img/0/2020/03/21/158474856886077030277.jpg"); | |
| 117 | +// jsonArray.add(image3); | |
| 118 | +// System.out.println(jsonArray); | |
| 119 | +// JSONObject imagesFilter = getImagesFilter(jsonArray.toString()); | |
| 120 | +//// System.out.println(image1); | |
| 121 | +// System.out.println(imagesFilter); | |
| 111 | 122 | |
| 112 | 123 | |
| 113 | 124 | //智能网页识别审核测试 |
| ... | ... | @@ -420,6 +431,7 @@ public class YiDunAntiFraudUtil { |
| 420 | 431 | */ |
| 421 | 432 | public static JSONObject submitYiDunUrl(String url) { |
| 422 | 433 | try { |
| 434 | + logger.info("向易盾网站检测接口提交的url....................."); | |
| 423 | 435 | Map<String, String> params = new HashMap<String, String>(); |
| 424 | 436 | |
| 425 | 437 | // 1.设置公共参数 |
| ... | ... | @@ -513,4 +525,5 @@ public class YiDunAntiFraudUtil { |
| 513 | 525 | return signature.equals(serverSignature) && TEXTANDIMAGESECRETID.equals(secretId) && AUDIOONDEMANDBUSINESSID.equals(businessId); |
| 514 | 526 | } |
| 515 | 527 | |
| 528 | + | |
| 516 | 529 | } | ... | ... |