Commit a65ddf3a037f8db18544a1ed92ddaec9319c147f

Authored by liwei2917
1 parent 4e201c1f

图文白名单和机审修改

src/main/java/com/cnlive/shenhe/controller/ContentController.java
@@ -166,7 +166,7 @@ public class ContentController { @@ -166,7 +166,7 @@ public class ContentController {
166 boolean success =false; 166 boolean success =false;
167 String[] contentIds = ids.split(","); 167 String[] contentIds = ids.split(",");
168 for (String contentId : contentIds) { 168 for (String contentId : contentIds) {
169 - success = contentService.callback(contentId,"审核通过", CommonConst.AUDIT_SUCCESS, userId); 169 + success = contentService.callback(contentId,"审核通过", CommonConst.AUDIT_SUCCESS, userId,"");
170 } 170 }
171 if (success) { 171 if (success) {
172 return new ResponseBean(); 172 return new ResponseBean();
@@ -189,7 +189,7 @@ public class ContentController { @@ -189,7 +189,7 @@ public class ContentController {
189 boolean success =false; 189 boolean success =false;
190 String[] contentIds = ids.split(","); 190 String[] contentIds = ids.split(",");
191 for (String contentId : contentIds) { 191 for (String contentId : contentIds) {
192 - success = contentService.callback(contentId,msg, CommonConst.AUDIT_REFUSE, userId); 192 + success = contentService.callback(contentId,msg, CommonConst.AUDIT_REFUSE, userId,"");
193 } 193 }
194 if (success) { 194 if (success) {
195 return new ResponseBean(); 195 return new ResponseBean();
src/main/java/com/cnlive/shenhe/job/ContentJob.java
@@ -50,7 +50,7 @@ public class ContentJob { @@ -50,7 +50,7 @@ public class ContentJob {
50 logger.info("当前白名单通过的content_id:"+content.getId()); 50 logger.info("当前白名单通过的content_id:"+content.getId());
51 content.setUpdater("白名单"); 51 content.setUpdater("白名单");
52 // 更新点播和审核的视频状态 52 // 更新点播和审核的视频状态
53 - contentService.callback(content.getId()+"","白名单审核通过", 1,""); 53 + contentService.callback(content.getId()+"","白名单审核通过", 1,"","白名单");
54 } 54 }
55 } 55 }
56 } 56 }
src/main/java/com/cnlive/shenhe/serviceImpl/ContentServiceImpl.java
@@ -207,7 +207,7 @@ public class ContentServiceImpl { @@ -207,7 +207,7 @@ public class ContentServiceImpl {
207 } 207 }
208 208
209 //********************** 209 //**********************
210 - public boolean callback(String contentId, String msg, Integer state, String userId) { 210 + public boolean callback(String contentId, String msg, Integer state, String userId,String updater) {
211 boolean success = true; 211 boolean success = true;
212 ShyContent content = shyContentMapper.selectByPrimaryKey(Integer.parseInt(contentId)); 212 ShyContent content = shyContentMapper.selectByPrimaryKey(Integer.parseInt(contentId));
213 JSONObject result = new JSONObject(); 213 JSONObject result = new JSONObject();
@@ -259,6 +259,8 @@ public class ContentServiceImpl { @@ -259,6 +259,8 @@ public class ContentServiceImpl {
259 if (CommonUtils.isNotEmpty(userId)) { 259 if (CommonUtils.isNotEmpty(userId)) {
260 content.setAuditor_id(userId); 260 content.setAuditor_id(userId);
261 content.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 设置审核类型为人工 261 content.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 设置审核类型为人工
  262 + }else{
  263 + content.setUpdater(updater);//设置更新人
262 } 264 }
263 content.setLast_update(CommonUtils.getCurrentTime()); 265 content.setLast_update(CommonUtils.getCurrentTime());
264 int i = shyContentMapper.updateByPrimaryKeySelective(content); 266 int i = shyContentMapper.updateByPrimaryKeySelective(content);
@@ -364,7 +366,7 @@ public class ContentServiceImpl { @@ -364,7 +366,7 @@ public class ContentServiceImpl {
364 try{ 366 try{
365 //调用数美接口 367 //调用数美接口
366 result = AntiFraudUtil.filterArticle(Token_id,shyContent.getContent_url(),channel); 368 result = AntiFraudUtil.filterArticle(Token_id,shyContent.getContent_url(),channel);
367 - type=result.getString("type"); 369 + type=result.getString("riskLevel");
368 desc=result.getString("desc");//数美失败结果的详情 370 desc=result.getString("desc");//数美失败结果的详情
369 }catch(Exception e){ 371 }catch(Exception e){
370 type=CommonConst.REJECT;//报错就给一个拒绝状态 372 type=CommonConst.REJECT;//报错就给一个拒绝状态
@@ -374,8 +376,8 @@ public class ContentServiceImpl { @@ -374,8 +376,8 @@ public class ContentServiceImpl {
374 desc="数美审核通过了"; 376 desc="数美审核通过了";
375 shyContent.setShenhe_msg(desc); 377 shyContent.setShenhe_msg(desc);
376 //修改图文状态 378 //修改图文状态
377 - callback(shyContent.getId().toString(),desc,CommonConst.AUDIT_SUCCESS,"");  
378 - }else if(type.toLowerCase().equals(CommonConst.REJECT)){//数美拒绝 379 + callback(shyContent.getId().toString(),desc,CommonConst.AUDIT_SUCCESS,"","机审通过");
  380 + }else if(type.toLowerCase().equals(CommonConst.REJECT)||type.toLowerCase().equals(CommonConst.REVIEW)){//数美拒绝
379 shyContent.setShenhe_type(CommonConst.AUDIT_TYPE_USER);//审核类型改为人工审核 381 shyContent.setShenhe_type(CommonConst.AUDIT_TYPE_USER);//审核类型改为人工审核
380 shyContent.setShenhe_msg(desc);//拒绝原因 382 shyContent.setShenhe_msg(desc);//拒绝原因
381 updateshyContent(shyContent); 383 updateshyContent(shyContent);
src/main/java/com/cnlive/shenhe/utils/AntiFraudUtil.java
@@ -392,14 +392,17 @@ try { @@ -392,14 +392,17 @@ try {
392 } 392 }
393 393
394 private static JSONObject getResult(JSONObject result) { 394 private static JSONObject getResult(JSONObject result) {
  395 +
395 if (result != null) { 396 if (result != null) {
396 - System.out.println(result); 397 + System.out.println("数美图片过滤返回结果" + result);
  398 + JSONObject jsonObj = new JSONObject();
397 Integer code = result.getInteger("code"); 399 Integer code = result.getInteger("code");
398 400
399 if (code != null && code == 1100) { //请求成功 401 if (code != null && code == 1100) { //请求成功
400 String riskLevel = result.getString("riskLevel"); 402 String riskLevel = result.getString("riskLevel");
401 403
402 if ("PASS".equals(riskLevel)) { 404 if ("PASS".equals(riskLevel)) {
  405 + jsonObj.put("type", "REJECT");
403 return result; 406 return result;
404 } 407 }
405 408