Commit 7831ad1e8d5066ad3ce048af28725d6d6f3993e7

Authored by 王言钊
1 parent 8f62499f

开发话题、易盾云接口测试并优化代码

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/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/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
@@ -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")
@@ -275,37 +275,37 @@ public class LiveController extends BaseController { @@ -275,37 +275,37 @@ public class LiveController extends BaseController {
275 String userId = sessionUser.getUserId(); 275 String userId = sessionUser.getUserId();
276 ResponseBean responseBean = new ResponseBean(); 276 ResponseBean responseBean = new ResponseBean();
277 String[] shyLiveIds = ids.split(","); 277 String[] shyLiveIds = ids.split(",");
278 - String showMsg = ""; 278 + StringBuilder showMsg = new StringBuilder();
279 for (String shyLiveId : shyLiveIds) { 279 for (String shyLiveId : shyLiveIds) {
280 ShyLive shyLive = liveService.selectByPrimaryKey(Integer.parseInt(shyLiveId)); 280 ShyLive shyLive = liveService.selectByPrimaryKey(Integer.parseInt(shyLiveId));
281 - JSONObject result = null; 281 + JSONObject result;
282 try { 282 try {
283 result = pass.livePass(shyLive.getActivity_id(), status, msg, msg, shyLive.getCallback()); 283 result = pass.livePass(shyLive.getActivity_id(), status, msg, msg, shyLive.getCallback());
284 } catch (Exception e) { 284 } catch (Exception e) {
285 logger.error("直播视频审核失败,id==" + shyLiveId, e); 285 logger.error("直播视频审核失败,id==" + shyLiveId, e);
286 - showMsg = showMsg + "," + shyLive.getActivity_id() + " 拒绝请求失败"; 286 + showMsg.append(",").append(shyLive.getActivity_id()).append(" 拒绝请求失败");
287 break; 287 break;
288 } 288 }
289 if (result == null) { 289 if (result == null) {
290 logger.error("直播视频审核失败且接口错误没有返回信息,id==" + shyLiveId); 290 logger.error("直播视频审核失败且接口错误没有返回信息,id==" + shyLiveId);
291 - showMsg = showMsg + "," + shyLive.getActivity_id() + " 拒绝请求失败"; 291 + showMsg.append(",").append(shyLive.getActivity_id()).append(" 拒绝请求失败");
292 break; 292 break;
293 } 293 }
294 Integer code = result.getInteger("errorCode"); 294 Integer code = result.getInteger("errorCode");
295 if (code != 0) { 295 if (code != 0) {
296 logger.error("直播视频审核失败,id:{},code:{}", shyLiveId, code); 296 logger.error("直播视频审核失败,id:{},code:{}", shyLiveId, code);
297 - showMsg = showMsg + "," + shyLive.getActivity_id() + " " + result.getString(" errorMessage"); 297 + showMsg.append(",").append(shyLive.getActivity_id()).append(" ").append(result.getString(" errorMessage"));
298 break; 298 break;
299 } 299 }
300 int i = liveService.updateLive(Integer.parseInt(shyLiveId), userId, "", status == 3 ? 3 : 4, msg); 300 int i = liveService.updateLive(Integer.parseInt(shyLiveId), userId, "", status == 3 ? 3 : 4, msg);
301 if (i == 0) { 301 if (i == 0) {
302 - showMsg = showMsg + "," + shyLive.getActivity_id() + " 更新失败"; 302 + showMsg.append(",").append(shyLive.getActivity_id()).append(" 更新失败");
303 break; 303 break;
304 } 304 }
305 } 305 }
306 - if (CommonUtils.isNotEmpty(showMsg)) { 306 + if (CommonUtils.isNotEmpty(showMsg.toString())) {
307 responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); 307 responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode());
308 - responseBean.setErrorMessage(showMsg); 308 + responseBean.setErrorMessage(showMsg.toString());
309 } 309 }
310 return responseBean; 310 return responseBean;
311 } 311 }
@@ -323,36 +323,36 @@ public class LiveController extends BaseController { @@ -323,36 +323,36 @@ public class LiveController extends BaseController {
323 logger.info("同步直播云信息接口进入"); 323 logger.info("同步直播云信息接口进入");
324 ResponseBean responseBean = new ResponseBean(); 324 ResponseBean responseBean = new ResponseBean();
325 String[] shyLiveIds = ids.split(","); 325 String[] shyLiveIds = ids.split(",");
326 - String showMsg = ""; 326 + StringBuilder showMsg = new StringBuilder();
327 for (String shyLiveId : shyLiveIds) { 327 for (String shyLiveId : shyLiveIds) {
328 ShyLive shyLive = liveService.selectByPrimaryKey(Integer.parseInt(shyLiveId)); 328 ShyLive shyLive = liveService.selectByPrimaryKey(Integer.parseInt(shyLiveId));
329 - JSONObject result = null; 329 + JSONObject result;
330 try { 330 try {
331 result = pass.syncLive(shyLive.getActivity_id()); 331 result = pass.syncLive(shyLive.getActivity_id());
332 } catch (Exception e) { 332 } catch (Exception e) {
333 logger.error("直播云信息同步失败,id==" + shyLiveId, e); 333 logger.error("直播云信息同步失败,id==" + shyLiveId, e);
334 - showMsg = showMsg + "," + shyLive.getActivity_id() + " 拒绝请求失败"; 334 + showMsg.append(",").append(shyLive.getActivity_id()).append(" 拒绝请求失败");
335 break; 335 break;
336 } 336 }
337 if (result == null) { 337 if (result == null) {
338 logger.error("直播云信息同步失败且接口错误没有返回信息,id==" + shyLiveId); 338 logger.error("直播云信息同步失败且接口错误没有返回信息,id==" + shyLiveId);
339 - showMsg = showMsg + "," + shyLive.getActivity_id() + " 拒绝请求失败"; 339 + showMsg.append(",").append(shyLive.getActivity_id()).append(" 拒绝请求失败");
340 break; 340 break;
341 } 341 }
342 Integer code = result.getInteger("errorCode"); 342 Integer code = result.getInteger("errorCode");
343 if (code != 0) { 343 if (code != 0) {
344 logger.error("直播云信息同步失败,id:{},code:{}", shyLiveId, code); 344 logger.error("直播云信息同步失败,id:{},code:{}", shyLiveId, code);
345 - showMsg = result.getString("errorMessage"); 345 + showMsg.append(result.getString("errorMessage"));
346 break; 346 break;
347 } 347 }
348 } 348 }
349 - if (CommonUtils.isNotEmpty(showMsg)) { 349 + if (CommonUtils.isNotEmpty(showMsg.toString())) {
350 responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); 350 responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode());
351 - responseBean.setErrorMessage(showMsg); 351 + responseBean.setErrorMessage(showMsg.toString());
352 } else { 352 } else {
353 - showMsg = "直播云信息同步成功"; 353 + showMsg.append("直播云信息同步成功");
354 responseBean.setErrorCode(ErrorEnum.SUCCESS.getErrorCode()); 354 responseBean.setErrorCode(ErrorEnum.SUCCESS.getErrorCode());
355 - responseBean.setErrorMessage(showMsg); 355 + responseBean.setErrorMessage(showMsg.toString());
356 } 356 }
357 return responseBean; 357 return responseBean;
358 } 358 }
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
@@ -553,13 +553,13 @@ public class VideosController extends BaseController { @@ -553,13 +553,13 @@ public class VideosController extends BaseController {
553 String userId = sessionUser.getUserId(); 553 String userId = sessionUser.getUserId();
554 ResponseBean responseBean = new ResponseBean(); 554 ResponseBean responseBean = new ResponseBean();
555 String[] shyVideoIds = ids.split(","); 555 String[] shyVideoIds = ids.split(",");
556 - String showMsg = ""; 556 + StringBuilder showMsg = new StringBuilder();
557 for (String shyVideoId : shyVideoIds) { 557 for (String shyVideoId : shyVideoIds) {
558 - showMsg = videosService.repulse(shyVideoId, msg, userId); 558 + showMsg.append(videosService.repulse(shyVideoId, msg, userId));
559 } 559 }
560 - if (CommonUtils.isNotEmpty(showMsg)) { 560 + if (CommonUtils.isNotEmpty(showMsg.toString())) {
561 responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); 561 responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode());
562 - responseBean.setErrorMessage(showMsg); 562 + responseBean.setErrorMessage(showMsg.toString());
563 } 563 }
564 return responseBean; 564 return responseBean;
565 } 565 }
src/main/java/com/cnlive/shenhe/job/LiveApplyJob.java
@@ -100,7 +100,8 @@ public class LiveApplyJob { @@ -100,7 +100,8 @@ public class LiveApplyJob {
100 //初始化通知状态 100 //初始化通知状态
101 Integer noticeState = liveApply.getEmail_notice_state(); 101 Integer noticeState = liveApply.getEmail_notice_state();
102 //初始化通知消息 102 //初始化通知消息
103 - String noticeMsg = liveApply.getEmail_notice_msg(); 103 + //String noticeMsg = liveApply.getEmail_notice_msg();
  104 + StringBuilder noticeMsg = new StringBuilder(liveApply.getEmail_notice_msg());
104 //显示spid简称 105 //显示spid简称
105 ShySites shySites = sitesService.findspidDescByspid(liveApply.getSp_id()); 106 ShySites shySites = sitesService.findspidDescByspid(liveApply.getSp_id());
106 if (CommonUtils.isNotNull(shySites)) { 107 if (CommonUtils.isNotNull(shySites)) {
@@ -131,27 +132,27 @@ public class LiveApplyJob { @@ -131,27 +132,27 @@ public class LiveApplyJob {
131 JSONObject result = JSONObject.parseObject(post.get("result")); 132 JSONObject result = JSONObject.parseObject(post.get("result"));
132 if (result == null) { 133 if (result == null) {
133 noticeState = CommonConst.NOTICE_FAIL; 134 noticeState = CommonConst.NOTICE_FAIL;
134 - noticeMsg = noticeMsg + "\n" + dateTime + " 邮件服务器调用失败,result为空"; 135 + noticeMsg.append("\n").append(dateTime).append(" 邮件服务器调用失败,result为空");
135 break; 136 break;
136 } 137 }
137 Integer code = result.getInteger("errorCode"); 138 Integer code = result.getInteger("errorCode");
138 if (code != 0) { 139 if (code != 0) {
139 noticeState = CommonConst.NOTICE_FAIL; 140 noticeState = CommonConst.NOTICE_FAIL;
140 - noticeMsg = noticeMsg + "\n" + dateTime + " 邮件服务器调用失败,result返回消息为:" + result.getString("errorMessage"); 141 + noticeMsg.append("\n").append(dateTime).append(" 邮件服务器调用失败,result返回消息为:").append(result.getString("errorMessage"));
141 break; 142 break;
142 } else { 143 } else {
143 noticeState = CommonConst.NOTICE_SUCCESS; 144 noticeState = CommonConst.NOTICE_SUCCESS;
144 - noticeMsg = noticeMsg + "\n" + dateTime + " 邮件" + emailAddr + "(" + shyEmail.getRemark() + ")发送成功"; 145 + noticeMsg.append("\n").append(dateTime).append(" 邮件").append(emailAddr).append("(").append(shyEmail.getRemark()).append(")发送成功");
145 } 146 }
146 } catch (Exception e) { 147 } catch (Exception e) {
147 logger.info("异常结果为:{}", e.getMessage()); 148 logger.info("异常结果为:{}", e.getMessage());
148 noticeState = CommonConst.NOTICE_FAIL; 149 noticeState = CommonConst.NOTICE_FAIL;
149 - noticeMsg = noticeMsg + "\n" + dateTime + " 邮件服务器调用失败,服务器报错了"; 150 + noticeMsg.append("\n").append(dateTime).append(" 邮件服务器调用失败,服务器报错了");
150 break; 151 break;
151 } 152 }
152 } 153 }
153 liveApply.setEmail_notice_state(noticeState); 154 liveApply.setEmail_notice_state(noticeState);
154 - liveApply.setEmail_notice_msg(noticeMsg); 155 + liveApply.setEmail_notice_msg(noticeMsg.toString());
155 liveApplyService.updateShyLiveApply(liveApply); 156 liveApplyService.updateShyLiveApply(liveApply);
156 } 157 }
157 } 158 }
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/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/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,7 @@ import com.cnlive.shenhe.mapper.ShyContentMapper; @@ -8,6 +8,7 @@ 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.YiDunService;
11 import com.cnlive.shenhe.utils.*; 12 import com.cnlive.shenhe.utils.*;
12 import com.github.pagehelper.PageHelper; 13 import com.github.pagehelper.PageHelper;
13 import com.github.pagehelper.PageInfo; 14 import com.github.pagehelper.PageInfo;
@@ -42,7 +43,7 @@ public class ContentServiceImpl implements ContentService { @@ -42,7 +43,7 @@ public class ContentServiceImpl implements ContentService {
42 @Autowired 43 @Autowired
43 VideosServiceImpl videosService; 44 VideosServiceImpl videosService;
44 @Autowired 45 @Autowired
45 - YiDunServiceImpl yiDunServiceImpl; 46 + YiDunService yiDunService;
46 47
47 48
48 /** 49 /**
@@ -465,7 +466,7 @@ public class ContentServiceImpl implements ContentService { @@ -465,7 +466,7 @@ public class ContentServiceImpl implements ContentService {
465 shyYidun.setContent_id(shyContent.getId().toString()); 466 shyYidun.setContent_id(shyContent.getId().toString());
466 shyYidun.setCreate_time(new Date()); 467 shyYidun.setCreate_time(new Date());
467 logger.info("审核云保存到ShyYidun表里数据:{}", JSON.toJSONString(shyYidun)); 468 logger.info("审核云保存到ShyYidun表里数据:{}", JSON.toJSONString(shyYidun));
468 - yiDunServiceImpl.addYiDunMsg(shyYidun); 469 + yiDunService.addYiDunMsg(shyYidun);
469 } 470 }
470 } catch (Exception e) { 471 } catch (Exception e) {
471 e.printStackTrace(); 472 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
@@ -15,6 +15,7 @@ import com.cnlive.shenhe.mapper.ShyVideosMapper; @@ -15,6 +15,7 @@ import com.cnlive.shenhe.mapper.ShyVideosMapper;
15 import com.cnlive.shenhe.service.ShyActivityService; 15 import com.cnlive.shenhe.service.ShyActivityService;
16 import com.cnlive.shenhe.service.SitesService; 16 import com.cnlive.shenhe.service.SitesService;
17 import com.cnlive.shenhe.service.UsersfreeService; 17 import com.cnlive.shenhe.service.UsersfreeService;
  18 +import com.cnlive.shenhe.service.YiDunService;
18 import com.cnlive.shenhe.utils.*; 19 import com.cnlive.shenhe.utils.*;
19 import com.github.pagehelper.PageHelper; 20 import com.github.pagehelper.PageHelper;
20 import com.github.pagehelper.PageInfo; 21 import com.github.pagehelper.PageInfo;
@@ -52,7 +53,7 @@ public class VideosServiceImpl { @@ -52,7 +53,7 @@ public class VideosServiceImpl {
52 @Autowired 53 @Autowired
53 private UsersfreeService usersfreeService; 54 private UsersfreeService usersfreeService;
54 @Autowired 55 @Autowired
55 - private YiDunServiceImpl yiDunServiceImpl; 56 + private YiDunService yiDunService;
56 @Autowired 57 @Autowired
57 private ShyActivityService shyActivityService; 58 private ShyActivityService shyActivityService;
58 @Value("${qn_domain}") 59 @Value("${qn_domain}")
@@ -422,7 +423,7 @@ public class VideosServiceImpl { @@ -422,7 +423,7 @@ public class VideosServiceImpl {
422 shyYidun.setCheck_type(CommonConstStates.TUPIAN); 423 shyYidun.setCheck_type(CommonConstStates.TUPIAN);
423 shyYidun.setDuration(shyVideos.getDuration()); 424 shyYidun.setDuration(shyVideos.getDuration());
424 shyYidun.setCreate_time(new Date()); 425 shyYidun.setCreate_time(new Date());
425 - yiDunServiceImpl.addYiDunMsg(shyYidun); 426 + yiDunService.addYiDunMsg(shyYidun);
426 } catch (Exception e) { 427 } catch (Exception e) {
427 e.printStackTrace(); 428 e.printStackTrace();
428 } 429 }
@@ -536,33 +537,33 @@ public class VideosServiceImpl { @@ -536,33 +537,33 @@ public class VideosServiceImpl {
536 * @return 537 * @return
537 */ 538 */
538 public String repulse(String shyVideoId, String msg, String userId) { 539 public String repulse(String shyVideoId, String msg, String userId) {
539 - String showMsg = ""; 540 + StringBuilder showMsg = new StringBuilder();
540 ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(shyVideoId)); 541 ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(shyVideoId));
541 JSONObject result; 542 JSONObject result;
542 try { 543 try {
543 result = pass.auditPass(shyVideos.getVideo_id(), 4, msg, msg, shyVideos.getCallback()); 544 result = pass.auditPass(shyVideos.getVideo_id(), 4, msg, msg, shyVideos.getCallback());
544 } catch (Exception e) { 545 } catch (Exception e) {
545 logger.error("视频审核失败,id==" + shyVideoId, e); 546 logger.error("视频审核失败,id==" + shyVideoId, e);
546 - showMsg = showMsg + "," + shyVideos.getVideo_title() + " 拒绝请求失败";  
547 - return showMsg; 547 + showMsg.append(",").append(shyVideos.getVideo_title()).append(" 拒绝请求失败");
  548 + return showMsg.toString();
548 } 549 }
549 if (result == null) { 550 if (result == null) {
550 logger.error("视频审核失败且接口错误没有返回信息,id==" + shyVideoId); 551 logger.error("视频审核失败且接口错误没有返回信息,id==" + shyVideoId);
551 - showMsg = showMsg + "," + shyVideos.getVideo_title() + " 拒绝请求失败";  
552 - return showMsg; 552 + showMsg.append(",").append(shyVideos.getVideo_title()).append(" 拒绝请求失败");
  553 + return showMsg.toString();
553 } 554 }
554 Integer code = result.getInteger("code"); 555 Integer code = result.getInteger("code");
555 if (code != 0) { 556 if (code != 0) {
556 logger.error("视频审核失败,id:{},code:{}", shyVideoId, code); 557 logger.error("视频审核失败,id:{},code:{}", shyVideoId, code);
557 - showMsg = showMsg + "," + shyVideos.getVideo_title() + " " + result.getString("msg");  
558 - return showMsg; 558 + showMsg.append(",").append(shyVideos.getVideo_title()).append(" ").append(result.getString("msg"));
  559 + return showMsg.toString();
559 } 560 }
560 int i = videosService.updateVideo(Integer.parseInt(shyVideoId), userId, null, "", 2, msg); 561 int i = videosService.updateVideo(Integer.parseInt(shyVideoId), userId, null, "", 2, msg);
561 if (i == 0) { 562 if (i == 0) {
562 - showMsg = showMsg + "," + shyVideos.getVideo_title() + " 更新失败";  
563 - return showMsg; 563 + showMsg.append(",").append(shyVideos.getVideo_title()).append(" 更新失败");
  564 + return showMsg.toString();
564 } 565 }
565 - return showMsg; 566 + return showMsg.toString();
566 } 567 }
567 568
568 } 569 }
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 }