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