Commit 2966ae9aba5ac43f4b36346bab410f67f9f3c9dc
1 parent
a6f3fcb2
update
Showing
1 changed file
with
29 additions
and
24 deletions
src/main/java/com/cnlive/shenhe/controller/VideosController.java
| ... | ... | @@ -75,34 +75,39 @@ public class VideosController extends BaseController { |
| 75 | 75 | @PostMapping("/shenheVideo") |
| 76 | 76 | @ResponseBody |
| 77 | 77 | public ResponseBean shenheInfo(Integer id, String activity_id, Integer state, String attr_tags, String msg, String callback, HttpSession session) { |
| 78 | - logger.info("id:{},activity_id:{},state:{},attr_tags:{},msg:{},callback:{}",id,activity_id,state,attr_tags,msg,callback); | |
| 78 | + logger.info("id:{},activity_id:{},state:{},attr_tags:{},msg:{},callback:{}", id, activity_id, state, attr_tags, msg, callback); | |
| 79 | 79 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 80 | 80 | String userId = sessionUser.getUserId(); |
| 81 | 81 | // ShyVideos shyVideos = videosService.selectByPrimaryKey(id); |
| 82 | 82 | // if (shyVideos.getReceive() && CommonUtils.isNotEmpty(shyVideos.getReceive_user_id()) && userId.equals(shyVideos.getReceive_user_id())) { |
| 83 | - JSONObject result = null; | |
| 84 | - try { | |
| 85 | - result = Pass.auditPass(activity_id, state, attr_tags, msg, callback); | |
| 86 | - } catch (Exception e) { | |
| 87 | - e.printStackTrace(); | |
| 88 | - System.out.println("视频审核失败"); | |
| 89 | - return new ResponseBean(ErrorEnum.ERROR); | |
| 90 | - } | |
| 91 | - if (result == null) { | |
| 92 | - System.out.println("视频审核失败且接口错误没有返回信息"); | |
| 93 | - return new ResponseBean(ErrorEnum.ERROR); | |
| 94 | - } | |
| 95 | - Integer code = result.getInteger("code"); | |
| 96 | - if (code != 0) { | |
| 97 | - System.out.println("审核失败,code==" + code); | |
| 98 | - return new ResponseBean(code, result.getString("msg")); | |
| 99 | - } | |
| 100 | - state = state == 4 ? 2 : 1; | |
| 101 | - int i = videosService.updateVideo(id, userId,null,attr_tags, state, msg); | |
| 102 | - if (i == 0) { | |
| 103 | - return new ResponseBean(ErrorEnum.ERROR); | |
| 104 | - } | |
| 105 | - return new ResponseBean(ErrorEnum.SUCCESS); | |
| 83 | + JSONObject result = null; | |
| 84 | + try { | |
| 85 | + result = Pass.auditPass(activity_id, state, attr_tags, msg, callback); | |
| 86 | + } catch (Exception e) { | |
| 87 | + e.printStackTrace(); | |
| 88 | + System.out.println("视频审核失败"); | |
| 89 | + return new ResponseBean(ErrorEnum.ERROR); | |
| 90 | + } | |
| 91 | + if (result == null) { | |
| 92 | + System.out.println("视频审核失败且接口错误没有返回信息"); | |
| 93 | + return new ResponseBean(ErrorEnum.ERROR); | |
| 94 | + } | |
| 95 | + Integer code = result.getInteger("code"); | |
| 96 | + String errorCode = result.getString("errorCode"); | |
| 97 | + if (code != null && code != 0) { | |
| 98 | + System.out.println("审核失败,code==" + code); | |
| 99 | + return new ResponseBean(code, result.getString("msg")); | |
| 100 | + } | |
| 101 | + if (errorCode != null && !"0".equals(errorCode)) { | |
| 102 | + System.out.println("审核失败,code==" + code); | |
| 103 | + return new ResponseBean(Integer.valueOf(errorCode), "服务器异常"); | |
| 104 | + } | |
| 105 | + state = state == 4 ? 2 : 1; | |
| 106 | + int i = videosService.updateVideo(id, userId, null, attr_tags, state, msg); | |
| 107 | + if (i == 0) { | |
| 108 | + return new ResponseBean(ErrorEnum.ERROR); | |
| 109 | + } | |
| 110 | + return new ResponseBean(ErrorEnum.SUCCESS); | |
| 106 | 111 | // } |
| 107 | 112 | // logger.error("领取逻辑不符,不能审核,Video_id:{}", shyVideos.getVideo_id()); |
| 108 | 113 | // return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "领取逻辑不符,不能审核"); | ... | ... |