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