Commit f33f64a609283b96f06bd946a3ab75683b217e02
1 parent
f6990ba5
update
Showing
1 changed file
with
26 additions
and
26 deletions
src/main/java/com/cnlive/shenhe/controller/VideosController.java
| @@ -53,33 +53,33 @@ public class VideosController { | @@ -53,33 +53,33 @@ public class VideosController { | ||
| 53 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | 53 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 54 | String userId = sessionUser.getUserId(); | 54 | String userId = sessionUser.getUserId(); |
| 55 | ShyVideos shyVideos = videosService.selectByPrimaryKey(id); | 55 | ShyVideos shyVideos = videosService.selectByPrimaryKey(id); |
| 56 | - if (!shyVideos.getReceive() || CommonUtils.isEmpty(shyVideos.getReceive_user_id()) || !userId.equals(shyVideos.getReceive_user_id())) { | ||
| 57 | - logger.error("领取逻辑不符,不能审核,Video_id:{}", shyVideos.getVideo_id()); | ||
| 58 | - return new ResponseBean(ErrorEnum.ERROR); | ||
| 59 | - } | ||
| 60 | - JSONObject result = null; | ||
| 61 | - try { | ||
| 62 | - result = Pass.auditPass(activity_id, state, attr_tags, msg, callback); | ||
| 63 | - } catch (Exception e) { | ||
| 64 | - e.printStackTrace(); | ||
| 65 | - System.out.println("视频审核失败"); | ||
| 66 | - return new ResponseBean(ErrorEnum.ERROR); | ||
| 67 | - } | ||
| 68 | - if (result == null) { | ||
| 69 | - System.out.println("视频审核失败且接口错误没有返回信息"); | ||
| 70 | - return new ResponseBean(ErrorEnum.ERROR); | ||
| 71 | - } | ||
| 72 | - Integer code = result.getInteger("code"); | ||
| 73 | - if (code != 0) { | ||
| 74 | - System.out.println("审核失败,code==" + code); | ||
| 75 | - return new ResponseBean(code, result.getString("msg")); | ||
| 76 | - } | ||
| 77 | - state = state == 4 ? 2 : 1; | ||
| 78 | - int i = videosService.updateVideo(id, userId, state, msg); | ||
| 79 | - if (i == 0) { | ||
| 80 | - return new ResponseBean(ErrorEnum.ERROR); | 56 | + if (shyVideos.getReceive() && CommonUtils.isNotEmpty(shyVideos.getReceive_user_id()) && userId.equals(shyVideos.getReceive_user_id())) { |
| 57 | + JSONObject result = null; | ||
| 58 | + try { | ||
| 59 | + result = Pass.auditPass(activity_id, state, attr_tags, msg, callback); | ||
| 60 | + } catch (Exception e) { | ||
| 61 | + e.printStackTrace(); | ||
| 62 | + System.out.println("视频审核失败"); | ||
| 63 | + return new ResponseBean(ErrorEnum.ERROR); | ||
| 64 | + } | ||
| 65 | + if (result == null) { | ||
| 66 | + System.out.println("视频审核失败且接口错误没有返回信息"); | ||
| 67 | + return new ResponseBean(ErrorEnum.ERROR); | ||
| 68 | + } | ||
| 69 | + Integer code = result.getInteger("code"); | ||
| 70 | + if (code != 0) { | ||
| 71 | + System.out.println("审核失败,code==" + code); | ||
| 72 | + return new ResponseBean(code, result.getString("msg")); | ||
| 73 | + } | ||
| 74 | + state = state == 4 ? 2 : 1; | ||
| 75 | + int i = videosService.updateVideo(id, userId, state, msg); | ||
| 76 | + if (i == 0) { | ||
| 77 | + return new ResponseBean(ErrorEnum.ERROR); | ||
| 78 | + } | ||
| 79 | + return new ResponseBean(ErrorEnum.SUCCESS); | ||
| 81 | } | 80 | } |
| 82 | - return new ResponseBean(ErrorEnum.SUCCESS); | 81 | + logger.error("领取逻辑不符,不能审核,Video_id:{}", shyVideos.getVideo_id()); |
| 82 | + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(),"领取逻辑不符,不能审核"); | ||
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | /** | 85 | /** |