Commit 2450068fdf9bb8754cc1da390c3d3bb5a05311ad
Merge branch 'test' into dev
Showing
28 changed files
with
518 additions
and
227 deletions
src/main/java/com/cnlive/shenhe/api/AudioControllerApi.java
| @@ -8,7 +8,7 @@ import com.cnlive.shenhe.entity.ShyAudio; | @@ -8,7 +8,7 @@ import com.cnlive.shenhe.entity.ShyAudio; | ||
| 8 | import com.cnlive.shenhe.entity.ShyYidun; | 8 | import com.cnlive.shenhe.entity.ShyYidun; |
| 9 | import com.cnlive.shenhe.enums.TextLabels; | 9 | import com.cnlive.shenhe.enums.TextLabels; |
| 10 | import com.cnlive.shenhe.service.AudioService; | 10 | import com.cnlive.shenhe.service.AudioService; |
| 11 | -import com.cnlive.shenhe.service.serviceImpl.YiDunServiceImpl; | 11 | +import com.cnlive.shenhe.service.YiDunService; |
| 12 | import com.cnlive.shenhe.utils.AuditPass; | 12 | import com.cnlive.shenhe.utils.AuditPass; |
| 13 | import com.cnlive.shenhe.utils.CommonConst; | 13 | import com.cnlive.shenhe.utils.CommonConst; |
| 14 | import com.cnlive.shenhe.utils.YiDunAntiFraudUtil; | 14 | import com.cnlive.shenhe.utils.YiDunAntiFraudUtil; |
| @@ -39,7 +39,7 @@ public class AudioControllerApi { | @@ -39,7 +39,7 @@ public class AudioControllerApi { | ||
| 39 | @Autowired | 39 | @Autowired |
| 40 | AudioService audioService; | 40 | AudioService audioService; |
| 41 | @Autowired | 41 | @Autowired |
| 42 | - YiDunServiceImpl yiDunServiceImpl; | 42 | + YiDunService yiDunService; |
| 43 | @Autowired | 43 | @Autowired |
| 44 | AuditPass pass; | 44 | AuditPass pass; |
| 45 | 45 | ||
| @@ -126,7 +126,7 @@ public class AudioControllerApi { | @@ -126,7 +126,7 @@ public class AudioControllerApi { | ||
| 126 | //2:检测中,3:检测完成,4:检测失败 | 126 | //2:检测中,3:检测完成,4:检测失败 |
| 127 | int asrStatus = objectAntispam.getIntValue("asrStatus"); | 127 | int asrStatus = objectAntispam.getIntValue("asrStatus"); |
| 128 | String taskId = objectAntispam.getString("taskId"); | 128 | String taskId = objectAntispam.getString("taskId"); |
| 129 | - ShyYidun yiDunMsg = yiDunServiceImpl.getYiDunMsg(taskId); | 129 | + ShyYidun yiDunMsg = yiDunService.getYiDunMsg(taskId); |
| 130 | if (yiDunMsg == null) { | 130 | if (yiDunMsg == null) { |
| 131 | continue; | 131 | continue; |
| 132 | } | 132 | } |
| @@ -145,16 +145,16 @@ public class AudioControllerApi { | @@ -145,16 +145,16 @@ public class AudioControllerApi { | ||
| 145 | newshyAudio.setReceive(CommonConst.RECEIVE_AUDIT); | 145 | newshyAudio.setReceive(CommonConst.RECEIVE_AUDIT); |
| 146 | pass.audioPass(shyAudio.getAudioId(), 3, shyAudio.getAttr_tags(), "易盾点播音频审核通过了", shyAudio.getCallback()); | 146 | pass.audioPass(shyAudio.getAudioId(), 3, shyAudio.getAttr_tags(), "易盾点播音频审核通过了", shyAudio.getCallback()); |
| 147 | } else { | 147 | } else { |
| 148 | - String labelMsg = ""; | 148 | + StringBuilder labelMsg = new StringBuilder(); |
| 149 | if (action != 0 && asrStatus == 3) { | 149 | if (action != 0 && asrStatus == 3) { |
| 150 | JSONArray labels = objectAntispam.getJSONArray("labels"); | 150 | JSONArray labels = objectAntispam.getJSONArray("labels"); |
| 151 | - labelMsg = "("; | 151 | + labelMsg = new StringBuilder("("); |
| 152 | if (labels != null && labels.size() > 0) { | 152 | if (labels != null && labels.size() > 0) { |
| 153 | for (Object labelObj : labels) { | 153 | for (Object labelObj : labels) { |
| 154 | JSONObject jsonObjectone = (JSONObject) labelObj; | 154 | JSONObject jsonObjectone = (JSONObject) labelObj; |
| 155 | Integer label = jsonObjectone.getInteger("label"); | 155 | Integer label = jsonObjectone.getInteger("label"); |
| 156 | String name = TextLabels.getName(label); | 156 | String name = TextLabels.getName(label); |
| 157 | - labelMsg = labelMsg + name; | 157 | + labelMsg.append(name); |
| 158 | 158 | ||
| 159 | } | 159 | } |
| 160 | } | 160 | } |
| @@ -183,7 +183,7 @@ public class AudioControllerApi { | @@ -183,7 +183,7 @@ public class AudioControllerApi { | ||
| 183 | newshyAudio.setMsg("易盾点播音频审核其它问题需排查"); | 183 | newshyAudio.setMsg("易盾点播音频审核其它问题需排查"); |
| 184 | newYiDunMsg.setDesc_msg("易盾点播音频审核其它问题需排查"); | 184 | newYiDunMsg.setDesc_msg("易盾点播音频审核其它问题需排查"); |
| 185 | } | 185 | } |
| 186 | - yiDunServiceImpl.updateYiDunMsg(newYiDunMsg); | 186 | + yiDunService.updateYiDunMsg(newYiDunMsg); |
| 187 | audioService.updateAudioMsg(newshyAudio); | 187 | audioService.updateAudioMsg(newshyAudio); |
| 188 | } | 188 | } |
| 189 | } | 189 | } |
src/main/java/com/cnlive/shenhe/api/AvsampleCallBackControllerApi.java
| @@ -2,18 +2,22 @@ package com.cnlive.shenhe.api; | @@ -2,18 +2,22 @@ package com.cnlive.shenhe.api; | ||
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | import com.cnlive.shenhe.entity.ShyVideos; | 4 | import com.cnlive.shenhe.entity.ShyVideos; |
| 5 | -import com.cnlive.shenhe.service.serviceImpl.VideosServiceImpl; | 5 | +import com.cnlive.shenhe.service.VideosService; |
| 6 | import com.cnlive.shenhe.utils.CommonConst; | 6 | import com.cnlive.shenhe.utils.CommonConst; |
| 7 | import com.cnlive.shenhe.utils.CommonUtils; | 7 | import com.cnlive.shenhe.utils.CommonUtils; |
| 8 | import org.slf4j.Logger; | 8 | import org.slf4j.Logger; |
| 9 | import org.slf4j.LoggerFactory; | 9 | import org.slf4j.LoggerFactory; |
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | import org.springframework.stereotype.Controller; | 11 | import org.springframework.stereotype.Controller; |
| 12 | -import org.springframework.web.bind.annotation.*; | 12 | +import org.springframework.web.bind.annotation.PostMapping; |
| 13 | +import org.springframework.web.bind.annotation.RequestBody; | ||
| 14 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 15 | +import org.springframework.web.bind.annotation.ResponseBody; | ||
| 13 | 16 | ||
| 14 | import java.util.List; | 17 | import java.util.List; |
| 15 | 18 | ||
| 16 | /** | 19 | /** |
| 20 | + * @author Administrator | ||
| 17 | * @Auther: 周伟鹏 | 21 | * @Auther: 周伟鹏 |
| 18 | * @Date: 2018/12/21 13:43 | 22 | * @Date: 2018/12/21 13:43 |
| 19 | * @Description:抽帧回调接口 | 23 | * @Description:抽帧回调接口 |
| @@ -25,7 +29,7 @@ public class AvsampleCallBackControllerApi { | @@ -25,7 +29,7 @@ public class AvsampleCallBackControllerApi { | ||
| 25 | private static Logger logger = LoggerFactory.getLogger(AvsampleCallBackControllerApi.class); | 29 | private static Logger logger = LoggerFactory.getLogger(AvsampleCallBackControllerApi.class); |
| 26 | 30 | ||
| 27 | @Autowired | 31 | @Autowired |
| 28 | - VideosServiceImpl videosService; | 32 | + VideosService videosService; |
| 29 | 33 | ||
| 30 | /** | 34 | /** |
| 31 | * 接收抽帧结果 | 35 | * 接收抽帧结果 |
| @@ -43,7 +47,7 @@ public class AvsampleCallBackControllerApi { | @@ -43,7 +47,7 @@ public class AvsampleCallBackControllerApi { | ||
| 43 | if (CommonUtils.isNotEmpty(taskId)) { | 47 | if (CommonUtils.isNotEmpty(taskId)) { |
| 44 | ShyVideos shyVideo = new ShyVideos(); | 48 | ShyVideos shyVideo = new ShyVideos(); |
| 45 | shyVideo.setTask_id(taskId); | 49 | shyVideo.setTask_id(taskId); |
| 46 | - List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideo); | 50 | + List<ShyVideos> shyVideosList = videosService.findShyVideo(shyVideo); |
| 47 | if (!shyVideosList.isEmpty()) { | 51 | if (!shyVideosList.isEmpty()) { |
| 48 | ShyVideos video = shyVideosList.get(0); | 52 | ShyVideos video = shyVideosList.get(0); |
| 49 | Integer code = json.getInteger("code"); | 53 | Integer code = json.getInteger("code"); |
| @@ -58,7 +62,7 @@ public class AvsampleCallBackControllerApi { | @@ -58,7 +62,7 @@ public class AvsampleCallBackControllerApi { | ||
| 58 | video.setMsg("抽帧失败,改为人工审核,失败消息:" + json.getString("errorMsg")); | 62 | video.setMsg("抽帧失败,改为人工审核,失败消息:" + json.getString("errorMsg")); |
| 59 | } | 63 | } |
| 60 | video.setAvsample_msg(json.toJSONString()); | 64 | video.setAvsample_msg(json.toJSONString()); |
| 61 | - boolean success = videosService.updateshyVideos(video); | 65 | + boolean success = videosService.updateShyVideos(video); |
| 62 | if (!success) { | 66 | if (!success) { |
| 63 | result.put("code", -1); | 67 | result.put("code", -1); |
| 64 | } | 68 | } |
src/main/java/com/cnlive/shenhe/api/ContentControllerApi.java
| @@ -148,29 +148,29 @@ public class ContentControllerApi { | @@ -148,29 +148,29 @@ public class ContentControllerApi { | ||
| 148 | //获取生活圈内容的类型 1:图片 2:视频 3:分享 | 148 | //获取生活圈内容的类型 1:图片 2:视频 3:分享 |
| 149 | Integer contentType = json.getInteger("contentType"); | 149 | Integer contentType = json.getInteger("contentType"); |
| 150 | //内容图片地址 | 150 | //内容图片地址 |
| 151 | - String contentImageUrl = ""; | 151 | + StringBuilder contentImageUrl = new StringBuilder(); |
| 152 | if (contentType != null && contentType == 1) { | 152 | if (contentType != null && contentType == 1) { |
| 153 | //朋友圈分享的内容的url | 153 | //朋友圈分享的内容的url |
| 154 | JSONArray contentImageUrlList = JSONObject.parseArray(json.getString("contentImageUrl")); | 154 | JSONArray contentImageUrlList = JSONObject.parseArray(json.getString("contentImageUrl")); |
| 155 | for (int i = 0; i < contentImageUrlList.size(); i++) { | 155 | for (int i = 0; i < contentImageUrlList.size(); i++) { |
| 156 | JSONObject contentImageUrlMap = contentImageUrlList.getJSONObject(i); | 156 | JSONObject contentImageUrlMap = contentImageUrlList.getJSONObject(i); |
| 157 | - contentImageUrl += contentImageUrlMap.getString("imageUrl") + ","; | 157 | + contentImageUrl.append(contentImageUrlMap.getString("imageUrl")).append(","); |
| 158 | } | 158 | } |
| 159 | //去掉最后一个逗号 | 159 | //去掉最后一个逗号 |
| 160 | - contentImageUrl = contentImageUrl.substring(0, contentImageUrl.length() - 1); | 160 | + contentImageUrl = new StringBuilder(contentImageUrl.substring(0, contentImageUrl.length() - 1)); |
| 161 | } else { | 161 | } else { |
| 162 | - contentImageUrl = json.getString("contentImageUrl"); | 162 | + contentImageUrl = new StringBuilder(json.getString("contentImageUrl")); |
| 163 | } | 163 | } |
| 164 | if (contentList.size() > 0) { | 164 | if (contentList.size() > 0) { |
| 165 | //朋友圈存在则更新 | 165 | //朋友圈存在则更新 |
| 166 | ShyContent shyContent1 = contentList.get(0); | 166 | ShyContent shyContent1 = contentList.get(0); |
| 167 | - yorN = saveOrUpdateMoment(json, shyContent1, shenheType, contentImageUrl); | 167 | + yorN = saveOrUpdateMoment(json, shyContent1, shenheType, contentImageUrl.toString()); |
| 168 | logger.info("朋友圈接口更新操作:{}", momentId); | 168 | logger.info("朋友圈接口更新操作:{}", momentId); |
| 169 | } else { | 169 | } else { |
| 170 | //当前朋友圈内容的审核状态,先发后审 | 170 | //当前朋友圈内容的审核状态,先发后审 |
| 171 | shyContent.setContent_status(1); | 171 | shyContent.setContent_status(1); |
| 172 | //朋友圈不存在直接保存 | 172 | //朋友圈不存在直接保存 |
| 173 | - yorN = saveOrUpdateMoment(json, shyContent, shenheType, contentImageUrl); | 173 | + yorN = saveOrUpdateMoment(json, shyContent, shenheType, contentImageUrl.toString()); |
| 174 | logger.info("朋友圈接口保存操作:{}", momentId); | 174 | logger.info("朋友圈接口保存操作:{}", momentId); |
| 175 | } | 175 | } |
| 176 | if (yorN) { | 176 | if (yorN) { |
src/main/java/com/cnlive/shenhe/api/LiveApplyControllerApi.java
| @@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.PostMapping; | @@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.PostMapping; | ||
| 13 | import org.springframework.web.bind.annotation.RequestMapping; | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
| 14 | import org.springframework.web.bind.annotation.ResponseBody; | 14 | import org.springframework.web.bind.annotation.ResponseBody; |
| 15 | 15 | ||
| 16 | -import java.sql.Timestamp; | ||
| 17 | import java.util.Date; | 16 | import java.util.Date; |
| 18 | import java.util.List; | 17 | import java.util.List; |
| 19 | 18 | ||
| @@ -50,16 +49,10 @@ public class LiveApplyControllerApi { | @@ -50,16 +49,10 @@ public class LiveApplyControllerApi { | ||
| 50 | } | 49 | } |
| 51 | //预计开始时间 | 50 | //预计开始时间 |
| 52 | String startTime = json.getString("preStartTime"); | 51 | String startTime = json.getString("preStartTime"); |
| 53 | - Date timestampStart = null; | ||
| 54 | - if (CommonUtils.isNotEmpty(startTime)) { | ||
| 55 | - timestampStart = new Timestamp(Long.parseLong(startTime)); | ||
| 56 | - } | 52 | + Date timestampStart = CommonUtils.getStartAndEndTime(startTime); |
| 57 | //预计结束时间 | 53 | //预计结束时间 |
| 58 | String endTime = json.getString("preEndTime"); | 54 | String endTime = json.getString("preEndTime"); |
| 59 | - Date timestampEnd = null; | ||
| 60 | - if (CommonUtils.isNotEmpty(endTime)) { | ||
| 61 | - timestampEnd = new Timestamp(Long.parseLong(endTime)); | ||
| 62 | - } | 55 | + Date timestampEnd =CommonUtils.getStartAndEndTime(endTime); |
| 63 | ShyLiveapply shyliveApply = new ShyLiveapply(); | 56 | ShyLiveapply shyliveApply = new ShyLiveapply(); |
| 64 | //得到直播活动id去查询是否已有 | 57 | //得到直播活动id去查询是否已有 |
| 65 | shyliveApply.setActivity_id(activityId); | 58 | shyliveApply.setActivity_id(activityId); |
| @@ -127,15 +120,15 @@ public class LiveApplyControllerApi { | @@ -127,15 +120,15 @@ public class LiveApplyControllerApi { | ||
| 127 | //内容简述 | 120 | //内容简述 |
| 128 | shyliveApply.setSimple_content(json.getString("simpleContent")); | 121 | shyliveApply.setSimple_content(json.getString("simpleContent")); |
| 129 | //要点报备:0品牌植入 1广告植入 2商品推销 3网家家独家麦标 | 122 | //要点报备:0品牌植入 1广告植入 2商品推销 3网家家独家麦标 |
| 130 | - shyliveApply.setPoint_key(json.getString("keys").equals("") ? "无" : json.getString("keys")); | 123 | + shyliveApply.setPoint_key("".equals(json.getString("keys")) ? "无" : json.getString("keys")); |
| 131 | //直播地点 | 124 | //直播地点 |
| 132 | shyliveApply.setLive_place(json.getString("livePlace")); | 125 | shyliveApply.setLive_place(json.getString("livePlace")); |
| 133 | //推流地址 | 126 | //推流地址 |
| 134 | shyliveApply.setPush_url(json.getString("pushUrl")); | 127 | shyliveApply.setPush_url(json.getString("pushUrl")); |
| 135 | //拉流地址 | 128 | //拉流地址 |
| 136 | - shyliveApply.setPull_url(json.getString("pullUrl").equals("") ? "无拉流地址" : json.getString("pullUrl")); | 129 | + shyliveApply.setPull_url("".equals(json.getString("pullUrl")) ? "无拉流地址" : json.getString("pullUrl")); |
| 137 | //拉流来源 | 130 | //拉流来源 |
| 138 | - shyliveApply.setPull_source(json.getString("pullSource").equals("") ? "无来源" : json.getString("pullSource")); | 131 | + shyliveApply.setPull_source("".equals(json.getString("pullSource")) ? "无来源" : json.getString("pullSource")); |
| 139 | //播出平台及通道:0网家家 1CNLive网站 2@TV互动电视 | 132 | //播出平台及通道:0网家家 1CNLive网站 2@TV互动电视 |
| 140 | shyliveApply.setPlatforms(json.getString("platforms")); | 133 | shyliveApply.setPlatforms(json.getString("platforms")); |
| 141 | //设置回调地址 | 134 | //设置回调地址 |
src/main/java/com/cnlive/shenhe/api/LiveControllerApi.java
| @@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.PostMapping; | @@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.PostMapping; | ||
| 14 | import org.springframework.web.bind.annotation.RequestMapping; | 14 | import org.springframework.web.bind.annotation.RequestMapping; |
| 15 | import org.springframework.web.bind.annotation.ResponseBody; | 15 | import org.springframework.web.bind.annotation.ResponseBody; |
| 16 | 16 | ||
| 17 | -import java.sql.Timestamp; | ||
| 18 | import java.util.Date; | 17 | import java.util.Date; |
| 19 | import java.util.List; | 18 | import java.util.List; |
| 20 | 19 | ||
| @@ -49,28 +48,16 @@ public class LiveControllerApi { | @@ -49,28 +48,16 @@ public class LiveControllerApi { | ||
| 49 | String channelId = json.getString("channelId"); | 48 | String channelId = json.getString("channelId"); |
| 50 | //开始时间 | 49 | //开始时间 |
| 51 | String startTime = json.getString("startTime"); | 50 | String startTime = json.getString("startTime"); |
| 52 | - Date timestampStart = null; | ||
| 53 | - if (CommonUtils.isNotEmpty(startTime)) { | ||
| 54 | - timestampStart = new Timestamp(Long.parseLong(startTime)); | ||
| 55 | - } | 51 | + Date timestampStart = CommonUtils.getStartAndEndTime(startTime); |
| 56 | //结束时间 | 52 | //结束时间 |
| 57 | String endTime = json.getString("endTime"); | 53 | String endTime = json.getString("endTime"); |
| 58 | - Date timestampEnd = null; | ||
| 59 | - if (CommonUtils.isNotEmpty(endTime)) { | ||
| 60 | - timestampEnd = new Timestamp(Long.parseLong(endTime)); | ||
| 61 | - } | 54 | + Date timestampEnd = CommonUtils.getStartAndEndTime(endTime); |
| 62 | //预计开始时间 | 55 | //预计开始时间 |
| 63 | String preStartTime = json.getString("preStartTime"); | 56 | String preStartTime = json.getString("preStartTime"); |
| 64 | - Date preTimestampStart = null; | ||
| 65 | - if (CommonUtils.isNotEmpty(preStartTime)) { | ||
| 66 | - preTimestampStart = new Timestamp(Long.parseLong(preStartTime)); | ||
| 67 | - } | 57 | + Date preTimestampStart = CommonUtils.getStartAndEndTime(preStartTime); |
| 68 | //预计结束时间 | 58 | //预计结束时间 |
| 69 | String preEndTime = json.getString("preEndTime"); | 59 | String preEndTime = json.getString("preEndTime"); |
| 70 | - Date preTimestampEnd = null; | ||
| 71 | - if (CommonUtils.isNotEmpty(preEndTime)) { | ||
| 72 | - preTimestampEnd = new Timestamp(Long.parseLong(preEndTime)); | ||
| 73 | - } | 60 | + Date preTimestampEnd = CommonUtils.getStartAndEndTime(preEndTime); |
| 74 | ShyLive shyLive = new ShyLive(); | 61 | ShyLive shyLive = new ShyLive(); |
| 75 | //得到直播活动id去查询是否已有 | 62 | //得到直播活动id去查询是否已有 |
| 76 | shyLive.setActivity_id(activityId); | 63 | shyLive.setActivity_id(activityId); |
src/main/java/com/cnlive/shenhe/api/TopicControllerApi.java
| @@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject; | @@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject; | ||
| 4 | import com.cnlive.shenhe.bean.ErrorEnum; | 4 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 5 | import com.cnlive.shenhe.bean.ResponseBean; | 5 | import com.cnlive.shenhe.bean.ResponseBean; |
| 6 | import com.cnlive.shenhe.entity.ShyTopic; | 6 | import com.cnlive.shenhe.entity.ShyTopic; |
| 7 | -import com.cnlive.shenhe.service.serviceImpl.TopicServiceImpl; | 7 | +import com.cnlive.shenhe.service.TopicService; |
| 8 | import com.cnlive.shenhe.utils.CommonConst; | 8 | import com.cnlive.shenhe.utils.CommonConst; |
| 9 | import com.cnlive.shenhe.utils.CommonUtils; | 9 | import com.cnlive.shenhe.utils.CommonUtils; |
| 10 | import com.cnlive.shenhe.utils.TransitServiceUtils; | 10 | import com.cnlive.shenhe.utils.TransitServiceUtils; |
| @@ -27,7 +27,7 @@ public class TopicControllerApi { | @@ -27,7 +27,7 @@ public class TopicControllerApi { | ||
| 27 | 27 | ||
| 28 | private static Logger logger = LoggerFactory.getLogger(TopicControllerApi.class); | 28 | private static Logger logger = LoggerFactory.getLogger(TopicControllerApi.class); |
| 29 | @Autowired | 29 | @Autowired |
| 30 | - TopicServiceImpl topicService; | 30 | + TopicService topicService; |
| 31 | @Autowired | 31 | @Autowired |
| 32 | TransitServiceUtils transitServiceUtils; | 32 | TransitServiceUtils transitServiceUtils; |
| 33 | 33 | ||
| @@ -53,7 +53,7 @@ public class TopicControllerApi { | @@ -53,7 +53,7 @@ public class TopicControllerApi { | ||
| 53 | //判断是否存在 | 53 | //判断是否存在 |
| 54 | ShyTopic shyTopic = new ShyTopic(); | 54 | ShyTopic shyTopic = new ShyTopic(); |
| 55 | shyTopic.setTopic_id(topicId); | 55 | shyTopic.setTopic_id(topicId); |
| 56 | - List<ShyTopic> topicList = topicService.findshyTopic(shyTopic); | 56 | + List<ShyTopic> topicList = topicService.findShyTopic(shyTopic); |
| 57 | //获取审核类型 | 57 | //获取审核类型 |
| 58 | Integer shenheType = topicService.getShenheType(spId); | 58 | Integer shenheType = topicService.getShenheType(spId); |
| 59 | if (topicList.size() > 0) { | 59 | if (topicList.size() > 0) { |
| @@ -104,9 +104,9 @@ public class TopicControllerApi { | @@ -104,9 +104,9 @@ public class TopicControllerApi { | ||
| 104 | //最后一次更新时间 | 104 | //最后一次更新时间 |
| 105 | shyTopic.setUpdate_date(CommonUtils.getCurrentTime()); | 105 | shyTopic.setUpdate_date(CommonUtils.getCurrentTime()); |
| 106 | if (shyTopic.getId() == null) { | 106 | if (shyTopic.getId() == null) { |
| 107 | - return topicService.impotshyTopic(shyTopic); | 107 | + return topicService.impotShyTopic(shyTopic); |
| 108 | } else { | 108 | } else { |
| 109 | - return topicService.updateshyTopic(shyTopic); | 109 | + return topicService.updateShyTopic(shyTopic); |
| 110 | } | 110 | } |
| 111 | } | 111 | } |
| 112 | 112 | ||
| @@ -152,7 +152,7 @@ public class TopicControllerApi { | @@ -152,7 +152,7 @@ public class TopicControllerApi { | ||
| 152 | topic.setShenhe_type(CommonConst.AUDIT_TYPE_USER); | 152 | topic.setShenhe_type(CommonConst.AUDIT_TYPE_USER); |
| 153 | topic.setAuditor_id(null); | 153 | topic.setAuditor_id(null); |
| 154 | } | 154 | } |
| 155 | - boolean rs = topicService.updateshyTopic(topic); | 155 | + boolean rs = topicService.updateShyTopic(topic); |
| 156 | Map<String, Object> ee = new HashMap<>(16); | 156 | Map<String, Object> ee = new HashMap<>(16); |
| 157 | ee.put("topic_id", topicId); | 157 | ee.put("topic_id", topicId); |
| 158 | if (rs) { | 158 | if (rs) { |
src/main/java/com/cnlive/shenhe/api/VideosControllerApi.java
| @@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject; | @@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject; | ||
| 5 | import com.cnlive.shenhe.bean.ErrorEnum; | 5 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 6 | import com.cnlive.shenhe.bean.ResponseBean; | 6 | import com.cnlive.shenhe.bean.ResponseBean; |
| 7 | import com.cnlive.shenhe.entity.ShyVideos; | 7 | import com.cnlive.shenhe.entity.ShyVideos; |
| 8 | -import com.cnlive.shenhe.service.serviceImpl.VideosServiceImpl; | 8 | +import com.cnlive.shenhe.service.VideosService; |
| 9 | import com.cnlive.shenhe.utils.CommonConst; | 9 | import com.cnlive.shenhe.utils.CommonConst; |
| 10 | import com.cnlive.shenhe.utils.CommonUtils; | 10 | import com.cnlive.shenhe.utils.CommonUtils; |
| 11 | import com.cnlive.shenhe.utils.HttpUtil; | 11 | import com.cnlive.shenhe.utils.HttpUtil; |
| @@ -33,7 +33,7 @@ import java.util.Map; | @@ -33,7 +33,7 @@ import java.util.Map; | ||
| 33 | public class VideosControllerApi { | 33 | public class VideosControllerApi { |
| 34 | private static Logger logger = LoggerFactory.getLogger(VideosControllerApi.class); | 34 | private static Logger logger = LoggerFactory.getLogger(VideosControllerApi.class); |
| 35 | @Autowired | 35 | @Autowired |
| 36 | - VideosServiceImpl videosService; | 36 | + VideosService videosService; |
| 37 | 37 | ||
| 38 | @Value("${avsmple_appKey}") | 38 | @Value("${avsmple_appKey}") |
| 39 | String appkey; | 39 | String appkey; |
| @@ -80,7 +80,7 @@ public class VideosControllerApi { | @@ -80,7 +80,7 @@ public class VideosControllerApi { | ||
| 80 | //g得到id去查询是否已有 | 80 | //g得到id去查询是否已有 |
| 81 | String videoId = json.getString("videoId"); | 81 | String videoId = json.getString("videoId"); |
| 82 | shyVideos.setVideo_id(videoId); | 82 | shyVideos.setVideo_id(videoId); |
| 83 | - List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideos); | 83 | + List<ShyVideos> shyVideosList = videosService.findShyVideo(shyVideos); |
| 84 | if (shyVideosList.size() > 0) { | 84 | if (shyVideosList.size() > 0) { |
| 85 | logger.info("点播入库更新开始............................"); | 85 | logger.info("点播入库更新开始............................"); |
| 86 | ShyVideos shyVideos1 = shyVideosList.get(0); | 86 | ShyVideos shyVideos1 = shyVideosList.get(0); |
| @@ -149,7 +149,7 @@ public class VideosControllerApi { | @@ -149,7 +149,7 @@ public class VideosControllerApi { | ||
| 149 | return videosService.impotVideo(shyVideos); | 149 | return videosService.impotVideo(shyVideos); |
| 150 | } else { | 150 | } else { |
| 151 | logger.info("当前视频类型是:" + shyVideos.getShenhe_type()); | 151 | logger.info("当前视频类型是:" + shyVideos.getShenhe_type()); |
| 152 | - return videosService.updateshyVideos(shyVideos); | 152 | + return videosService.updateShyVideos(shyVideos); |
| 153 | } | 153 | } |
| 154 | } | 154 | } |
| 155 | 155 |
src/main/java/com/cnlive/shenhe/api/YiDunControllerApi.java
| @@ -2,7 +2,7 @@ package com.cnlive.shenhe.api; | @@ -2,7 +2,7 @@ package com.cnlive.shenhe.api; | ||
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | import com.cnlive.shenhe.entity.ShyYidun; | 4 | import com.cnlive.shenhe.entity.ShyYidun; |
| 5 | -import com.cnlive.shenhe.service.serviceImpl.YiDunServiceImpl; | 5 | +import com.cnlive.shenhe.service.YiDunService; |
| 6 | import com.cnlive.shenhe.utils.CommonConstStates; | 6 | import com.cnlive.shenhe.utils.CommonConstStates; |
| 7 | import com.cnlive.shenhe.utils.HttpClientUtils; | 7 | import com.cnlive.shenhe.utils.HttpClientUtils; |
| 8 | import com.cnlive.shenhe.utils.YiDunAntiFraudUtil; | 8 | import com.cnlive.shenhe.utils.YiDunAntiFraudUtil; |
| @@ -27,7 +27,7 @@ public class YiDunControllerApi { | @@ -27,7 +27,7 @@ public class YiDunControllerApi { | ||
| 27 | private static Logger logger = LoggerFactory.getLogger(YiDunControllerApi.class); | 27 | private static Logger logger = LoggerFactory.getLogger(YiDunControllerApi.class); |
| 28 | 28 | ||
| 29 | @Autowired | 29 | @Autowired |
| 30 | - YiDunServiceImpl yiDunServiceImpl; | 30 | + YiDunService yiDunService; |
| 31 | 31 | ||
| 32 | /** | 32 | /** |
| 33 | * 网站地址URL产品密钥ID,产品标识 | 33 | * 网站地址URL产品密钥ID,产品标识 |
| @@ -88,7 +88,7 @@ public class YiDunControllerApi { | @@ -88,7 +88,7 @@ public class YiDunControllerApi { | ||
| 88 | //网页 | 88 | //网页 |
| 89 | shyYidun.setCheck_type(CommonConstStates.WANGYE); | 89 | shyYidun.setCheck_type(CommonConstStates.WANGYE); |
| 90 | shyYidun.setCreate_time(new Date()); | 90 | shyYidun.setCreate_time(new Date()); |
| 91 | - yiDunServiceImpl.addYiDunMsg(shyYidun); | 91 | + yiDunService.addYiDunMsg(shyYidun); |
| 92 | } | 92 | } |
| 93 | } | 93 | } |
| 94 | } | 94 | } |
src/main/java/com/cnlive/shenhe/controller/AudioController.java
| @@ -220,13 +220,13 @@ public class AudioController extends BaseController { | @@ -220,13 +220,13 @@ public class AudioController extends BaseController { | ||
| 220 | String userId = sessionUser.getUserId(); | 220 | String userId = sessionUser.getUserId(); |
| 221 | ResponseBean responseBean = new ResponseBean(); | 221 | ResponseBean responseBean = new ResponseBean(); |
| 222 | String[] shyAudiods = ids.split(","); | 222 | String[] shyAudiods = ids.split(","); |
| 223 | - String showMsg = ""; | 223 | + StringBuilder showMsg = new StringBuilder(); |
| 224 | for (String shyAudioId : shyAudiods) { | 224 | for (String shyAudioId : shyAudiods) { |
| 225 | - showMsg = audioService.repulse(shyAudioId, msg, userId); | 225 | + showMsg.append(audioService.repulse(shyAudioId, msg, userId)); |
| 226 | } | 226 | } |
| 227 | - if (CommonUtils.isNotEmpty(showMsg)) { | 227 | + if (CommonUtils.isNotEmpty(showMsg.toString())) { |
| 228 | responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); | 228 | responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); |
| 229 | - responseBean.setErrorMessage(showMsg); | 229 | + responseBean.setErrorMessage(showMsg.toString()); |
| 230 | } | 230 | } |
| 231 | return responseBean; | 231 | return responseBean; |
| 232 | } | 232 | } |
| @@ -428,9 +428,9 @@ public class AudioController extends BaseController { | @@ -428,9 +428,9 @@ public class AudioController extends BaseController { | ||
| 428 | * 审核结果更新并通知点播音频 | 428 | * 审核结果更新并通知点播音频 |
| 429 | * | 429 | * |
| 430 | * @param activity_id 音频id(audioId) | 430 | * @param activity_id 音频id(audioId) |
| 431 | - * @param state 状态码 | ||
| 432 | - * @param attr_tags 常用审核意见(标签) | ||
| 433 | - * @param msg 审核备注 | 431 | + * @param state 状态码 |
| 432 | + * @param attr_tags 常用审核意见(标签) | ||
| 433 | + * @param msg 审核备注 | ||
| 434 | * @return | 434 | * @return |
| 435 | */ | 435 | */ |
| 436 | @PostMapping("/shenheAudio") | 436 | @PostMapping("/shenheAudio") |
src/main/java/com/cnlive/shenhe/controller/ChannelController.java
| @@ -204,10 +204,10 @@ public class ChannelController extends BaseController { | @@ -204,10 +204,10 @@ public class ChannelController extends BaseController { | ||
| 204 | String userId = sessionUser.getUserId(); | 204 | String userId = sessionUser.getUserId(); |
| 205 | ResponseBean responseBean = new ResponseBean(); | 205 | ResponseBean responseBean = new ResponseBean(); |
| 206 | String[] channelIds = ids.split(","); | 206 | String[] channelIds = ids.split(","); |
| 207 | - String showMsg = ""; | 207 | + StringBuilder showMsg = new StringBuilder(); |
| 208 | for (String channelId : channelIds) { | 208 | for (String channelId : channelIds) { |
| 209 | ShyChannel channel = channelService.selectByPrimaryKey(Integer.parseInt(channelId)); | 209 | ShyChannel channel = channelService.selectByPrimaryKey(Integer.parseInt(channelId)); |
| 210 | - JSONObject result = null; | 210 | + JSONObject result; |
| 211 | JSONObject json = new JSONObject(); | 211 | JSONObject json = new JSONObject(); |
| 212 | json.put("channel_id", channel.getChannel_id()); | 212 | json.put("channel_id", channel.getChannel_id()); |
| 213 | json.put("state", 4); | 213 | json.put("state", 4); |
| @@ -217,18 +217,18 @@ public class ChannelController extends BaseController { | @@ -217,18 +217,18 @@ public class ChannelController extends BaseController { | ||
| 217 | result = pass.commentPass(json, channel.getCallback()); | 217 | result = pass.commentPass(json, channel.getCallback()); |
| 218 | } catch (Exception e) { | 218 | } catch (Exception e) { |
| 219 | logger.error("评论回调失败,activity_id:{}", channel.getChannel_id()); | 219 | logger.error("评论回调失败,activity_id:{}", channel.getChannel_id()); |
| 220 | - showMsg = showMsg + "," + channel.getChannel_name() + "的评论拒绝请求失败"; | 220 | + showMsg.append(",").append(channel.getChannel_name()).append("的评论拒绝请求失败"); |
| 221 | break; | 221 | break; |
| 222 | } | 222 | } |
| 223 | if (result == null) { | 223 | if (result == null) { |
| 224 | logger.error("评论回调错误,且无返回信息。activity_id:{}", channel.getChannel_id()); | 224 | logger.error("评论回调错误,且无返回信息。activity_id:{}", channel.getChannel_id()); |
| 225 | - showMsg = showMsg + "," + channel.getChannel_name() + "的评论拒绝请求失败"; | 225 | + showMsg.append(",").append(channel.getChannel_name()).append("的评论拒绝请求失败"); |
| 226 | break; | 226 | break; |
| 227 | } else { | 227 | } else { |
| 228 | Integer code = result.getInteger("errorCode"); | 228 | Integer code = result.getInteger("errorCode"); |
| 229 | if (code != 0) { | 229 | if (code != 0) { |
| 230 | logger.error("评论回调错误,activity_id:{},errorCode:{},errorMessage:{}", channel.getChannel_id(), code, result.getString("errorMessage")); | 230 | logger.error("评论回调错误,activity_id:{},errorCode:{},errorMessage:{}", channel.getChannel_id(), code, result.getString("errorMessage")); |
| 231 | - showMsg = showMsg + "," + channel.getChannel_name() + "的评论拒绝请求失败"; | 231 | + showMsg.append(",").append(channel.getChannel_name()).append("的评论拒绝请求失败"); |
| 232 | break; | 232 | break; |
| 233 | } | 233 | } |
| 234 | channel.setShenhe_status(2); | 234 | channel.setShenhe_status(2); |
| @@ -237,13 +237,13 @@ public class ChannelController extends BaseController { | @@ -237,13 +237,13 @@ public class ChannelController extends BaseController { | ||
| 237 | int i = channelService.updateByPrimaryKeySelective(channel); | 237 | int i = channelService.updateByPrimaryKeySelective(channel); |
| 238 | if (i != 1) { | 238 | if (i != 1) { |
| 239 | logger.error("评论回调失败,修改结果为0条activity_id:{}", channel.getChannel_id()); | 239 | logger.error("评论回调失败,修改结果为0条activity_id:{}", channel.getChannel_id()); |
| 240 | - showMsg = showMsg + "," + channel.getChannel_name() + "的评论拒绝请求失败"; | 240 | + showMsg.append(",").append(channel.getChannel_name()).append("的评论拒绝请求失败"); |
| 241 | } | 241 | } |
| 242 | } | 242 | } |
| 243 | } | 243 | } |
| 244 | - if (CommonUtils.isNotEmpty(showMsg)) { | 244 | + if (CommonUtils.isNotEmpty(showMsg.toString())) { |
| 245 | responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); | 245 | responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); |
| 246 | - responseBean.setErrorMessage(showMsg); | 246 | + responseBean.setErrorMessage(showMsg.toString()); |
| 247 | } | 247 | } |
| 248 | return responseBean; | 248 | return responseBean; |
| 249 | } | 249 | } |
src/main/java/com/cnlive/shenhe/controller/CommentsController.java
| @@ -246,10 +246,10 @@ public class CommentsController extends BaseController { | @@ -246,10 +246,10 @@ public class CommentsController extends BaseController { | ||
| 246 | String userId = sessionUser.getUserId(); | 246 | String userId = sessionUser.getUserId(); |
| 247 | ResponseBean responseBean = new ResponseBean(); | 247 | ResponseBean responseBean = new ResponseBean(); |
| 248 | String[] commentsIds = ids.split(","); | 248 | String[] commentsIds = ids.split(","); |
| 249 | - String showMsg = ""; | 249 | + StringBuilder showMsg = new StringBuilder(); |
| 250 | for (String commentsId : commentsIds) { | 250 | for (String commentsId : commentsIds) { |
| 251 | ShyComments comments = commentsService.selectByPrimaryKey(Integer.parseInt(commentsId)); | 251 | ShyComments comments = commentsService.selectByPrimaryKey(Integer.parseInt(commentsId)); |
| 252 | - JSONObject result = null; | 252 | + JSONObject result; |
| 253 | JSONObject json = new JSONObject(); | 253 | JSONObject json = new JSONObject(); |
| 254 | json.put("activity_id", comments.getActivity_id()); | 254 | json.put("activity_id", comments.getActivity_id()); |
| 255 | json.put("state", 4); | 255 | json.put("state", 4); |
| @@ -259,18 +259,18 @@ public class CommentsController extends BaseController { | @@ -259,18 +259,18 @@ public class CommentsController extends BaseController { | ||
| 259 | result = pass.commentPass(json, comments.getCallback()); | 259 | result = pass.commentPass(json, comments.getCallback()); |
| 260 | } catch (Exception e) { | 260 | } catch (Exception e) { |
| 261 | logger.error("评论回调失败,activity_id:{}", comments.getActivity_id()); | 261 | logger.error("评论回调失败,activity_id:{}", comments.getActivity_id()); |
| 262 | - showMsg = showMsg + "," + comments.getComment_user_name() + "的评论拒绝请求失败"; | 262 | + showMsg.append(",").append(comments.getComment_user_name()).append("的评论拒绝请求失败"); |
| 263 | break; | 263 | break; |
| 264 | } | 264 | } |
| 265 | if (result == null) { | 265 | if (result == null) { |
| 266 | logger.error("评论回调错误,且无返回信息。activity_id:{}", comments.getActivity_id()); | 266 | logger.error("评论回调错误,且无返回信息。activity_id:{}", comments.getActivity_id()); |
| 267 | - showMsg = showMsg + "," + comments.getComment_user_name() + "的评论拒绝请求失败"; | 267 | + showMsg.append(",").append(comments.getComment_user_name()).append("的评论拒绝请求失败"); |
| 268 | break; | 268 | break; |
| 269 | } else { | 269 | } else { |
| 270 | Integer code = result.getInteger("errorCode"); | 270 | Integer code = result.getInteger("errorCode"); |
| 271 | if (code != 0) { | 271 | if (code != 0) { |
| 272 | logger.error("评论回调错误,activity_id:{},errorCode:{},errorMessage:{}", comments.getActivity_id(), code, result.getString("errorMessage")); | 272 | logger.error("评论回调错误,activity_id:{},errorCode:{},errorMessage:{}", comments.getActivity_id(), code, result.getString("errorMessage")); |
| 273 | - showMsg = showMsg + "," + comments.getComment_user_name() + "的评论拒绝请求失败"; | 273 | + showMsg.append(",").append(comments.getComment_user_name()).append("的评论拒绝请求失败"); |
| 274 | break; | 274 | break; |
| 275 | } | 275 | } |
| 276 | comments.setState(2); | 276 | comments.setState(2); |
| @@ -279,13 +279,13 @@ public class CommentsController extends BaseController { | @@ -279,13 +279,13 @@ public class CommentsController extends BaseController { | ||
| 279 | int i = commentsService.updateByPrimaryKeySelective(comments); | 279 | int i = commentsService.updateByPrimaryKeySelective(comments); |
| 280 | if (i != 1) { | 280 | if (i != 1) { |
| 281 | logger.error("评论回调失败,修改结果为0条activity_id:{}", comments.getActivity_id()); | 281 | logger.error("评论回调失败,修改结果为0条activity_id:{}", comments.getActivity_id()); |
| 282 | - showMsg = showMsg + "," + comments.getComment_user_name() + "的评论拒绝请求失败"; | 282 | + showMsg.append(",").append(comments.getComment_user_name()).append("的评论拒绝请求失败"); |
| 283 | } | 283 | } |
| 284 | } | 284 | } |
| 285 | } | 285 | } |
| 286 | - if (CommonUtils.isNotEmpty(showMsg)) { | 286 | + if (CommonUtils.isNotEmpty(showMsg.toString())) { |
| 287 | responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); | 287 | responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); |
| 288 | - responseBean.setErrorMessage(showMsg); | 288 | + responseBean.setErrorMessage(showMsg.toString()); |
| 289 | } | 289 | } |
| 290 | return responseBean; | 290 | return responseBean; |
| 291 | } | 291 | } |
src/main/java/com/cnlive/shenhe/controller/LiveApplyController.java
| @@ -77,7 +77,7 @@ public class LiveApplyController extends BaseController { | @@ -77,7 +77,7 @@ public class LiveApplyController extends BaseController { | ||
| 77 | String userId = sessionUser.getUserId(); | 77 | String userId = sessionUser.getUserId(); |
| 78 | ResponseBean responseBean = new ResponseBean(); | 78 | ResponseBean responseBean = new ResponseBean(); |
| 79 | String[] shyLiveApplyIds = ids.split(","); | 79 | String[] shyLiveApplyIds = ids.split(","); |
| 80 | - String showMsg = ""; | 80 | + StringBuilder showMsg = new StringBuilder(); |
| 81 | for (String shyLiveApplyId : shyLiveApplyIds) { | 81 | for (String shyLiveApplyId : shyLiveApplyIds) { |
| 82 | ShyLiveapply shyLiveapply = liveApplyService.selectByPrimaryKey(Integer.parseInt(shyLiveApplyId)); | 82 | ShyLiveapply shyLiveapply = liveApplyService.selectByPrimaryKey(Integer.parseInt(shyLiveApplyId)); |
| 83 | JSONObject result; | 83 | JSONObject result; |
| @@ -85,29 +85,29 @@ public class LiveApplyController extends BaseController { | @@ -85,29 +85,29 @@ public class LiveApplyController extends BaseController { | ||
| 85 | result = pass.liveApplyPass(shyLiveapply.getActivity_id(), state + 2, msg, msg, shyLiveapply.getCallback()); | 85 | result = pass.liveApplyPass(shyLiveapply.getActivity_id(), state + 2, msg, msg, shyLiveapply.getCallback()); |
| 86 | } catch (Exception e) { | 86 | } catch (Exception e) { |
| 87 | logger.error("直播视频审核失败,id==" + shyLiveApplyId, e); | 87 | logger.error("直播视频审核失败,id==" + shyLiveApplyId, e); |
| 88 | - showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 拒绝请求失败"; | 88 | + showMsg.append(",").append(shyLiveapply.getActivity_id()).append(" 拒绝请求失败"); |
| 89 | break; | 89 | break; |
| 90 | } | 90 | } |
| 91 | if (result == null) { | 91 | if (result == null) { |
| 92 | logger.error("直播视频审核失败且接口错误没有返回信息,id==" + shyLiveApplyId); | 92 | logger.error("直播视频审核失败且接口错误没有返回信息,id==" + shyLiveApplyId); |
| 93 | - showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 拒绝请求失败"; | 93 | + showMsg.append(",").append(shyLiveapply.getActivity_id()).append(" 拒绝请求失败"); |
| 94 | break; | 94 | break; |
| 95 | } | 95 | } |
| 96 | Integer code = result.getInteger("errorCode"); | 96 | Integer code = result.getInteger("errorCode"); |
| 97 | if (code != 0) { | 97 | if (code != 0) { |
| 98 | logger.error("直播视频审核失败,id:{},code:{}", shyLiveApplyId, code); | 98 | logger.error("直播视频审核失败,id:{},code:{}", shyLiveApplyId, code); |
| 99 | - showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " " + result.getString(" errorMessage"); | 99 | + showMsg.append(",").append(shyLiveapply.getActivity_id()).append(" ").append(result.getString(" errorMessage")); |
| 100 | break; | 100 | break; |
| 101 | } | 101 | } |
| 102 | int i = liveApplyService.updateLiveApply(Integer.parseInt(shyLiveApplyId), userId, "", state, msg); | 102 | int i = liveApplyService.updateLiveApply(Integer.parseInt(shyLiveApplyId), userId, "", state, msg); |
| 103 | if (i == 0) { | 103 | if (i == 0) { |
| 104 | - showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 更新失败"; | 104 | + showMsg.append(",").append(shyLiveapply.getActivity_id()).append(" 更新失败"); |
| 105 | break; | 105 | break; |
| 106 | } | 106 | } |
| 107 | } | 107 | } |
| 108 | - if (CommonUtils.isNotEmpty(showMsg)) { | 108 | + if (CommonUtils.isNotEmpty(showMsg.toString())) { |
| 109 | responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); | 109 | responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); |
| 110 | - responseBean.setErrorMessage(showMsg); | 110 | + responseBean.setErrorMessage(showMsg.toString()); |
| 111 | } | 111 | } |
| 112 | return responseBean; | 112 | return responseBean; |
| 113 | } | 113 | } |
| @@ -265,7 +265,7 @@ public class LiveApplyController extends BaseController { | @@ -265,7 +265,7 @@ public class LiveApplyController extends BaseController { | ||
| 265 | String userId = sessionUser.getUserId(); | 265 | String userId = sessionUser.getUserId(); |
| 266 | ResponseBean responseBean = new ResponseBean(); | 266 | ResponseBean responseBean = new ResponseBean(); |
| 267 | String[] shyLiveIds = ids.split(","); | 267 | String[] shyLiveIds = ids.split(","); |
| 268 | - String showMsg = ""; | 268 | + StringBuilder showMsg = new StringBuilder(); |
| 269 | for (String shyLiveId : shyLiveIds) { | 269 | for (String shyLiveId : shyLiveIds) { |
| 270 | ShyLiveapply shyLiveapply = liveApplyService.selectByPrimaryKey(Integer.parseInt(shyLiveId)); | 270 | ShyLiveapply shyLiveapply = liveApplyService.selectByPrimaryKey(Integer.parseInt(shyLiveId)); |
| 271 | JSONObject result; | 271 | JSONObject result; |
| @@ -273,29 +273,29 @@ public class LiveApplyController extends BaseController { | @@ -273,29 +273,29 @@ public class LiveApplyController extends BaseController { | ||
| 273 | result = pass.liveApplyPass(shyLiveapply.getActivity_id(), 4, msg, msg, shyLiveapply.getCallback()); | 273 | result = pass.liveApplyPass(shyLiveapply.getActivity_id(), 4, msg, msg, shyLiveapply.getCallback()); |
| 274 | } catch (Exception e) { | 274 | } catch (Exception e) { |
| 275 | logger.error("直播视频审核失败,id==" + shyLiveId, e); | 275 | logger.error("直播视频审核失败,id==" + shyLiveId, e); |
| 276 | - showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 拒绝请求失败"; | 276 | + showMsg.append(",").append(shyLiveapply.getActivity_id()).append(" 拒绝请求失败"); |
| 277 | break; | 277 | break; |
| 278 | } | 278 | } |
| 279 | if (result == null) { | 279 | if (result == null) { |
| 280 | logger.error("直播视频审核失败且接口错误没有返回信息,id==" + shyLiveId); | 280 | logger.error("直播视频审核失败且接口错误没有返回信息,id==" + shyLiveId); |
| 281 | - showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 拒绝请求失败"; | 281 | + showMsg.append(",").append(shyLiveapply.getActivity_id()).append(" 拒绝请求失败"); |
| 282 | break; | 282 | break; |
| 283 | } | 283 | } |
| 284 | Integer code = result.getInteger("errorCode"); | 284 | Integer code = result.getInteger("errorCode"); |
| 285 | if (code != 0) { | 285 | if (code != 0) { |
| 286 | logger.error("直播视频审核失败,id:{},code:{}", shyLiveId, code); | 286 | logger.error("直播视频审核失败,id:{},code:{}", shyLiveId, code); |
| 287 | - showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " " + result.getString(" errorMessage"); | 287 | + showMsg.append(",").append(shyLiveapply.getActivity_id()).append(" ").append(result.getString(" errorMessage")); |
| 288 | break; | 288 | break; |
| 289 | - } | 289 | + } |
| 290 | int i = liveService.updateLive(Integer.parseInt(shyLiveId), userId, "", 4, msg); | 290 | int i = liveService.updateLive(Integer.parseInt(shyLiveId), userId, "", 4, msg); |
| 291 | if (i == 0) { | 291 | if (i == 0) { |
| 292 | - showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 更新失败"; | 292 | + showMsg.append(",").append(shyLiveapply.getActivity_id()).append(" 更新失败"); |
| 293 | break; | 293 | break; |
| 294 | } | 294 | } |
| 295 | } | 295 | } |
| 296 | - if (CommonUtils.isNotEmpty(showMsg)) { | 296 | + if (CommonUtils.isNotEmpty(showMsg.toString())) { |
| 297 | responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); | 297 | responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); |
| 298 | - responseBean.setErrorMessage(showMsg); | 298 | + responseBean.setErrorMessage(showMsg.toString()); |
| 299 | } | 299 | } |
| 300 | return responseBean; | 300 | return responseBean; |
| 301 | } | 301 | } |
src/main/java/com/cnlive/shenhe/controller/LiveController.java
| @@ -12,7 +12,7 @@ import com.cnlive.shenhe.entity.ShyUsers; | @@ -12,7 +12,7 @@ import com.cnlive.shenhe.entity.ShyUsers; | ||
| 12 | import com.cnlive.shenhe.service.LiveService; | 12 | import com.cnlive.shenhe.service.LiveService; |
| 13 | import com.cnlive.shenhe.service.SitesService; | 13 | import com.cnlive.shenhe.service.SitesService; |
| 14 | import com.cnlive.shenhe.service.UsersService; | 14 | import com.cnlive.shenhe.service.UsersService; |
| 15 | -import com.cnlive.shenhe.service.serviceImpl.VideosServiceImpl; | 15 | +import com.cnlive.shenhe.service.VideosService; |
| 16 | import com.cnlive.shenhe.utils.AuditPass; | 16 | import com.cnlive.shenhe.utils.AuditPass; |
| 17 | import com.cnlive.shenhe.utils.CommonConst; | 17 | import com.cnlive.shenhe.utils.CommonConst; |
| 18 | import com.cnlive.shenhe.utils.CommonUtils; | 18 | import com.cnlive.shenhe.utils.CommonUtils; |
| @@ -51,7 +51,7 @@ public class LiveController extends BaseController { | @@ -51,7 +51,7 @@ public class LiveController extends BaseController { | ||
| 51 | @Autowired | 51 | @Autowired |
| 52 | AuditPass pass; | 52 | AuditPass pass; |
| 53 | @Autowired | 53 | @Autowired |
| 54 | - VideosServiceImpl videosService; | 54 | + VideosService videosService; |
| 55 | @Autowired | 55 | @Autowired |
| 56 | UsersService usersService; | 56 | UsersService usersService; |
| 57 | @Autowired | 57 | @Autowired |
| @@ -72,9 +72,9 @@ public class LiveController extends BaseController { | @@ -72,9 +72,9 @@ public class LiveController extends BaseController { | ||
| 72 | * 审核信息返回接口 | 72 | * 审核信息返回接口 |
| 73 | * | 73 | * |
| 74 | * @param activity_id 视频id | 74 | * @param activity_id 视频id |
| 75 | - * @param state 状态码 | ||
| 76 | - * @param attr_tags 标签 | ||
| 77 | - * @param msg 备注信息 | 75 | + * @param state 状态码 |
| 76 | + * @param attr_tags 标签 | ||
| 77 | + * @param msg 备注信息 | ||
| 78 | * @return | 78 | * @return |
| 79 | */ | 79 | */ |
| 80 | @PostMapping("/shenheVideo") | 80 | @PostMapping("/shenheVideo") |
| @@ -134,18 +134,23 @@ public class LiveController extends BaseController { | @@ -134,18 +134,23 @@ public class LiveController extends BaseController { | ||
| 134 | } else if (CommonUtils.isEmpty(liveDTO.getSp_desc()) && liveDTO.getSpid() == 0) { | 134 | } else if (CommonUtils.isEmpty(liveDTO.getSp_desc()) && liveDTO.getSpid() == 0) { |
| 135 | liveDTO.setSpid(null); | 135 | liveDTO.setSpid(null); |
| 136 | } | 136 | } |
| 137 | - String orderByClause = ""; | 137 | + StringBuilder orderByClause = new StringBuilder(); |
| 138 | + //String orderByClause = ""; | ||
| 138 | //审核状态:全部待领 | 139 | //审核状态:全部待领 |
| 139 | if (liveDTO.getShenhe_state() != null && liveDTO.getShenhe_state() == 0) { | 140 | if (liveDTO.getShenhe_state() != null && liveDTO.getShenhe_state() == 0) { |
| 140 | - orderByClause = "field(activity_status,1,3,2,0,4), pre_start_time "; | ||
| 141 | - } else if (liveDTO.getShenhe_state() != null && liveDTO.getShenhe_state() == 1) {//审核状态:待审核 | ||
| 142 | - orderByClause = "field(activity_status,1,3,2,0,4), pre_start_time "; | ||
| 143 | - } else if (liveDTO.getShenhe_state() != null && liveDTO.getShenhe_state() == 2) {//审核状态:已审核 | ||
| 144 | - orderByClause = "pre_start_time desc"; | ||
| 145 | - } else {//审核状态:全部 | ||
| 146 | - orderByClause = "is_hot desc, pre_start_time "; | ||
| 147 | - if (liveDTO.getActivity_status() != null && (liveDTO.getActivity_status() == 0 || liveDTO.getActivity_status() == 2 || liveDTO.getActivity_status() == 4)) {//直播状态:结束、撤销、下线 | ||
| 148 | - orderByClause = "is_hot desc, pre_start_time desc"; | 141 | + orderByClause.append("field(activity_status,1,3,2,0,4), pre_start_time"); |
| 142 | + //审核状态:待审核 | ||
| 143 | + } else if (liveDTO.getShenhe_state() != null && liveDTO.getShenhe_state() == 1) { | ||
| 144 | + orderByClause.append("field(activity_status,1,3,2,0,4), pre_start_time"); | ||
| 145 | + //审核状态:已审核 | ||
| 146 | + } else if (liveDTO.getShenhe_state() != null && liveDTO.getShenhe_state() == 2) { | ||
| 147 | + orderByClause.append("pre_start_time desc"); | ||
| 148 | + //审核状态:全部 | ||
| 149 | + } else { | ||
| 150 | + orderByClause.append("is_hot desc, pre_start_time"); | ||
| 151 | + //直播状态:结束、撤销、下线 | ||
| 152 | + if (liveDTO.getActivity_status() != null && (liveDTO.getActivity_status() == 0 || liveDTO.getActivity_status() == 2 || liveDTO.getActivity_status() == 4)) { | ||
| 153 | + orderByClause.append("is_hot desc, pre_start_time desc"); | ||
| 149 | } | 154 | } |
| 150 | } | 155 | } |
| 151 | if (CommonUtils.isNotNull(liveDTO.getContentId())) { | 156 | if (CommonUtils.isNotNull(liveDTO.getContentId())) { |
| @@ -275,37 +280,37 @@ public class LiveController extends BaseController { | @@ -275,37 +280,37 @@ public class LiveController extends BaseController { | ||
| 275 | String userId = sessionUser.getUserId(); | 280 | String userId = sessionUser.getUserId(); |
| 276 | ResponseBean responseBean = new ResponseBean(); | 281 | ResponseBean responseBean = new ResponseBean(); |
| 277 | String[] shyLiveIds = ids.split(","); | 282 | String[] shyLiveIds = ids.split(","); |
| 278 | - String showMsg = ""; | 283 | + StringBuilder showMsg = new StringBuilder(); |
| 279 | for (String shyLiveId : shyLiveIds) { | 284 | for (String shyLiveId : shyLiveIds) { |
| 280 | ShyLive shyLive = liveService.selectByPrimaryKey(Integer.parseInt(shyLiveId)); | 285 | ShyLive shyLive = liveService.selectByPrimaryKey(Integer.parseInt(shyLiveId)); |
| 281 | - JSONObject result = null; | 286 | + JSONObject result; |
| 282 | try { | 287 | try { |
| 283 | result = pass.livePass(shyLive.getActivity_id(), status, msg, msg, shyLive.getCallback()); | 288 | result = pass.livePass(shyLive.getActivity_id(), status, msg, msg, shyLive.getCallback()); |
| 284 | } catch (Exception e) { | 289 | } catch (Exception e) { |
| 285 | logger.error("直播视频审核失败,id==" + shyLiveId, e); | 290 | logger.error("直播视频审核失败,id==" + shyLiveId, e); |
| 286 | - showMsg = showMsg + "," + shyLive.getActivity_id() + " 拒绝请求失败"; | 291 | + showMsg.append(",").append(shyLive.getActivity_id()).append(" 拒绝请求失败"); |
| 287 | break; | 292 | break; |
| 288 | } | 293 | } |
| 289 | if (result == null) { | 294 | if (result == null) { |
| 290 | logger.error("直播视频审核失败且接口错误没有返回信息,id==" + shyLiveId); | 295 | logger.error("直播视频审核失败且接口错误没有返回信息,id==" + shyLiveId); |
| 291 | - showMsg = showMsg + "," + shyLive.getActivity_id() + " 拒绝请求失败"; | 296 | + showMsg.append(",").append(shyLive.getActivity_id()).append(" 拒绝请求失败"); |
| 292 | break; | 297 | break; |
| 293 | } | 298 | } |
| 294 | Integer code = result.getInteger("errorCode"); | 299 | Integer code = result.getInteger("errorCode"); |
| 295 | if (code != 0) { | 300 | if (code != 0) { |
| 296 | logger.error("直播视频审核失败,id:{},code:{}", shyLiveId, code); | 301 | logger.error("直播视频审核失败,id:{},code:{}", shyLiveId, code); |
| 297 | - showMsg = showMsg + "," + shyLive.getActivity_id() + " " + result.getString(" errorMessage"); | 302 | + showMsg.append(",").append(shyLive.getActivity_id()).append(" ").append(result.getString(" errorMessage")); |
| 298 | break; | 303 | break; |
| 299 | } | 304 | } |
| 300 | int i = liveService.updateLive(Integer.parseInt(shyLiveId), userId, "", status == 3 ? 3 : 4, msg); | 305 | int i = liveService.updateLive(Integer.parseInt(shyLiveId), userId, "", status == 3 ? 3 : 4, msg); |
| 301 | if (i == 0) { | 306 | if (i == 0) { |
| 302 | - showMsg = showMsg + "," + shyLive.getActivity_id() + " 更新失败"; | 307 | + showMsg.append(",").append(shyLive.getActivity_id()).append(" 更新失败"); |
| 303 | break; | 308 | break; |
| 304 | } | 309 | } |
| 305 | } | 310 | } |
| 306 | - if (CommonUtils.isNotEmpty(showMsg)) { | 311 | + if (CommonUtils.isNotEmpty(showMsg.toString())) { |
| 307 | responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); | 312 | responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); |
| 308 | - responseBean.setErrorMessage(showMsg); | 313 | + responseBean.setErrorMessage(showMsg.toString()); |
| 309 | } | 314 | } |
| 310 | return responseBean; | 315 | return responseBean; |
| 311 | } | 316 | } |
| @@ -323,36 +328,36 @@ public class LiveController extends BaseController { | @@ -323,36 +328,36 @@ public class LiveController extends BaseController { | ||
| 323 | logger.info("同步直播云信息接口进入"); | 328 | logger.info("同步直播云信息接口进入"); |
| 324 | ResponseBean responseBean = new ResponseBean(); | 329 | ResponseBean responseBean = new ResponseBean(); |
| 325 | String[] shyLiveIds = ids.split(","); | 330 | String[] shyLiveIds = ids.split(","); |
| 326 | - String showMsg = ""; | 331 | + StringBuilder showMsg = new StringBuilder(); |
| 327 | for (String shyLiveId : shyLiveIds) { | 332 | for (String shyLiveId : shyLiveIds) { |
| 328 | ShyLive shyLive = liveService.selectByPrimaryKey(Integer.parseInt(shyLiveId)); | 333 | ShyLive shyLive = liveService.selectByPrimaryKey(Integer.parseInt(shyLiveId)); |
| 329 | - JSONObject result = null; | 334 | + JSONObject result; |
| 330 | try { | 335 | try { |
| 331 | result = pass.syncLive(shyLive.getActivity_id()); | 336 | result = pass.syncLive(shyLive.getActivity_id()); |
| 332 | } catch (Exception e) { | 337 | } catch (Exception e) { |
| 333 | logger.error("直播云信息同步失败,id==" + shyLiveId, e); | 338 | logger.error("直播云信息同步失败,id==" + shyLiveId, e); |
| 334 | - showMsg = showMsg + "," + shyLive.getActivity_id() + " 拒绝请求失败"; | 339 | + showMsg.append(",").append(shyLive.getActivity_id()).append(" 拒绝请求失败"); |
| 335 | break; | 340 | break; |
| 336 | } | 341 | } |
| 337 | if (result == null) { | 342 | if (result == null) { |
| 338 | logger.error("直播云信息同步失败且接口错误没有返回信息,id==" + shyLiveId); | 343 | logger.error("直播云信息同步失败且接口错误没有返回信息,id==" + shyLiveId); |
| 339 | - showMsg = showMsg + "," + shyLive.getActivity_id() + " 拒绝请求失败"; | 344 | + showMsg.append(",").append(shyLive.getActivity_id()).append(" 拒绝请求失败"); |
| 340 | break; | 345 | break; |
| 341 | } | 346 | } |
| 342 | Integer code = result.getInteger("errorCode"); | 347 | Integer code = result.getInteger("errorCode"); |
| 343 | if (code != 0) { | 348 | if (code != 0) { |
| 344 | logger.error("直播云信息同步失败,id:{},code:{}", shyLiveId, code); | 349 | logger.error("直播云信息同步失败,id:{},code:{}", shyLiveId, code); |
| 345 | - showMsg = result.getString("errorMessage"); | 350 | + showMsg.append(result.getString("errorMessage")); |
| 346 | break; | 351 | break; |
| 347 | } | 352 | } |
| 348 | } | 353 | } |
| 349 | - if (CommonUtils.isNotEmpty(showMsg)) { | 354 | + if (CommonUtils.isNotEmpty(showMsg.toString())) { |
| 350 | responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); | 355 | responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); |
| 351 | - responseBean.setErrorMessage(showMsg); | 356 | + responseBean.setErrorMessage(showMsg.toString()); |
| 352 | } else { | 357 | } else { |
| 353 | - showMsg = "直播云信息同步成功"; | 358 | + showMsg.append("直播云信息同步成功"); |
| 354 | responseBean.setErrorCode(ErrorEnum.SUCCESS.getErrorCode()); | 359 | responseBean.setErrorCode(ErrorEnum.SUCCESS.getErrorCode()); |
| 355 | - responseBean.setErrorMessage(showMsg); | 360 | + responseBean.setErrorMessage(showMsg.toString()); |
| 356 | } | 361 | } |
| 357 | return responseBean; | 362 | return responseBean; |
| 358 | } | 363 | } |
src/main/java/com/cnlive/shenhe/controller/TopicController.java
| @@ -8,7 +8,7 @@ import com.cnlive.shenhe.dto.TopicDTO; | @@ -8,7 +8,7 @@ import com.cnlive.shenhe.dto.TopicDTO; | ||
| 8 | import com.cnlive.shenhe.entity.ShySites; | 8 | import com.cnlive.shenhe.entity.ShySites; |
| 9 | import com.cnlive.shenhe.entity.ShyTopic; | 9 | import com.cnlive.shenhe.entity.ShyTopic; |
| 10 | import com.cnlive.shenhe.service.SitesService; | 10 | import com.cnlive.shenhe.service.SitesService; |
| 11 | -import com.cnlive.shenhe.service.serviceImpl.TopicServiceImpl; | 11 | +import com.cnlive.shenhe.service.TopicService; |
| 12 | import com.cnlive.shenhe.utils.CommonConst; | 12 | import com.cnlive.shenhe.utils.CommonConst; |
| 13 | import com.cnlive.shenhe.utils.CommonUtils; | 13 | import com.cnlive.shenhe.utils.CommonUtils; |
| 14 | import com.github.pagehelper.PageInfo; | 14 | import com.github.pagehelper.PageInfo; |
| @@ -38,7 +38,7 @@ public class TopicController extends BaseController { | @@ -38,7 +38,7 @@ public class TopicController extends BaseController { | ||
| 38 | 38 | ||
| 39 | private static Logger logger = LoggerFactory.getLogger(TopicController.class); | 39 | private static Logger logger = LoggerFactory.getLogger(TopicController.class); |
| 40 | @Autowired | 40 | @Autowired |
| 41 | - TopicServiceImpl topicService; | 41 | + TopicService topicService; |
| 42 | @Autowired | 42 | @Autowired |
| 43 | SitesService sitesService; | 43 | SitesService sitesService; |
| 44 | 44 | ||
| @@ -177,7 +177,7 @@ public class TopicController extends BaseController { | @@ -177,7 +177,7 @@ public class TopicController extends BaseController { | ||
| 177 | ShyTopic shyTopic = new ShyTopic(); | 177 | ShyTopic shyTopic = new ShyTopic(); |
| 178 | shyTopic.setShenhe_status(CommonConst.AUDIT_INTT); | 178 | shyTopic.setShenhe_status(CommonConst.AUDIT_INTT); |
| 179 | shyTopic.setShenhe_type(CommonConst.AUDIT_TYPE_USER); | 179 | shyTopic.setShenhe_type(CommonConst.AUDIT_TYPE_USER); |
| 180 | - List<ShyTopic> shyTopicList = topicService.findshyTopic(shyTopic); | 180 | + List<ShyTopic> shyTopicList = topicService.findShyTopic(shyTopic); |
| 181 | if (shyTopicList != null && shyTopicList.size() > 0) { | 181 | if (shyTopicList != null && shyTopicList.size() > 0) { |
| 182 | logger.info("您有" + shyTopicList.size() + "条新的话题审核,请注意查看!"); | 182 | logger.info("您有" + shyTopicList.size() + "条新的话题审核,请注意查看!"); |
| 183 | // 第三个提示框,避免冲突 | 183 | // 第三个提示框,避免冲突 |
src/main/java/com/cnlive/shenhe/controller/VideosController.java
| @@ -7,11 +7,7 @@ import com.cnlive.shenhe.bean.ResponseBean; | @@ -7,11 +7,7 @@ import com.cnlive.shenhe.bean.ResponseBean; | ||
| 7 | import com.cnlive.shenhe.bean.SessionUser; | 7 | import com.cnlive.shenhe.bean.SessionUser; |
| 8 | import com.cnlive.shenhe.dto.VideosDTO; | 8 | import com.cnlive.shenhe.dto.VideosDTO; |
| 9 | import com.cnlive.shenhe.entity.*; | 9 | import com.cnlive.shenhe.entity.*; |
| 10 | -import com.cnlive.shenhe.service.ShyActivityService; | ||
| 11 | -import com.cnlive.shenhe.service.ShyLogService; | ||
| 12 | -import com.cnlive.shenhe.service.SitesService; | ||
| 13 | -import com.cnlive.shenhe.service.UsersService; | ||
| 14 | -import com.cnlive.shenhe.service.serviceImpl.VideosServiceImpl; | 10 | +import com.cnlive.shenhe.service.*; |
| 15 | import com.cnlive.shenhe.utils.AuditPass; | 11 | import com.cnlive.shenhe.utils.AuditPass; |
| 16 | import com.cnlive.shenhe.utils.CommonConst; | 12 | import com.cnlive.shenhe.utils.CommonConst; |
| 17 | import com.cnlive.shenhe.utils.CommonUtils; | 13 | import com.cnlive.shenhe.utils.CommonUtils; |
| @@ -51,7 +47,7 @@ public class VideosController extends BaseController { | @@ -51,7 +47,7 @@ public class VideosController extends BaseController { | ||
| 51 | @Autowired | 47 | @Autowired |
| 52 | private AuditPass pass; | 48 | private AuditPass pass; |
| 53 | @Autowired | 49 | @Autowired |
| 54 | - private VideosServiceImpl videosService; | 50 | + private VideosService videosService; |
| 55 | @Autowired | 51 | @Autowired |
| 56 | private UsersService usersService; | 52 | private UsersService usersService; |
| 57 | @Autowired | 53 | @Autowired |
| @@ -553,13 +549,13 @@ public class VideosController extends BaseController { | @@ -553,13 +549,13 @@ public class VideosController extends BaseController { | ||
| 553 | String userId = sessionUser.getUserId(); | 549 | String userId = sessionUser.getUserId(); |
| 554 | ResponseBean responseBean = new ResponseBean(); | 550 | ResponseBean responseBean = new ResponseBean(); |
| 555 | String[] shyVideoIds = ids.split(","); | 551 | String[] shyVideoIds = ids.split(","); |
| 556 | - String showMsg = ""; | 552 | + StringBuilder showMsg = new StringBuilder(); |
| 557 | for (String shyVideoId : shyVideoIds) { | 553 | for (String shyVideoId : shyVideoIds) { |
| 558 | - showMsg = videosService.repulse(shyVideoId, msg, userId); | 554 | + showMsg.append(videosService.repulse(shyVideoId, msg, userId)); |
| 559 | } | 555 | } |
| 560 | - if (CommonUtils.isNotEmpty(showMsg)) { | 556 | + if (CommonUtils.isNotEmpty(showMsg.toString())) { |
| 561 | responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); | 557 | responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); |
| 562 | - responseBean.setErrorMessage(showMsg); | 558 | + responseBean.setErrorMessage(showMsg.toString()); |
| 563 | } | 559 | } |
| 564 | return responseBean; | 560 | return responseBean; |
| 565 | } | 561 | } |
src/main/java/com/cnlive/shenhe/job/LiveApplyJob.java
| @@ -83,7 +83,7 @@ public class LiveApplyJob { | @@ -83,7 +83,7 @@ public class LiveApplyJob { | ||
| 83 | /** | 83 | /** |
| 84 | * 直播申请邮件通知 | 84 | * 直播申请邮件通知 |
| 85 | */ | 85 | */ |
| 86 | - @Scheduled(fixedRate = 60 * 1000) | 86 | + @Scheduled(fixedRate = 60 * 60 * 1000) |
| 87 | public void liveApplyNotice() { | 87 | public void liveApplyNotice() { |
| 88 | Example example = new Example(ShyLiveapply.class); | 88 | Example example = new Example(ShyLiveapply.class); |
| 89 | Criteria criteria = example.createCriteria(); | 89 | Criteria criteria = example.createCriteria(); |
| @@ -106,17 +106,19 @@ public class LiveApplyJob { | @@ -106,17 +106,19 @@ public class LiveApplyJob { | ||
| 106 | //初始化通知状态 | 106 | //初始化通知状态 |
| 107 | Integer noticeState = liveApply.getEmail_notice_state(); | 107 | Integer noticeState = liveApply.getEmail_notice_state(); |
| 108 | //初始化通知消息 | 108 | //初始化通知消息 |
| 109 | - String noticeMsg = liveApply.getEmail_notice_msg(); | 109 | + //String noticeMsg = liveApply.getEmail_notice_msg(); |
| 110 | + StringBuilder noticeMsg = new StringBuilder(liveApply.getEmail_notice_msg()); | ||
| 110 | //显示spid简称 | 111 | //显示spid简称 |
| 111 | ShySites shySites = sitesService.findspidDescByspid(liveApply.getSp_id()); | 112 | ShySites shySites = sitesService.findspidDescByspid(liveApply.getSp_id()); |
| 112 | if (CommonUtils.isNotNull(shySites)) { | 113 | if (CommonUtils.isNotNull(shySites)) { |
| 113 | liveApply.setSpid_desc(shySites.getName()); | 114 | liveApply.setSpid_desc(shySites.getName()); |
| 114 | } | 115 | } |
| 116 | + StringBuilder content = new StringBuilder(); | ||
| 115 | //循环需要发送邮件的邮箱 | 117 | //循环需要发送邮件的邮箱 |
| 116 | for (ShyEmail shyEmail : shyEmailList) { | 118 | for (ShyEmail shyEmail : shyEmailList) { |
| 117 | String startTime = CommonUtils.formatDate(liveApply.getPre_start_time(), "yyyy-MM-dd HH:mm:ss"); | 119 | String startTime = CommonUtils.formatDate(liveApply.getPre_start_time(), "yyyy-MM-dd HH:mm:ss"); |
| 118 | String endTime = CommonUtils.isNotNull(liveApply.getPre_end_time()) ? CommonUtils.formatDate(liveApply.getPre_end_time(), "yyyy-MM-dd HH:mm:ss") : "待定"; | 120 | String endTime = CommonUtils.isNotNull(liveApply.getPre_end_time()) ? CommonUtils.formatDate(liveApply.getPre_end_time(), "yyyy-MM-dd HH:mm:ss") : "待定"; |
| 119 | - String content = liveApply.getSender() + "__" + liveApply.getMobile() + "__" + liveApply.getOrganization() + "__" + liveApply.getTheme() + "__" + startTime + "__" + endTime + "__" + liveApply.getLive_place() + "__" + liveApply.getPush_url() + "__" + liveApply.getPull_source() + "," + liveApply.getPull_url(); | 121 | + content.append(liveApply.getSender()).append("__").append(liveApply.getMobile()).append("__").append(liveApply.getOrganization()).append("__").append(liveApply.getTheme()).append("__").append(startTime).append("__").append(endTime).append("__").append(liveApply.getLive_place()).append("__").append(liveApply.getPush_url()).append("__").append(liveApply.getPull_source()).append(",").append(liveApply.getPull_url()); |
| 120 | //获取一个格式化后的当前时间 | 122 | //获取一个格式化后的当前时间 |
| 121 | String dateTime = CommonUtils.getCurrentDate("yyyy-MM-dd HH:mm:ss"); | 123 | String dateTime = CommonUtils.getCurrentDate("yyyy-MM-dd HH:mm:ss"); |
| 122 | String emailAddr = shyEmail.getEmail(); | 124 | String emailAddr = shyEmail.getEmail(); |
| @@ -126,7 +128,7 @@ public class LiveApplyJob { | @@ -126,7 +128,7 @@ public class LiveApplyJob { | ||
| 126 | emailparams.put("appId", appId); | 128 | emailparams.put("appId", appId); |
| 127 | emailparams.put("emailAddr", emailAddr); | 129 | emailparams.put("emailAddr", emailAddr); |
| 128 | emailparams.put("title", title); | 130 | emailparams.put("title", title); |
| 129 | - emailparams.put("content", content); | 131 | + emailparams.put("content", content.toString()); |
| 130 | emailparams.put("templateId", templateId); | 132 | emailparams.put("templateId", templateId); |
| 131 | emailparams.put("sign", OpenUtil.sign(emailparams, appKey)); | 133 | emailparams.put("sign", OpenUtil.sign(emailparams, appKey)); |
| 132 | HttpUtil httpUtil = HttpUtil.init(); | 134 | HttpUtil httpUtil = HttpUtil.init(); |
| @@ -137,47 +139,51 @@ public class LiveApplyJob { | @@ -137,47 +139,51 @@ public class LiveApplyJob { | ||
| 137 | JSONObject result = JSONObject.parseObject(post.get("result")); | 139 | JSONObject result = JSONObject.parseObject(post.get("result")); |
| 138 | if (result == null) { | 140 | if (result == null) { |
| 139 | noticeState = CommonConst.NOTICE_FAIL; | 141 | noticeState = CommonConst.NOTICE_FAIL; |
| 140 | - noticeMsg = noticeMsg + "\n" + dateTime + " 邮件服务器调用失败,result为空"; | 142 | + noticeMsg.append("\n").append(dateTime).append(" 邮件服务器调用失败,result为空"); |
| 141 | i += 1; | 143 | i += 1; |
| 142 | break; | 144 | break; |
| 143 | } | 145 | } |
| 144 | Integer code = result.getInteger("errorCode"); | 146 | Integer code = result.getInteger("errorCode"); |
| 145 | if (code != 0) { | 147 | if (code != 0) { |
| 146 | noticeState = CommonConst.NOTICE_FAIL; | 148 | noticeState = CommonConst.NOTICE_FAIL; |
| 147 | - noticeMsg = noticeMsg + "\n" + dateTime + " 邮件服务器调用失败,result返回消息为:" + result.getString("errorMessage"); | 149 | + noticeMsg.append("\n").append(dateTime).append(" 邮件服务器调用失败,result返回消息为:").append(result.getString("errorMessage")); |
| 148 | i += 1; | 150 | i += 1; |
| 149 | break; | 151 | break; |
| 150 | } else { | 152 | } else { |
| 151 | noticeState = CommonConst.NOTICE_SUCCESS; | 153 | noticeState = CommonConst.NOTICE_SUCCESS; |
| 152 | - noticeMsg = noticeMsg + "\n" + dateTime + " 邮件" + emailAddr + "(" + shyEmail.getRemark() + ")发送成功"; | 154 | + noticeMsg.append("\n").append(dateTime).append(" 邮件").append(emailAddr).append("(").append(shyEmail.getRemark()).append(")发送成功"); |
| 153 | } | 155 | } |
| 154 | } catch (Exception e) { | 156 | } catch (Exception e) { |
| 155 | logger.info("异常结果为:{}", e.getMessage()); | 157 | logger.info("异常结果为:{}", e.getMessage()); |
| 156 | noticeState = CommonConst.NOTICE_FAIL; | 158 | noticeState = CommonConst.NOTICE_FAIL; |
| 157 | - noticeMsg = noticeMsg + "\n" + dateTime + " 邮件服务器调用失败,服务器报错了"; | 159 | + noticeMsg.append("\n").append(dateTime).append(" 邮件服务器调用失败,服务器报错了"); |
| 158 | i += 1; | 160 | i += 1; |
| 159 | break; | 161 | break; |
| 160 | } | 162 | } |
| 161 | - //String taskId = "003_01"; | 163 | + //String taskId = "003_09"; |
| 162 | //String signatureId = "0"; | 164 | //String signatureId = "0"; |
| 163 | //Map<String, String> mobileparams = new HashMap<>(16); | 165 | //Map<String, String> mobileparams = new HashMap<>(16); |
| 164 | //mobileparams.put("appId", appId); | 166 | //mobileparams.put("appId", appId); |
| 165 | //mobileparams.put("mobile", liveApply.getMobile()); | 167 | //mobileparams.put("mobile", liveApply.getMobile()); |
| 166 | - //mobileparams.put("content", content); | 168 | + //mobileparams.put("content", content.toString()); |
| 167 | //mobileparams.put("taskId", taskId); | 169 | //mobileparams.put("taskId", taskId); |
| 168 | //mobileparams.put("signatureId", signatureId); | 170 | //mobileparams.put("signatureId", signatureId); |
| 169 | //httpUtil.setParamMap(mobileparams); | 171 | //httpUtil.setParamMap(mobileparams); |
| 170 | - //if (i > 4) { | 172 | + //if (i > shyEmailList.size() * 2) { |
| 171 | // Map<String, String> post = httpUtil.post(mobile_send_URL); | 173 | // Map<String, String> post = httpUtil.post(mobile_send_URL); |
| 172 | // logger.info("当前发送短信用户为:" + liveApply.getMobile() + ",发送短信的直播申请审核云id为:" + liveApply.getId() + "结果为:" + post.get("result")); | 174 | // logger.info("当前发送短信用户为:" + liveApply.getMobile() + ",发送短信的直播申请审核云id为:" + liveApply.getId() + "结果为:" + post.get("result")); |
| 173 | - // noticeState = CommonConst.NOTICE_SUCCESS; | ||
| 174 | - // noticeMsg = noticeMsg + "\n" + dateTime + "短信手机号" + liveApply.getMobile() + "(" + liveApply.getSender() + ")发送成功"; | ||
| 175 | - // i = 0; | 175 | + // JSONObject result = JSONObject.parseObject(post.get("result")); |
| 176 | + // Integer code = result.getInteger("errorCode"); | ||
| 177 | + // if (code == 0) { | ||
| 178 | + // noticeState = CommonConst.NOTICE_SUCCESS; | ||
| 179 | + // noticeMsg.append(noticeMsg).append("\n").append(dateTime).append("短信手机号").append(liveApply.getMobile()).append("(").append(liveApply.getSender()).append(")发送成功").toString(); | ||
| 180 | + // i = 0; | ||
| 181 | + // } | ||
| 176 | // break; | 182 | // break; |
| 177 | //} | 183 | //} |
| 178 | } | 184 | } |
| 179 | liveApply.setEmail_notice_state(noticeState); | 185 | liveApply.setEmail_notice_state(noticeState); |
| 180 | - liveApply.setEmail_notice_msg(noticeMsg); | 186 | + liveApply.setEmail_notice_msg(noticeMsg.toString()); |
| 181 | liveApplyService.updateShyLiveApply(liveApply); | 187 | liveApplyService.updateShyLiveApply(liveApply); |
| 182 | } | 188 | } |
| 183 | } | 189 | } |
src/main/java/com/cnlive/shenhe/job/TopicJob.java
| 1 | package com.cnlive.shenhe.job; | 1 | package com.cnlive.shenhe.job; |
| 2 | 2 | ||
| 3 | import com.cnlive.shenhe.entity.ShyTopic; | 3 | import com.cnlive.shenhe.entity.ShyTopic; |
| 4 | -import com.cnlive.shenhe.service.serviceImpl.TopicServiceImpl; | 4 | +import com.cnlive.shenhe.service.TopicService; |
| 5 | import com.cnlive.shenhe.utils.CommonConst; | 5 | import com.cnlive.shenhe.utils.CommonConst; |
| 6 | import com.cnlive.shenhe.utils.InfoUtil; | 6 | import com.cnlive.shenhe.utils.InfoUtil; |
| 7 | import org.slf4j.Logger; | 7 | import org.slf4j.Logger; |
| @@ -22,7 +22,7 @@ public class TopicJob { | @@ -22,7 +22,7 @@ public class TopicJob { | ||
| 22 | 22 | ||
| 23 | private static Logger logger = LoggerFactory.getLogger(TopicJob.class); | 23 | private static Logger logger = LoggerFactory.getLogger(TopicJob.class); |
| 24 | @Autowired | 24 | @Autowired |
| 25 | - TopicServiceImpl topicService; | 25 | + TopicService topicService; |
| 26 | @Autowired | 26 | @Autowired |
| 27 | InfoUtil infoUtil; | 27 | InfoUtil infoUtil; |
| 28 | @Value("${spring.localhost.url}") | 28 | @Value("${spring.localhost.url}") |
| @@ -33,7 +33,7 @@ public class TopicJob { | @@ -33,7 +33,7 @@ public class TopicJob { | ||
| 33 | ShyTopic shyTopic = new ShyTopic(); | 33 | ShyTopic shyTopic = new ShyTopic(); |
| 34 | shyTopic.setShenhe_status(CommonConst.AUDIT_INTT); | 34 | shyTopic.setShenhe_status(CommonConst.AUDIT_INTT); |
| 35 | shyTopic.setShenhe_type(CommonConst.AUDIT_TYPE_USER); | 35 | shyTopic.setShenhe_type(CommonConst.AUDIT_TYPE_USER); |
| 36 | - List<ShyTopic> shyTopicList = topicService.findshyTopic(shyTopic); | 36 | + List<ShyTopic> shyTopicList = topicService.findShyTopic(shyTopic); |
| 37 | if (shyTopicList != null && shyTopicList.size() > 0) { | 37 | if (shyTopicList != null && shyTopicList.size() > 0) { |
| 38 | logger.info("您有" + shyTopicList.size() + "条新的话题审核,请注意查看!"); | 38 | logger.info("您有" + shyTopicList.size() + "条新的话题审核,请注意查看!"); |
| 39 | // 设置Headless模式,linux系统下 | 39 | // 设置Headless模式,linux系统下 |
src/main/java/com/cnlive/shenhe/job/VideosJob.java
| 1 | package com.cnlive.shenhe.job; | 1 | package com.cnlive.shenhe.job; |
| 2 | 2 | ||
| 3 | import com.cnlive.shenhe.entity.ShyVideos; | 3 | import com.cnlive.shenhe.entity.ShyVideos; |
| 4 | -import com.cnlive.shenhe.service.serviceImpl.VideosServiceImpl; | 4 | +import com.cnlive.shenhe.service.VideosService; |
| 5 | import com.cnlive.shenhe.utils.CommonConst; | 5 | import com.cnlive.shenhe.utils.CommonConst; |
| 6 | import com.cnlive.shenhe.utils.CommonConstStates; | 6 | import com.cnlive.shenhe.utils.CommonConstStates; |
| 7 | import org.slf4j.Logger; | 7 | import org.slf4j.Logger; |
| @@ -22,7 +22,7 @@ public class VideosJob { | @@ -22,7 +22,7 @@ public class VideosJob { | ||
| 22 | 22 | ||
| 23 | private static Logger logger = LoggerFactory.getLogger(VideosJob.class); | 23 | private static Logger logger = LoggerFactory.getLogger(VideosJob.class); |
| 24 | @Autowired | 24 | @Autowired |
| 25 | - VideosServiceImpl videosService; | 25 | + VideosService videosService; |
| 26 | 26 | ||
| 27 | /** | 27 | /** |
| 28 | * 白名单sp视频通过 | 28 | * 白名单sp视频通过 |
| @@ -35,7 +35,7 @@ public class VideosJob { | @@ -35,7 +35,7 @@ public class VideosJob { | ||
| 35 | shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_FREE); | 35 | shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_FREE); |
| 36 | // 审核状态为未审核 | 36 | // 审核状态为未审核 |
| 37 | shyVideos.setState(CommonConst.AUDIT_INTT); | 37 | shyVideos.setState(CommonConst.AUDIT_INTT); |
| 38 | - List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideos); | 38 | + List<ShyVideos> shyVideosList = videosService.findShyVideo(shyVideos); |
| 39 | if (shyVideosList.size() > 0) { | 39 | if (shyVideosList.size() > 0) { |
| 40 | for (ShyVideos video : shyVideosList) { | 40 | for (ShyVideos video : shyVideosList) { |
| 41 | logger.info("当前白名单通过的videos_id:" + video.getId()); | 41 | logger.info("当前白名单通过的videos_id:" + video.getId()); |
| @@ -52,7 +52,7 @@ public class VideosJob { | @@ -52,7 +52,7 @@ public class VideosJob { | ||
| 52 | * 每天8点到23点执行,每分钟一次 | 52 | * 每天8点到23点执行,每分钟一次 |
| 53 | */ | 53 | */ |
| 54 | @Scheduled(cron = "0 0/3 8-23 * * ? ") | 54 | @Scheduled(cron = "0 0/3 8-23 * * ? ") |
| 55 | - public void videofilter() { | 55 | + public void videoFilter(){ |
| 56 | ShyVideos shyVideos = new ShyVideos(); | 56 | ShyVideos shyVideos = new ShyVideos(); |
| 57 | //审核类型为机审 | 57 | //审核类型为机审 |
| 58 | shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_MACHANE); | 58 | shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_MACHANE); |
| @@ -60,7 +60,7 @@ public class VideosJob { | @@ -60,7 +60,7 @@ public class VideosJob { | ||
| 60 | shyVideos.setState(CommonConst.AUDIT_INTT); | 60 | shyVideos.setState(CommonConst.AUDIT_INTT); |
| 61 | //抽帧完成 | 61 | //抽帧完成 |
| 62 | shyVideos.setAvsample(CommonConst.AVSAMPLE_SUCCESS); | 62 | shyVideos.setAvsample(CommonConst.AVSAMPLE_SUCCESS); |
| 63 | - List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideos); | 63 | + List<ShyVideos> shyVideosList = videosService.findShyVideo(shyVideos); |
| 64 | if (shyVideosList != null && shyVideosList.size() > 0) { | 64 | if (shyVideosList != null && shyVideosList.size() > 0) { |
| 65 | for (ShyVideos video : shyVideosList) { | 65 | for (ShyVideos video : shyVideosList) { |
| 66 | logger.info("定时向易盾发送检测视频的videos_id:{}", video.getId()); | 66 | logger.info("定时向易盾发送检测视频的videos_id:{}", video.getId()); |
| @@ -84,14 +84,14 @@ public class VideosJob { | @@ -84,14 +84,14 @@ public class VideosJob { | ||
| 84 | shyVideos.setState(CommonConst.AUDIT_INTT); | 84 | shyVideos.setState(CommonConst.AUDIT_INTT); |
| 85 | //已领取 | 85 | //已领取 |
| 86 | shyVideos.setReceive(CommonConst.RECEIVE_AFTER); | 86 | shyVideos.setReceive(CommonConst.RECEIVE_AFTER); |
| 87 | - List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideos); | 87 | + List<ShyVideos> shyVideosList = videosService.findShyVideo(shyVideos); |
| 88 | if (shyVideosList.size() > 0) { | 88 | if (shyVideosList.size() > 0) { |
| 89 | for (ShyVideos shyVideos2 : shyVideosList) { | 89 | for (ShyVideos shyVideos2 : shyVideosList) { |
| 90 | logger.info("自动退领的videos_id:" + shyVideos2.getId()); | 90 | logger.info("自动退领的videos_id:" + shyVideos2.getId()); |
| 91 | //未领取 | 91 | //未领取 |
| 92 | shyVideos2.setReceive(CommonConst.RECEIVE_BEFORE); | 92 | shyVideos2.setReceive(CommonConst.RECEIVE_BEFORE); |
| 93 | shyVideos2.setReceive_user_id(null); | 93 | shyVideos2.setReceive_user_id(null); |
| 94 | - videosService.updateshyVideos(shyVideos2); | 94 | + videosService.updateShyVideos(shyVideos2); |
| 95 | } | 95 | } |
| 96 | } | 96 | } |
| 97 | } | 97 | } |
src/main/java/com/cnlive/shenhe/job/YiDunUrlResultJob.java
| @@ -7,7 +7,7 @@ import com.cnlive.shenhe.entity.ShyYidun; | @@ -7,7 +7,7 @@ import com.cnlive.shenhe.entity.ShyYidun; | ||
| 7 | import com.cnlive.shenhe.enums.ImageLabels; | 7 | import com.cnlive.shenhe.enums.ImageLabels; |
| 8 | import com.cnlive.shenhe.enums.TextLabels; | 8 | import com.cnlive.shenhe.enums.TextLabels; |
| 9 | import com.cnlive.shenhe.service.ContentService; | 9 | import com.cnlive.shenhe.service.ContentService; |
| 10 | -import com.cnlive.shenhe.service.serviceImpl.YiDunServiceImpl; | 10 | +import com.cnlive.shenhe.service.YiDunService; |
| 11 | import com.cnlive.shenhe.utils.CommonConst; | 11 | import com.cnlive.shenhe.utils.CommonConst; |
| 12 | import com.cnlive.shenhe.utils.HttpClientUtils; | 12 | import com.cnlive.shenhe.utils.HttpClientUtils; |
| 13 | import com.cnlive.shenhe.utils.YiDunAntiFraudUtil; | 13 | import com.cnlive.shenhe.utils.YiDunAntiFraudUtil; |
| @@ -47,9 +47,9 @@ public class YiDunUrlResultJob { | @@ -47,9 +47,9 @@ public class YiDunUrlResultJob { | ||
| 47 | private final static String URL_RESULT = "https://as.dun.163yun.com/v1/crawler/callback/results"; | 47 | private final static String URL_RESULT = "https://as.dun.163yun.com/v1/crawler/callback/results"; |
| 48 | 48 | ||
| 49 | @Autowired | 49 | @Autowired |
| 50 | - YiDunServiceImpl yiDunServiceImpl; | 50 | + YiDunService yiDunService; |
| 51 | @Autowired | 51 | @Autowired |
| 52 | - ContentService contentServiceImpl; | 52 | + ContentService contentService; |
| 53 | 53 | ||
| 54 | 54 | ||
| 55 | /** | 55 | /** |
| @@ -88,7 +88,7 @@ public class YiDunUrlResultJob { | @@ -88,7 +88,7 @@ public class YiDunUrlResultJob { | ||
| 88 | try { | 88 | try { |
| 89 | JSONObject jsonObject = resultJsonArray.getJSONObject(i); | 89 | JSONObject jsonObject = resultJsonArray.getJSONObject(i); |
| 90 | String dataId = jsonObject.getString("dataId"); | 90 | String dataId = jsonObject.getString("dataId"); |
| 91 | - ShyYidun yiDunMsg = yiDunServiceImpl.getYiDunMsg(dataId); | 91 | + ShyYidun yiDunMsg = yiDunService.getYiDunMsg(dataId); |
| 92 | if (yiDunMsg == null) { | 92 | if (yiDunMsg == null) { |
| 93 | continue; | 93 | continue; |
| 94 | } | 94 | } |
| @@ -105,7 +105,7 @@ public class YiDunUrlResultJob { | @@ -105,7 +105,7 @@ public class YiDunUrlResultJob { | ||
| 105 | newYiDunMsg.setDesc_msg(desc.toString()); | 105 | newYiDunMsg.setDesc_msg(desc.toString()); |
| 106 | newYiDunMsg.setCheck_status(0); | 106 | newYiDunMsg.setCheck_status(0); |
| 107 | //修改图文状态 | 107 | //修改图文状态 |
| 108 | - contentServiceImpl.callback(String.valueOf(shyContent.getId()), desc.toString(), CommonConst.AUDIT_SUCCESS, "", shyContent.getUpdater()); | 108 | + contentService.callback(String.valueOf(shyContent.getId()), desc.toString(), CommonConst.AUDIT_SUCCESS, "", shyContent.getUpdater()); |
| 109 | logger.info("审核云结果回调业务对接方:dataId={}", dataId); | 109 | logger.info("审核云结果回调业务对接方:dataId={}", dataId); |
| 110 | } else { | 110 | } else { |
| 111 | JSONObject evidences = jsonObject.getJSONObject("evidences"); | 111 | JSONObject evidences = jsonObject.getJSONObject("evidences"); |
| @@ -178,7 +178,7 @@ public class YiDunUrlResultJob { | @@ -178,7 +178,7 @@ public class YiDunUrlResultJob { | ||
| 178 | newYiDunMsg.setDesc_msg(desc.toString()); | 178 | newYiDunMsg.setDesc_msg(desc.toString()); |
| 179 | newYiDunMsg.setCheck_status(2); | 179 | newYiDunMsg.setCheck_status(2); |
| 180 | //修改图文状态 | 180 | //修改图文状态 |
| 181 | - contentServiceImpl.callback(String.valueOf(shyContent.getId()), desc.toString(), CommonConst.AUDIT_REFUSE, "", shyContent.getUpdater()); | 181 | + contentService.callback(String.valueOf(shyContent.getId()), desc.toString(), CommonConst.AUDIT_REFUSE, "", shyContent.getUpdater()); |
| 182 | } | 182 | } |
| 183 | } catch (NumberFormatException e) { | 183 | } catch (NumberFormatException e) { |
| 184 | e.printStackTrace(); | 184 | e.printStackTrace(); |
| @@ -190,9 +190,9 @@ public class YiDunUrlResultJob { | @@ -190,9 +190,9 @@ public class YiDunUrlResultJob { | ||
| 190 | //拒绝原因 | 190 | //拒绝原因 |
| 191 | shyContent.setShenhe_msg("易盾网站识别其它问题需排查"); | 191 | shyContent.setShenhe_msg("易盾网站识别其它问题需排查"); |
| 192 | newYiDunMsg.setDesc_msg("易盾网站识别其它问题需排查"); | 192 | newYiDunMsg.setDesc_msg("易盾网站识别其它问题需排查"); |
| 193 | - contentServiceImpl.updateShyContent(shyContent); | 193 | + contentService.updateShyContent(shyContent); |
| 194 | } | 194 | } |
| 195 | - yiDunServiceImpl.updateYiDunMsg(newYiDunMsg); | 195 | + yiDunService.updateYiDunMsg(newYiDunMsg); |
| 196 | } | 196 | } |
| 197 | } | 197 | } |
| 198 | } | 198 | } |
src/main/java/com/cnlive/shenhe/service/TopicService.java
0 → 100644
| 1 | +package com.cnlive.shenhe.service; | ||
| 2 | + | ||
| 3 | +import com.cnlive.shenhe.dto.TopicDTO; | ||
| 4 | +import com.cnlive.shenhe.entity.ShyTopic; | ||
| 5 | +import com.github.pagehelper.PageInfo; | ||
| 6 | + | ||
| 7 | +import java.util.List; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * @Author: yan-zhao-wang | ||
| 11 | + * @DateTime: 2022-11-09 9:47 | ||
| 12 | + */ | ||
| 13 | +public interface TopicService { | ||
| 14 | + /** | ||
| 15 | + * 获取话题实体对象 | ||
| 16 | + * | ||
| 17 | + * @param shyTopic | ||
| 18 | + * @return | ||
| 19 | + */ | ||
| 20 | + ShyTopic getShyTopic(ShyTopic shyTopic); | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 根据条件获取话题列表集合 | ||
| 24 | + * | ||
| 25 | + * @param shyTopic | ||
| 26 | + * @return | ||
| 27 | + */ | ||
| 28 | + List<ShyTopic> findShyTopic(ShyTopic shyTopic); | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 修改话题 返回布尔类型 | ||
| 32 | + * | ||
| 33 | + * @param shyTopic | ||
| 34 | + * @return | ||
| 35 | + */ | ||
| 36 | + boolean updateShyTopic(ShyTopic shyTopic); | ||
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * 导入话题 返回布尔类型 | ||
| 40 | + * | ||
| 41 | + * @param shyTopic | ||
| 42 | + * @return | ||
| 43 | + */ | ||
| 44 | + boolean impotShyTopic(ShyTopic shyTopic); | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 分页、条件查询列表 | ||
| 48 | + * | ||
| 49 | + * @param topicDTO | ||
| 50 | + * @return | ||
| 51 | + */ | ||
| 52 | + PageInfo<ShyTopic> getPage(TopicDTO topicDTO); | ||
| 53 | + | ||
| 54 | + /** | ||
| 55 | + * 话题回调 | ||
| 56 | + * | ||
| 57 | + * @param id | ||
| 58 | + * @param msg | ||
| 59 | + * @param state | ||
| 60 | + * @param userId | ||
| 61 | + * @param updater | ||
| 62 | + * @return | ||
| 63 | + */ | ||
| 64 | + boolean callback(String id, String msg, Integer state, String userId, String updater); | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * 根据主键id查询话题对象 | ||
| 68 | + * | ||
| 69 | + * @param id | ||
| 70 | + * @return | ||
| 71 | + */ | ||
| 72 | + ShyTopic selectByPrimaryKey(Integer id); | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 根据主键修改话题对象 | ||
| 76 | + * | ||
| 77 | + * @param topic | ||
| 78 | + * @return | ||
| 79 | + */ | ||
| 80 | + int updateByPrimaryKeySelective(ShyTopic topic); | ||
| 81 | + | ||
| 82 | + /** | ||
| 83 | + * 获得审核类型 | ||
| 84 | + * | ||
| 85 | + * @param spId | ||
| 86 | + */ | ||
| 87 | + Integer getShenheType(Integer spId); | ||
| 88 | +} |
src/main/java/com/cnlive/shenhe/service/VideosService.java
0 → 100644
| 1 | +package com.cnlive.shenhe.service; | ||
| 2 | + | ||
| 3 | +import com.cnlive.shenhe.bean.ResponseBean; | ||
| 4 | +import com.cnlive.shenhe.dto.VideosDTO; | ||
| 5 | +import com.cnlive.shenhe.entity.ShyVideos; | ||
| 6 | +import com.github.pagehelper.PageInfo; | ||
| 7 | + | ||
| 8 | +import java.util.List; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * @Author: yan-zhao-wang | ||
| 12 | + * @DateTime: 2022-11-10 9:05 | ||
| 13 | + */ | ||
| 14 | +public interface VideosService { | ||
| 15 | + /** | ||
| 16 | + * 导入点播视频 返回布尔类型 | ||
| 17 | + * | ||
| 18 | + * @param shyVideos | ||
| 19 | + * @return | ||
| 20 | + */ | ||
| 21 | + boolean impotVideo(ShyVideos shyVideos); | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 根据主键id查询video对象 | ||
| 25 | + * | ||
| 26 | + * @param id | ||
| 27 | + * @return | ||
| 28 | + */ | ||
| 29 | + ShyVideos selectByPrimaryKey(Integer id); | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 根据对象查询 返回video列表集合 | ||
| 33 | + * | ||
| 34 | + * @param shyVideos | ||
| 35 | + * @return | ||
| 36 | + */ | ||
| 37 | + List<ShyVideos> findShyVideo(ShyVideos shyVideos); | ||
| 38 | + | ||
| 39 | + /** | ||
| 40 | + * 根据主键修改点播 返回布尔类型 | ||
| 41 | + * | ||
| 42 | + * @param shyVideos | ||
| 43 | + * @return | ||
| 44 | + */ | ||
| 45 | + boolean updateShyVideos(ShyVideos shyVideos); | ||
| 46 | + | ||
| 47 | + /** | ||
| 48 | + * 根据条件修改video 返回int类型 | ||
| 49 | + * | ||
| 50 | + * @param id | ||
| 51 | + * @param auditorId | ||
| 52 | + * @param updater | ||
| 53 | + * @param attrTags | ||
| 54 | + * @param state | ||
| 55 | + * @param msg | ||
| 56 | + * @return | ||
| 57 | + */ | ||
| 58 | + int updateVideo(Integer id, String auditorId, String updater, String attrTags, Integer state, String msg); | ||
| 59 | + | ||
| 60 | + /** | ||
| 61 | + * video分页、条件查询 返回列表集合 | ||
| 62 | + * | ||
| 63 | + * @param videosDTO | ||
| 64 | + * @return | ||
| 65 | + */ | ||
| 66 | + PageInfo<ShyVideos> getListVideo(VideosDTO videosDTO); | ||
| 67 | + | ||
| 68 | + /** | ||
| 69 | + * 获取video详情 | ||
| 70 | + * | ||
| 71 | + * @param id | ||
| 72 | + * @return | ||
| 73 | + */ | ||
| 74 | + ShyVideos getDetailsVideo(Integer id); | ||
| 75 | + | ||
| 76 | + /** | ||
| 77 | + * 认领video | ||
| 78 | + * | ||
| 79 | + * @param ids | ||
| 80 | + * @param num | ||
| 81 | + * @param userId | ||
| 82 | + * @param spid | ||
| 83 | + * @return | ||
| 84 | + */ | ||
| 85 | + Integer receive(String ids, Integer num, String userId, Integer spid); | ||
| 86 | + | ||
| 87 | + /** | ||
| 88 | + * 退领video | ||
| 89 | + * | ||
| 90 | + * @param ids | ||
| 91 | + * @param userId | ||
| 92 | + * @return | ||
| 93 | + */ | ||
| 94 | + ResponseBean retReceive(String ids, String userId); | ||
| 95 | + | ||
| 96 | + /** | ||
| 97 | + * 根据条件导出数据excel | ||
| 98 | + * | ||
| 99 | + * @param videosDTO | ||
| 100 | + * @return | ||
| 101 | + */ | ||
| 102 | + List<ShyVideos> findByCondition(VideosDTO videosDTO); | ||
| 103 | + | ||
| 104 | + /** | ||
| 105 | + * 易盾视频(图片)过滤 | ||
| 106 | + * type:1:文本 2:图片 3.网页 4:点播音频 | ||
| 107 | + * | ||
| 108 | + * @param cid 审核云中视频的id | ||
| 109 | + */ | ||
| 110 | + void videoFilter(Integer cid); | ||
| 111 | + | ||
| 112 | + /** | ||
| 113 | + * 更新点播和审核的视频状态 | ||
| 114 | + * | ||
| 115 | + * @param video | ||
| 116 | + * @param dianboState 视频状态,1通过,2不通过 | ||
| 117 | + */ | ||
| 118 | + void updateDianboAndShenhe(ShyVideos video, int dianboState); | ||
| 119 | + | ||
| 120 | + /** | ||
| 121 | + * 根据sp、栏目、用户id来判断审核类型 | ||
| 122 | + * | ||
| 123 | + * @param shyVideo | ||
| 124 | + */ | ||
| 125 | + void getShenheType(ShyVideos shyVideo); | ||
| 126 | + | ||
| 127 | + /** | ||
| 128 | + * 人工审核拒绝方法 | ||
| 129 | + * | ||
| 130 | + * @param shyVideoId | ||
| 131 | + * @param msg | ||
| 132 | + * @param userId | ||
| 133 | + * @param | ||
| 134 | + * @return | ||
| 135 | + */ | ||
| 136 | + String repulse(String shyVideoId, String msg, String userId); | ||
| 137 | +} |
src/main/java/com/cnlive/shenhe/service/YiDunService.java
0 → 100644
| 1 | +package com.cnlive.shenhe.service; | ||
| 2 | + | ||
| 3 | +import com.cnlive.shenhe.entity.ShyYidun; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * @Author: yan-zhao-wang | ||
| 7 | + * @DateTime: 2022-11-09 9:48 | ||
| 8 | + */ | ||
| 9 | +public interface YiDunService { | ||
| 10 | + /** | ||
| 11 | + * 添加易盾记录 | ||
| 12 | + * | ||
| 13 | + * @param shyYidun | ||
| 14 | + * @return | ||
| 15 | + */ | ||
| 16 | + boolean addYiDunMsg(ShyYidun shyYidun); | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * 根据主键id查询易盾对象 | ||
| 20 | + * | ||
| 21 | + * @param dataId | ||
| 22 | + * @return | ||
| 23 | + */ | ||
| 24 | + ShyYidun getYiDunMsg(String dataId); | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * 根据主键修改易盾对象 返回布尔类型 | ||
| 28 | + * | ||
| 29 | + * @param shyYidun | ||
| 30 | + * @return | ||
| 31 | + */ | ||
| 32 | + boolean updateYiDunMsg(ShyYidun shyYidun); | ||
| 33 | +} |
src/main/java/com/cnlive/shenhe/service/serviceImpl/AudioServiceImpl.java
| @@ -11,6 +11,7 @@ import com.cnlive.shenhe.mapper.ShyAudioMapper; | @@ -11,6 +11,7 @@ import com.cnlive.shenhe.mapper.ShyAudioMapper; | ||
| 11 | import com.cnlive.shenhe.mapper.ShyUsersMapper; | 11 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| 12 | import com.cnlive.shenhe.service.AudioService; | 12 | import com.cnlive.shenhe.service.AudioService; |
| 13 | import com.cnlive.shenhe.service.SitesService; | 13 | import com.cnlive.shenhe.service.SitesService; |
| 14 | +import com.cnlive.shenhe.service.YiDunService; | ||
| 14 | import com.cnlive.shenhe.utils.*; | 15 | import com.cnlive.shenhe.utils.*; |
| 15 | import com.github.pagehelper.PageHelper; | 16 | import com.github.pagehelper.PageHelper; |
| 16 | import com.github.pagehelper.PageInfo; | 17 | import com.github.pagehelper.PageInfo; |
| @@ -49,7 +50,7 @@ public class AudioServiceImpl implements AudioService { | @@ -49,7 +50,7 @@ public class AudioServiceImpl implements AudioService { | ||
| 49 | @Autowired | 50 | @Autowired |
| 50 | SitesService sitesService; | 51 | SitesService sitesService; |
| 51 | @Autowired | 52 | @Autowired |
| 52 | - YiDunServiceImpl yiDunServiceImpl; | 53 | + YiDunService yiDunService; |
| 53 | @Value("${yiDun_audio_callback}") | 54 | @Value("${yiDun_audio_callback}") |
| 54 | String yiDun_audio_callback; | 55 | String yiDun_audio_callback; |
| 55 | 56 | ||
| @@ -208,34 +209,34 @@ public class AudioServiceImpl implements AudioService { | @@ -208,34 +209,34 @@ public class AudioServiceImpl implements AudioService { | ||
| 208 | 209 | ||
| 209 | @Override | 210 | @Override |
| 210 | public String repulse(String shyAudioId, String msg, String userId) { | 211 | public String repulse(String shyAudioId, String msg, String userId) { |
| 211 | - String showMsg = ""; | 212 | + StringBuilder showMsg = new StringBuilder(); |
| 212 | ShyAudio shyAudio = audioService.selectByPrimaryKey(Integer.parseInt(shyAudioId)); | 213 | ShyAudio shyAudio = audioService.selectByPrimaryKey(Integer.parseInt(shyAudioId)); |
| 213 | JSONObject result; | 214 | JSONObject result; |
| 214 | try { | 215 | try { |
| 215 | result = pass.audioPass(shyAudio.getAudioId(), 4, msg, msg, shyAudio.getCallback()); | 216 | result = pass.audioPass(shyAudio.getAudioId(), 4, msg, msg, shyAudio.getCallback()); |
| 216 | } catch (Exception e) { | 217 | } catch (Exception e) { |
| 217 | logger.error("音频审核失败,id==" + shyAudioId, e); | 218 | logger.error("音频审核失败,id==" + shyAudioId, e); |
| 218 | - showMsg = showMsg + "," + shyAudio.getAudioTitle() + " 拒绝请求失败"; | ||
| 219 | - return showMsg; | 219 | + showMsg.append(",").append(shyAudio.getAudioTitle()).append(" 拒绝请求失败"); |
| 220 | + return showMsg.toString(); | ||
| 220 | } | 221 | } |
| 221 | if (result == null) { | 222 | if (result == null) { |
| 222 | logger.error("音频审核失败且接口错误没有返回信息,id==" + shyAudioId); | 223 | logger.error("音频审核失败且接口错误没有返回信息,id==" + shyAudioId); |
| 223 | - showMsg = showMsg + "," + shyAudio.getAudioTitle() + " 拒绝请求失败"; | ||
| 224 | - return showMsg; | 224 | + showMsg.append(",").append(shyAudio.getAudioTitle()).append(" 拒绝请求失败"); |
| 225 | + return showMsg.toString(); | ||
| 225 | } | 226 | } |
| 226 | Integer code = result.getInteger("code"); | 227 | Integer code = result.getInteger("code"); |
| 227 | if (code != 0) { | 228 | if (code != 0) { |
| 228 | logger.error("音频审核失败,id:{},code:{}", shyAudioId, code); | 229 | logger.error("音频审核失败,id:{},code:{}", shyAudioId, code); |
| 229 | - showMsg = showMsg + "," + shyAudio.getAudioTitle() + " " + result.getString("msg"); | ||
| 230 | - return showMsg; | 230 | + showMsg.append(",").append(shyAudio.getAudioTitle()).append(" ").append(result.getString("msg")); |
| 231 | + return showMsg.toString(); | ||
| 231 | } | 232 | } |
| 232 | //0.未审核,1:已审核,2.拒绝 | 233 | //0.未审核,1:已审核,2.拒绝 |
| 233 | int i = audioService.updateAudio(Integer.parseInt(shyAudioId), userId, null, "", 2, msg); | 234 | int i = audioService.updateAudio(Integer.parseInt(shyAudioId), userId, null, "", 2, msg); |
| 234 | if (i == 0) { | 235 | if (i == 0) { |
| 235 | - showMsg = showMsg + "," + shyAudio.getAudioTitle() + " 更新失败"; | ||
| 236 | - return showMsg; | 236 | + showMsg.append(",").append(shyAudio.getAudioTitle()).append(" 更新失败"); |
| 237 | + return showMsg.toString(); | ||
| 237 | } | 238 | } |
| 238 | - return showMsg; | 239 | + return showMsg.toString(); |
| 239 | } | 240 | } |
| 240 | 241 | ||
| 241 | /** | 242 | /** |
| @@ -431,7 +432,7 @@ public class AudioServiceImpl implements AudioService { | @@ -431,7 +432,7 @@ public class AudioServiceImpl implements AudioService { | ||
| 431 | shyYidun.setTask_id(taskId); | 432 | shyYidun.setTask_id(taskId); |
| 432 | shyYidun.setData_id(dataId); | 433 | shyYidun.setData_id(dataId); |
| 433 | shyYidun.setCheck_type(CommonConstStates.DIANBOYINPIN); | 434 | shyYidun.setCheck_type(CommonConstStates.DIANBOYINPIN); |
| 434 | - yiDunServiceImpl.addYiDunMsg(shyYidun); | 435 | + yiDunService.addYiDunMsg(shyYidun); |
| 435 | } | 436 | } |
| 436 | } | 437 | } |
| 437 | } | 438 | } |
src/main/java/com/cnlive/shenhe/service/serviceImpl/ContentServiceImpl.java
| @@ -8,6 +8,8 @@ import com.cnlive.shenhe.mapper.ShyContentMapper; | @@ -8,6 +8,8 @@ import com.cnlive.shenhe.mapper.ShyContentMapper; | ||
| 8 | import com.cnlive.shenhe.mapper.ShyUsersMapper; | 8 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| 9 | import com.cnlive.shenhe.service.ContentService; | 9 | import com.cnlive.shenhe.service.ContentService; |
| 10 | import com.cnlive.shenhe.service.SitesService; | 10 | import com.cnlive.shenhe.service.SitesService; |
| 11 | +import com.cnlive.shenhe.service.VideosService; | ||
| 12 | +import com.cnlive.shenhe.service.YiDunService; | ||
| 11 | import com.cnlive.shenhe.utils.*; | 13 | import com.cnlive.shenhe.utils.*; |
| 12 | import com.github.pagehelper.PageHelper; | 14 | import com.github.pagehelper.PageHelper; |
| 13 | import com.github.pagehelper.PageInfo; | 15 | import com.github.pagehelper.PageInfo; |
| @@ -40,9 +42,9 @@ public class ContentServiceImpl implements ContentService { | @@ -40,9 +42,9 @@ public class ContentServiceImpl implements ContentService { | ||
| 40 | @Autowired | 42 | @Autowired |
| 41 | SitesService sitesService; | 43 | SitesService sitesService; |
| 42 | @Autowired | 44 | @Autowired |
| 43 | - VideosServiceImpl videosService; | 45 | + VideosService videosService; |
| 44 | @Autowired | 46 | @Autowired |
| 45 | - YiDunServiceImpl yiDunServiceImpl; | 47 | + YiDunService yiDunService; |
| 46 | 48 | ||
| 47 | 49 | ||
| 48 | /** | 50 | /** |
| @@ -285,9 +287,9 @@ public class ContentServiceImpl implements ContentService { | @@ -285,9 +287,9 @@ public class ContentServiceImpl implements ContentService { | ||
| 285 | && state.equals(CommonConst.AUDIT_REFUSE)) { | 287 | && state.equals(CommonConst.AUDIT_REFUSE)) { |
| 286 | ShyVideos shyVideos1 = new ShyVideos(); | 288 | ShyVideos shyVideos1 = new ShyVideos(); |
| 287 | shyVideos1.setVideo_id(content.getVideo_id()); | 289 | shyVideos1.setVideo_id(content.getVideo_id()); |
| 288 | - List<ShyVideos> listshyVideos = videosService.findshyVideo(shyVideos1); | ||
| 289 | - if (listshyVideos.size() > 0) { | ||
| 290 | - ShyVideos shyVideos = listshyVideos.get(0); | 290 | + List<ShyVideos> listShyVideos = videosService.findShyVideo(shyVideos1); |
| 291 | + if (listShyVideos.size() > 0) { | ||
| 292 | + ShyVideos shyVideos = listShyVideos.get(0); | ||
| 291 | String showMsg = videosService.repulse(shyVideos.getId().toString(), msg, userId); | 293 | String showMsg = videosService.repulse(shyVideos.getId().toString(), msg, userId); |
| 292 | if (CommonUtils.isNotEmpty(showMsg)) { | 294 | if (CommonUtils.isNotEmpty(showMsg)) { |
| 293 | success = false; | 295 | success = false; |
| @@ -465,7 +467,7 @@ public class ContentServiceImpl implements ContentService { | @@ -465,7 +467,7 @@ public class ContentServiceImpl implements ContentService { | ||
| 465 | shyYidun.setContent_id(shyContent.getId().toString()); | 467 | shyYidun.setContent_id(shyContent.getId().toString()); |
| 466 | shyYidun.setCreate_time(new Date()); | 468 | shyYidun.setCreate_time(new Date()); |
| 467 | logger.info("审核云保存到ShyYidun表里数据:{}", JSON.toJSONString(shyYidun)); | 469 | logger.info("审核云保存到ShyYidun表里数据:{}", JSON.toJSONString(shyYidun)); |
| 468 | - yiDunServiceImpl.addYiDunMsg(shyYidun); | 470 | + yiDunService.addYiDunMsg(shyYidun); |
| 469 | } | 471 | } |
| 470 | } catch (Exception e) { | 472 | } catch (Exception e) { |
| 471 | e.printStackTrace(); | 473 | e.printStackTrace(); |
src/main/java/com/cnlive/shenhe/service/serviceImpl/TopicServiceImpl.java
| @@ -6,6 +6,7 @@ import com.cnlive.shenhe.dto.TopicDTO; | @@ -6,6 +6,7 @@ import com.cnlive.shenhe.dto.TopicDTO; | ||
| 6 | import com.cnlive.shenhe.entity.ShyTopic; | 6 | import com.cnlive.shenhe.entity.ShyTopic; |
| 7 | import com.cnlive.shenhe.mapper.ShyTopicMapper; | 7 | import com.cnlive.shenhe.mapper.ShyTopicMapper; |
| 8 | import com.cnlive.shenhe.service.SitesService; | 8 | import com.cnlive.shenhe.service.SitesService; |
| 9 | +import com.cnlive.shenhe.service.TopicService; | ||
| 9 | import com.cnlive.shenhe.utils.CommonConst; | 10 | import com.cnlive.shenhe.utils.CommonConst; |
| 10 | import com.cnlive.shenhe.utils.CommonUtils; | 11 | import com.cnlive.shenhe.utils.CommonUtils; |
| 11 | import com.cnlive.shenhe.utils.TransitServiceUtils; | 12 | import com.cnlive.shenhe.utils.TransitServiceUtils; |
| @@ -26,7 +27,7 @@ import java.util.List; | @@ -26,7 +27,7 @@ import java.util.List; | ||
| 26 | * @Description: | 27 | * @Description: |
| 27 | */ | 28 | */ |
| 28 | @Service | 29 | @Service |
| 29 | -public class TopicServiceImpl { | 30 | +public class TopicServiceImpl implements TopicService { |
| 30 | 31 | ||
| 31 | private static Logger logger = LoggerFactory.getLogger(TopicServiceImpl.class); | 32 | private static Logger logger = LoggerFactory.getLogger(TopicServiceImpl.class); |
| 32 | @Autowired | 33 | @Autowired |
| @@ -36,6 +37,13 @@ public class TopicServiceImpl { | @@ -36,6 +37,13 @@ public class TopicServiceImpl { | ||
| 36 | @Autowired | 37 | @Autowired |
| 37 | SitesService sitesService; | 38 | SitesService sitesService; |
| 38 | 39 | ||
| 40 | + /** | ||
| 41 | + * 获取话题实体对象 | ||
| 42 | + * | ||
| 43 | + * @param shyTopic | ||
| 44 | + * @return | ||
| 45 | + */ | ||
| 46 | + @Override | ||
| 39 | public ShyTopic getShyTopic(ShyTopic shyTopic) { | 47 | public ShyTopic getShyTopic(ShyTopic shyTopic) { |
| 40 | List<ShyTopic> shyTopicList = shyTopicMapper.select(shyTopic); | 48 | List<ShyTopic> shyTopicList = shyTopicMapper.select(shyTopic); |
| 41 | if (CommonUtils.isNotNull(shyTopicList) && shyTopicList.size() > 0) { | 49 | if (CommonUtils.isNotNull(shyTopicList) && shyTopicList.size() > 0) { |
| @@ -50,7 +58,8 @@ public class TopicServiceImpl { | @@ -50,7 +58,8 @@ public class TopicServiceImpl { | ||
| 50 | * @param shyTopic | 58 | * @param shyTopic |
| 51 | * @return | 59 | * @return |
| 52 | */ | 60 | */ |
| 53 | - public List<ShyTopic> findshyTopic(ShyTopic shyTopic) { | 61 | + @Override |
| 62 | + public List<ShyTopic> findShyTopic(ShyTopic shyTopic) { | ||
| 54 | return shyTopicMapper.selectByRowBounds(shyTopic, new RowBounds(0, 100)); | 63 | return shyTopicMapper.selectByRowBounds(shyTopic, new RowBounds(0, 100)); |
| 55 | } | 64 | } |
| 56 | 65 | ||
| @@ -60,7 +69,8 @@ public class TopicServiceImpl { | @@ -60,7 +69,8 @@ public class TopicServiceImpl { | ||
| 60 | * @param shyTopic | 69 | * @param shyTopic |
| 61 | * @return | 70 | * @return |
| 62 | */ | 71 | */ |
| 63 | - public boolean updateshyTopic(ShyTopic shyTopic) { | 72 | + @Override |
| 73 | + public boolean updateShyTopic(ShyTopic shyTopic) { | ||
| 64 | int result = shyTopicMapper.updateByPrimaryKey(shyTopic); | 74 | int result = shyTopicMapper.updateByPrimaryKey(shyTopic); |
| 65 | return result != 0; | 75 | return result != 0; |
| 66 | } | 76 | } |
| @@ -71,7 +81,8 @@ public class TopicServiceImpl { | @@ -71,7 +81,8 @@ public class TopicServiceImpl { | ||
| 71 | * @param shyTopic | 81 | * @param shyTopic |
| 72 | * @return | 82 | * @return |
| 73 | */ | 83 | */ |
| 74 | - public boolean impotshyTopic(ShyTopic shyTopic) { | 84 | + @Override |
| 85 | + public boolean impotShyTopic(ShyTopic shyTopic) { | ||
| 75 | int result = shyTopicMapper.insertSelective(shyTopic); | 86 | int result = shyTopicMapper.insertSelective(shyTopic); |
| 76 | return result != 0; | 87 | return result != 0; |
| 77 | } | 88 | } |
| @@ -82,6 +93,7 @@ public class TopicServiceImpl { | @@ -82,6 +93,7 @@ public class TopicServiceImpl { | ||
| 82 | * @param topicDTO | 93 | * @param topicDTO |
| 83 | * @return | 94 | * @return |
| 84 | */ | 95 | */ |
| 96 | + @Override | ||
| 85 | public PageInfo<ShyTopic> getPage(TopicDTO topicDTO) { | 97 | public PageInfo<ShyTopic> getPage(TopicDTO topicDTO) { |
| 86 | logger.info("接受参数列表为,TopicDTO:{}", JSON.toJSONString(topicDTO)); | 98 | logger.info("接受参数列表为,TopicDTO:{}", JSON.toJSONString(topicDTO)); |
| 87 | Example example = new Example(ShyTopic.class); | 99 | Example example = new Example(ShyTopic.class); |
| @@ -139,6 +151,7 @@ public class TopicServiceImpl { | @@ -139,6 +151,7 @@ public class TopicServiceImpl { | ||
| 139 | * @param updater | 151 | * @param updater |
| 140 | * @return | 152 | * @return |
| 141 | */ | 153 | */ |
| 154 | + @Override | ||
| 142 | public boolean callback(String id, String msg, Integer state, String userId, String updater) { | 155 | public boolean callback(String id, String msg, Integer state, String userId, String updater) { |
| 143 | boolean success; | 156 | boolean success; |
| 144 | ShyTopic topic = shyTopicMapper.selectByPrimaryKey(Integer.parseInt(id)); | 157 | ShyTopic topic = shyTopicMapper.selectByPrimaryKey(Integer.parseInt(id)); |
| @@ -178,6 +191,7 @@ public class TopicServiceImpl { | @@ -178,6 +191,7 @@ public class TopicServiceImpl { | ||
| 178 | * @param id | 191 | * @param id |
| 179 | * @return | 192 | * @return |
| 180 | */ | 193 | */ |
| 194 | + @Override | ||
| 181 | public ShyTopic selectByPrimaryKey(Integer id) { | 195 | public ShyTopic selectByPrimaryKey(Integer id) { |
| 182 | return shyTopicMapper.selectByPrimaryKey(id); | 196 | return shyTopicMapper.selectByPrimaryKey(id); |
| 183 | } | 197 | } |
| @@ -188,6 +202,7 @@ public class TopicServiceImpl { | @@ -188,6 +202,7 @@ public class TopicServiceImpl { | ||
| 188 | * @param topic | 202 | * @param topic |
| 189 | * @return | 203 | * @return |
| 190 | */ | 204 | */ |
| 205 | + @Override | ||
| 191 | public int updateByPrimaryKeySelective(ShyTopic topic) { | 206 | public int updateByPrimaryKeySelective(ShyTopic topic) { |
| 192 | return shyTopicMapper.updateByPrimaryKeySelective(topic); | 207 | return shyTopicMapper.updateByPrimaryKeySelective(topic); |
| 193 | } | 208 | } |
| @@ -197,6 +212,7 @@ public class TopicServiceImpl { | @@ -197,6 +212,7 @@ public class TopicServiceImpl { | ||
| 197 | * | 212 | * |
| 198 | * @param spId | 213 | * @param spId |
| 199 | */ | 214 | */ |
| 215 | + @Override | ||
| 200 | public Integer getShenheType(Integer spId) { | 216 | public Integer getShenheType(Integer spId) { |
| 201 | //获取图文免审sp | 217 | //获取图文免审sp |
| 202 | List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_TOPIC); | 218 | List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_TOPIC); |
src/main/java/com/cnlive/shenhe/service/serviceImpl/VideosServiceImpl.java
| @@ -12,9 +12,7 @@ import com.cnlive.shenhe.entity.ShyVideos; | @@ -12,9 +12,7 @@ import com.cnlive.shenhe.entity.ShyVideos; | ||
| 12 | import com.cnlive.shenhe.entity.ShyYidun; | 12 | import com.cnlive.shenhe.entity.ShyYidun; |
| 13 | import com.cnlive.shenhe.mapper.ShyUsersMapper; | 13 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| 14 | import com.cnlive.shenhe.mapper.ShyVideosMapper; | 14 | import com.cnlive.shenhe.mapper.ShyVideosMapper; |
| 15 | -import com.cnlive.shenhe.service.ShyActivityService; | ||
| 16 | -import com.cnlive.shenhe.service.SitesService; | ||
| 17 | -import com.cnlive.shenhe.service.UsersfreeService; | 15 | +import com.cnlive.shenhe.service.*; |
| 18 | import com.cnlive.shenhe.utils.*; | 16 | import com.cnlive.shenhe.utils.*; |
| 19 | import com.github.pagehelper.PageHelper; | 17 | import com.github.pagehelper.PageHelper; |
| 20 | import com.github.pagehelper.PageInfo; | 18 | import com.github.pagehelper.PageInfo; |
| @@ -33,12 +31,13 @@ import java.util.List; | @@ -33,12 +31,13 @@ import java.util.List; | ||
| 33 | import java.util.UUID; | 31 | import java.util.UUID; |
| 34 | 32 | ||
| 35 | /** | 33 | /** |
| 34 | + * @author Administrator | ||
| 36 | * @Auther: chenhao | 35 | * @Auther: chenhao |
| 37 | * @Date: 2018/11/30 14:23 | 36 | * @Date: 2018/11/30 14:23 |
| 38 | * @Description: | 37 | * @Description: |
| 39 | */ | 38 | */ |
| 40 | @Service | 39 | @Service |
| 41 | -public class VideosServiceImpl { | 40 | +public class VideosServiceImpl implements VideosService { |
| 42 | 41 | ||
| 43 | private static Logger logger = LoggerFactory.getLogger(VideosServiceImpl.class); | 42 | private static Logger logger = LoggerFactory.getLogger(VideosServiceImpl.class); |
| 44 | @Autowired | 43 | @Autowired |
| @@ -46,13 +45,13 @@ public class VideosServiceImpl { | @@ -46,13 +45,13 @@ public class VideosServiceImpl { | ||
| 46 | @Autowired | 45 | @Autowired |
| 47 | private ShyUsersMapper shyUsersMapper; | 46 | private ShyUsersMapper shyUsersMapper; |
| 48 | @Autowired | 47 | @Autowired |
| 49 | - private VideosServiceImpl videosService; | 48 | + private VideosService videosService; |
| 50 | @Autowired | 49 | @Autowired |
| 51 | private SitesService sitesService; | 50 | private SitesService sitesService; |
| 52 | @Autowired | 51 | @Autowired |
| 53 | private UsersfreeService usersfreeService; | 52 | private UsersfreeService usersfreeService; |
| 54 | @Autowired | 53 | @Autowired |
| 55 | - private YiDunServiceImpl yiDunServiceImpl; | 54 | + private YiDunService yiDunService; |
| 56 | @Autowired | 55 | @Autowired |
| 57 | private ShyActivityService shyActivityService; | 56 | private ShyActivityService shyActivityService; |
| 58 | @Value("${qn_domain}") | 57 | @Value("${qn_domain}") |
| @@ -68,6 +67,7 @@ public class VideosServiceImpl { | @@ -68,6 +67,7 @@ public class VideosServiceImpl { | ||
| 68 | * @param shyVideos | 67 | * @param shyVideos |
| 69 | * @return | 68 | * @return |
| 70 | */ | 69 | */ |
| 70 | + @Override | ||
| 71 | public boolean impotVideo(ShyVideos shyVideos) { | 71 | public boolean impotVideo(ShyVideos shyVideos) { |
| 72 | int result = shyVideosMapper.insertSelective(shyVideos); | 72 | int result = shyVideosMapper.insertSelective(shyVideos); |
| 73 | return result != 0; | 73 | return result != 0; |
| @@ -79,6 +79,7 @@ public class VideosServiceImpl { | @@ -79,6 +79,7 @@ public class VideosServiceImpl { | ||
| 79 | * @param id | 79 | * @param id |
| 80 | * @return | 80 | * @return |
| 81 | */ | 81 | */ |
| 82 | + @Override | ||
| 82 | public ShyVideos selectByPrimaryKey(Integer id) { | 83 | public ShyVideos selectByPrimaryKey(Integer id) { |
| 83 | return shyVideosMapper.selectByPrimaryKey(id); | 84 | return shyVideosMapper.selectByPrimaryKey(id); |
| 84 | } | 85 | } |
| @@ -89,7 +90,8 @@ public class VideosServiceImpl { | @@ -89,7 +90,8 @@ public class VideosServiceImpl { | ||
| 89 | * @param shyVideos | 90 | * @param shyVideos |
| 90 | * @return | 91 | * @return |
| 91 | */ | 92 | */ |
| 92 | - public List<ShyVideos> findshyVideo(ShyVideos shyVideos) { | 93 | + @Override |
| 94 | + public List<ShyVideos> findShyVideo(ShyVideos shyVideos) { | ||
| 93 | return shyVideosMapper.selectByRowBounds(shyVideos, new RowBounds(0, 100)); | 95 | return shyVideosMapper.selectByRowBounds(shyVideos, new RowBounds(0, 100)); |
| 94 | } | 96 | } |
| 95 | 97 | ||
| @@ -99,7 +101,8 @@ public class VideosServiceImpl { | @@ -99,7 +101,8 @@ public class VideosServiceImpl { | ||
| 99 | * @param shyVideos | 101 | * @param shyVideos |
| 100 | * @return | 102 | * @return |
| 101 | */ | 103 | */ |
| 102 | - public boolean updateshyVideos(ShyVideos shyVideos) { | 104 | + @Override |
| 105 | + public boolean updateShyVideos(ShyVideos shyVideos) { | ||
| 103 | int i = shyVideosMapper.updateByPrimaryKeySelective(shyVideos); | 106 | int i = shyVideosMapper.updateByPrimaryKeySelective(shyVideos); |
| 104 | return i != 0; | 107 | return i != 0; |
| 105 | } | 108 | } |
| @@ -115,6 +118,7 @@ public class VideosServiceImpl { | @@ -115,6 +118,7 @@ public class VideosServiceImpl { | ||
| 115 | * @param msg | 118 | * @param msg |
| 116 | * @return | 119 | * @return |
| 117 | */ | 120 | */ |
| 121 | + @Override | ||
| 118 | public int updateVideo(Integer id, String auditorId, String updater, String attrTags, Integer state, String msg) { | 122 | public int updateVideo(Integer id, String auditorId, String updater, String attrTags, Integer state, String msg) { |
| 119 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id); | 123 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id); |
| 120 | shyVideos.setAuditor_id(auditorId); | 124 | shyVideos.setAuditor_id(auditorId); |
| @@ -140,6 +144,7 @@ public class VideosServiceImpl { | @@ -140,6 +144,7 @@ public class VideosServiceImpl { | ||
| 140 | * @param videosDTO | 144 | * @param videosDTO |
| 141 | * @return | 145 | * @return |
| 142 | */ | 146 | */ |
| 147 | + @Override | ||
| 143 | public PageInfo<ShyVideos> getListVideo(VideosDTO videosDTO) { | 148 | public PageInfo<ShyVideos> getListVideo(VideosDTO videosDTO) { |
| 144 | logger.info("接受点播列表为,VideosDTO:{}", JSON.toJSONString(videosDTO)); | 149 | logger.info("接受点播列表为,VideosDTO:{}", JSON.toJSONString(videosDTO)); |
| 145 | Example example = new Example(ShyVideos.class); | 150 | Example example = new Example(ShyVideos.class); |
| @@ -224,6 +229,7 @@ public class VideosServiceImpl { | @@ -224,6 +229,7 @@ public class VideosServiceImpl { | ||
| 224 | * @param id | 229 | * @param id |
| 225 | * @return | 230 | * @return |
| 226 | */ | 231 | */ |
| 232 | + @Override | ||
| 227 | public ShyVideos getDetailsVideo(Integer id) { | 233 | public ShyVideos getDetailsVideo(Integer id) { |
| 228 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id); | 234 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id); |
| 229 | if (!shyVideos.getState().equals(CommonConst.AUDIT_INTT)) { | 235 | if (!shyVideos.getState().equals(CommonConst.AUDIT_INTT)) { |
| @@ -250,6 +256,7 @@ public class VideosServiceImpl { | @@ -250,6 +256,7 @@ public class VideosServiceImpl { | ||
| 250 | * @param spid | 256 | * @param spid |
| 251 | * @return | 257 | * @return |
| 252 | */ | 258 | */ |
| 259 | + @Override | ||
| 253 | public Integer receive(String ids, Integer num, String userId, Integer spid) { | 260 | public Integer receive(String ids, Integer num, String userId, Integer spid) { |
| 254 | Integer n = 0; | 261 | Integer n = 0; |
| 255 | if (CommonUtils.isNotEmpty(ids)) { | 262 | if (CommonUtils.isNotEmpty(ids)) { |
| @@ -291,6 +298,7 @@ public class VideosServiceImpl { | @@ -291,6 +298,7 @@ public class VideosServiceImpl { | ||
| 291 | * @param userId | 298 | * @param userId |
| 292 | * @return | 299 | * @return |
| 293 | */ | 300 | */ |
| 301 | + @Override | ||
| 294 | public ResponseBean retReceive(String ids, String userId) { | 302 | public ResponseBean retReceive(String ids, String userId) { |
| 295 | String[] cids = ids.split(","); | 303 | String[] cids = ids.split(","); |
| 296 | for (String cid : cids) { | 304 | for (String cid : cids) { |
| @@ -315,6 +323,7 @@ public class VideosServiceImpl { | @@ -315,6 +323,7 @@ public class VideosServiceImpl { | ||
| 315 | * @param videosDTO | 323 | * @param videosDTO |
| 316 | * @return | 324 | * @return |
| 317 | */ | 325 | */ |
| 326 | + @Override | ||
| 318 | public List<ShyVideos> findByCondition(VideosDTO videosDTO) { | 327 | public List<ShyVideos> findByCondition(VideosDTO videosDTO) { |
| 319 | Example example = new Example(ShyVideos.class); | 328 | Example example = new Example(ShyVideos.class); |
| 320 | Example.Criteria criteria = example.createCriteria(); | 329 | Example.Criteria criteria = example.createCriteria(); |
| @@ -368,6 +377,7 @@ public class VideosServiceImpl { | @@ -368,6 +377,7 @@ public class VideosServiceImpl { | ||
| 368 | * | 377 | * |
| 369 | * @param cid 审核云中视频的id | 378 | * @param cid 审核云中视频的id |
| 370 | */ | 379 | */ |
| 380 | + @Override | ||
| 371 | public void videoFilter(Integer cid) { | 381 | public void videoFilter(Integer cid) { |
| 372 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(cid); | 382 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(cid); |
| 373 | shyVideos.setUpdater("自动审核"); | 383 | shyVideos.setUpdater("自动审核"); |
| @@ -409,7 +419,7 @@ public class VideosServiceImpl { | @@ -409,7 +419,7 @@ public class VideosServiceImpl { | ||
| 409 | shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_USER); | 419 | shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_USER); |
| 410 | //拒绝原因 | 420 | //拒绝原因 |
| 411 | shyVideos.setMsg(desc); | 421 | shyVideos.setMsg(desc); |
| 412 | - boolean b = videosService.updateshyVideos(shyVideos); | 422 | + boolean b = videosService.updateShyVideos(shyVideos); |
| 413 | logger.info("进入拒绝方法:{},返回布尔类型{}", desc, b); | 423 | logger.info("进入拒绝方法:{},返回布尔类型{}", desc, b); |
| 414 | } | 424 | } |
| 415 | try { | 425 | try { |
| @@ -422,7 +432,7 @@ public class VideosServiceImpl { | @@ -422,7 +432,7 @@ public class VideosServiceImpl { | ||
| 422 | shyYidun.setCheck_type(CommonConstStates.TUPIAN); | 432 | shyYidun.setCheck_type(CommonConstStates.TUPIAN); |
| 423 | shyYidun.setDuration(shyVideos.getDuration()); | 433 | shyYidun.setDuration(shyVideos.getDuration()); |
| 424 | shyYidun.setCreate_time(new Date()); | 434 | shyYidun.setCreate_time(new Date()); |
| 425 | - yiDunServiceImpl.addYiDunMsg(shyYidun); | 435 | + yiDunService.addYiDunMsg(shyYidun); |
| 426 | } catch (Exception e) { | 436 | } catch (Exception e) { |
| 427 | e.printStackTrace(); | 437 | e.printStackTrace(); |
| 428 | } | 438 | } |
| @@ -434,6 +444,7 @@ public class VideosServiceImpl { | @@ -434,6 +444,7 @@ public class VideosServiceImpl { | ||
| 434 | * @param video | 444 | * @param video |
| 435 | * @param dianboState 视频状态,1通过,2不通过 | 445 | * @param dianboState 视频状态,1通过,2不通过 |
| 436 | */ | 446 | */ |
| 447 | + @Override | ||
| 437 | public void updateDianboAndShenhe(ShyVideos video, int dianboState) { | 448 | public void updateDianboAndShenhe(ShyVideos video, int dianboState) { |
| 438 | //修改点播云的视频状态 | 449 | //修改点播云的视频状态 |
| 439 | JSONObject result = pass.auditPass(video.getVideo_id(), dianboState, video.getMsg(), video.getMsg(), video.getCallback()); | 450 | JSONObject result = pass.auditPass(video.getVideo_id(), dianboState, video.getMsg(), video.getMsg(), video.getCallback()); |
| @@ -481,6 +492,7 @@ public class VideosServiceImpl { | @@ -481,6 +492,7 @@ public class VideosServiceImpl { | ||
| 481 | * | 492 | * |
| 482 | * @param shyVideo | 493 | * @param shyVideo |
| 483 | */ | 494 | */ |
| 495 | + @Override | ||
| 484 | public void getShenheType(ShyVideos shyVideo) { | 496 | public void getShenheType(ShyVideos shyVideo) { |
| 485 | //获取点播免审sp | 497 | //获取点播免审sp |
| 486 | List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_VIDEO); | 498 | List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_VIDEO); |
| @@ -535,34 +547,35 @@ public class VideosServiceImpl { | @@ -535,34 +547,35 @@ public class VideosServiceImpl { | ||
| 535 | * @param | 547 | * @param |
| 536 | * @return | 548 | * @return |
| 537 | */ | 549 | */ |
| 550 | + @Override | ||
| 538 | public String repulse(String shyVideoId, String msg, String userId) { | 551 | public String repulse(String shyVideoId, String msg, String userId) { |
| 539 | - String showMsg = ""; | 552 | + StringBuilder showMsg = new StringBuilder(); |
| 540 | ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(shyVideoId)); | 553 | ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(shyVideoId)); |
| 541 | JSONObject result; | 554 | JSONObject result; |
| 542 | try { | 555 | try { |
| 543 | result = pass.auditPass(shyVideos.getVideo_id(), 4, msg, msg, shyVideos.getCallback()); | 556 | result = pass.auditPass(shyVideos.getVideo_id(), 4, msg, msg, shyVideos.getCallback()); |
| 544 | } catch (Exception e) { | 557 | } catch (Exception e) { |
| 545 | logger.error("视频审核失败,id==" + shyVideoId, e); | 558 | logger.error("视频审核失败,id==" + shyVideoId, e); |
| 546 | - showMsg = showMsg + "," + shyVideos.getVideo_title() + " 拒绝请求失败"; | ||
| 547 | - return showMsg; | 559 | + showMsg.append(",").append(shyVideos.getVideo_title()).append(" 拒绝请求失败"); |
| 560 | + return showMsg.toString(); | ||
| 548 | } | 561 | } |
| 549 | if (result == null) { | 562 | if (result == null) { |
| 550 | logger.error("视频审核失败且接口错误没有返回信息,id==" + shyVideoId); | 563 | logger.error("视频审核失败且接口错误没有返回信息,id==" + shyVideoId); |
| 551 | - showMsg = showMsg + "," + shyVideos.getVideo_title() + " 拒绝请求失败"; | ||
| 552 | - return showMsg; | 564 | + showMsg.append(",").append(shyVideos.getVideo_title()).append(" 拒绝请求失败"); |
| 565 | + return showMsg.toString(); | ||
| 553 | } | 566 | } |
| 554 | Integer code = result.getInteger("code"); | 567 | Integer code = result.getInteger("code"); |
| 555 | if (code != 0) { | 568 | if (code != 0) { |
| 556 | logger.error("视频审核失败,id:{},code:{}", shyVideoId, code); | 569 | logger.error("视频审核失败,id:{},code:{}", shyVideoId, code); |
| 557 | - showMsg = showMsg + "," + shyVideos.getVideo_title() + " " + result.getString("msg"); | ||
| 558 | - return showMsg; | 570 | + showMsg.append(",").append(shyVideos.getVideo_title()).append(" ").append(result.getString("msg")); |
| 571 | + return showMsg.toString(); | ||
| 559 | } | 572 | } |
| 560 | int i = videosService.updateVideo(Integer.parseInt(shyVideoId), userId, null, "", 2, msg); | 573 | int i = videosService.updateVideo(Integer.parseInt(shyVideoId), userId, null, "", 2, msg); |
| 561 | if (i == 0) { | 574 | if (i == 0) { |
| 562 | - showMsg = showMsg + "," + shyVideos.getVideo_title() + " 更新失败"; | ||
| 563 | - return showMsg; | 575 | + showMsg.append(",").append(shyVideos.getVideo_title()).append(" 更新失败"); |
| 576 | + return showMsg.toString(); | ||
| 564 | } | 577 | } |
| 565 | - return showMsg; | 578 | + return showMsg.toString(); |
| 566 | } | 579 | } |
| 567 | 580 | ||
| 568 | } | 581 | } |
src/main/java/com/cnlive/shenhe/service/serviceImpl/YiDunServiceImpl.java
| @@ -3,6 +3,7 @@ package com.cnlive.shenhe.service.serviceImpl; | @@ -3,6 +3,7 @@ package com.cnlive.shenhe.service.serviceImpl; | ||
| 3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
| 4 | import com.cnlive.shenhe.entity.ShyYidun; | 4 | import com.cnlive.shenhe.entity.ShyYidun; |
| 5 | import com.cnlive.shenhe.mapper.ShyYidunMapper; | 5 | import com.cnlive.shenhe.mapper.ShyYidunMapper; |
| 6 | +import com.cnlive.shenhe.service.YiDunService; | ||
| 6 | import org.slf4j.Logger; | 7 | import org.slf4j.Logger; |
| 7 | import org.slf4j.LoggerFactory; | 8 | import org.slf4j.LoggerFactory; |
| 8 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -13,7 +14,7 @@ import org.springframework.stereotype.Service; | @@ -13,7 +14,7 @@ import org.springframework.stereotype.Service; | ||
| 13 | * @Date: 2020/3/27 17:31 | 14 | * @Date: 2020/3/27 17:31 |
| 14 | */ | 15 | */ |
| 15 | @Service | 16 | @Service |
| 16 | -public class YiDunServiceImpl { | 17 | +public class YiDunServiceImpl implements YiDunService { |
| 17 | 18 | ||
| 18 | private static Logger logger = LoggerFactory.getLogger(YiDunServiceImpl.class); | 19 | private static Logger logger = LoggerFactory.getLogger(YiDunServiceImpl.class); |
| 19 | 20 | ||
| @@ -26,13 +27,11 @@ public class YiDunServiceImpl { | @@ -26,13 +27,11 @@ public class YiDunServiceImpl { | ||
| 26 | * @param shyYidun | 27 | * @param shyYidun |
| 27 | * @return | 28 | * @return |
| 28 | */ | 29 | */ |
| 30 | + @Override | ||
| 29 | public boolean addYiDunMsg(ShyYidun shyYidun) { | 31 | public boolean addYiDunMsg(ShyYidun shyYidun) { |
| 30 | logger.info("URL:{}", JSON.toJSONString(shyYidun.getUrl())); | 32 | logger.info("URL:{}", JSON.toJSONString(shyYidun.getUrl())); |
| 31 | int result = shyYidunMapper.insert(shyYidun); | 33 | int result = shyYidunMapper.insert(shyYidun); |
| 32 | - if (result == 0) { | ||
| 33 | - return false; | ||
| 34 | - } | ||
| 35 | - return true; | 34 | + return result != 0; |
| 36 | } | 35 | } |
| 37 | 36 | ||
| 38 | /** | 37 | /** |
| @@ -41,6 +40,7 @@ public class YiDunServiceImpl { | @@ -41,6 +40,7 @@ public class YiDunServiceImpl { | ||
| 41 | * @param dataId | 40 | * @param dataId |
| 42 | * @return | 41 | * @return |
| 43 | */ | 42 | */ |
| 43 | + @Override | ||
| 44 | public ShyYidun getYiDunMsg(String dataId) { | 44 | public ShyYidun getYiDunMsg(String dataId) { |
| 45 | return shyYidunMapper.selectByPrimaryKey(dataId); | 45 | return shyYidunMapper.selectByPrimaryKey(dataId); |
| 46 | } | 46 | } |
| @@ -51,11 +51,9 @@ public class YiDunServiceImpl { | @@ -51,11 +51,9 @@ public class YiDunServiceImpl { | ||
| 51 | * @param shyYidun | 51 | * @param shyYidun |
| 52 | * @return | 52 | * @return |
| 53 | */ | 53 | */ |
| 54 | + @Override | ||
| 54 | public boolean updateYiDunMsg(ShyYidun shyYidun) { | 55 | public boolean updateYiDunMsg(ShyYidun shyYidun) { |
| 55 | int result = shyYidunMapper.updateByPrimaryKeySelective(shyYidun); | 56 | int result = shyYidunMapper.updateByPrimaryKeySelective(shyYidun); |
| 56 | - if (result == 0) { | ||
| 57 | - return false; | ||
| 58 | - } | ||
| 59 | - return true; | 57 | + return result != 0; |
| 60 | } | 58 | } |
| 61 | } | 59 | } |
src/main/java/com/cnlive/shenhe/utils/CommonUtils.java
| @@ -576,4 +576,16 @@ public class CommonUtils { | @@ -576,4 +576,16 @@ public class CommonUtils { | ||
| 576 | } | 576 | } |
| 577 | return dateTime; | 577 | return dateTime; |
| 578 | } | 578 | } |
| 579 | + | ||
| 580 | + /** | ||
| 581 | + * 获取直播、直播申请中的预计开始、结束时间 | ||
| 582 | + * | ||
| 583 | + * @return | ||
| 584 | + */ | ||
| 585 | + public static Date getStartAndEndTime(String preStartAndEndTime) { | ||
| 586 | + if (CommonUtils.isNotEmpty(preStartAndEndTime)) { | ||
| 587 | + return new Timestamp(Long.parseLong(preStartAndEndTime)); | ||
| 588 | + } | ||
| 589 | + return null; | ||
| 590 | + } | ||
| 579 | } | 591 | } |