Commit 90ec071efa49a1cc5b7daef574bdd570d5687c39
1 parent
64638111
开发禁言、白名单接口并优化代码
Showing
25 changed files
with
417 additions
and
357 deletions
src/main/java/com/cnlive/shenhe/controller/AudioController.java
| ... | ... | @@ -10,7 +10,7 @@ import com.cnlive.shenhe.entity.ShyAudio; |
| 10 | 10 | import com.cnlive.shenhe.entity.ShySites; |
| 11 | 11 | import com.cnlive.shenhe.entity.ShyUsers; |
| 12 | 12 | import com.cnlive.shenhe.service.AudioService; |
| 13 | -import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; | |
| 13 | +import com.cnlive.shenhe.service.SitesService; | |
| 14 | 14 | import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; |
| 15 | 15 | import com.cnlive.shenhe.utils.AuditPass; |
| 16 | 16 | import com.cnlive.shenhe.utils.CommonConst; |
| ... | ... | @@ -48,7 +48,7 @@ public class AudioController extends BaseController { |
| 48 | 48 | private static Logger logger = LoggerFactory.getLogger(AudioController.class); |
| 49 | 49 | |
| 50 | 50 | @Autowired |
| 51 | - SitesServiceImpl sitesService; | |
| 51 | + SitesService sitesService; | |
| 52 | 52 | |
| 53 | 53 | @Autowired |
| 54 | 54 | AudioService audioService; |
| ... | ... | @@ -113,8 +113,7 @@ public class AudioController extends BaseController { |
| 113 | 113 | user = usersService.select(user); |
| 114 | 114 | if (CommonUtils.isNotNull(user)) { |
| 115 | 115 | String email = CommonUtils.isEmpty(user.getEmail()) ? "" : user.getEmail(); |
| 116 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 117 | - updater = userName; | |
| 116 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 118 | 117 | } |
| 119 | 118 | } |
| 120 | 119 | shyAudio.setUploader(updater); |
| ... | ... | @@ -345,8 +344,7 @@ public class AudioController extends BaseController { |
| 345 | 344 | user = usersService.select(user); |
| 346 | 345 | if (CommonUtils.isNotNull(user)) { |
| 347 | 346 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 348 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 349 | - updater = userName; | |
| 347 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 350 | 348 | } |
| 351 | 349 | } |
| 352 | 350 | } |
| ... | ... | @@ -385,7 +383,6 @@ public class AudioController extends BaseController { |
| 385 | 383 | ShySites shySites = sitesService.findspidDescByspid(shyAudioList.get(i).getSpId()); |
| 386 | 384 | cell.setCellValue(shySites.getName()); |
| 387 | 385 | } |
| 388 | - | |
| 389 | 386 | ByteArrayOutputStream os = new ByteArrayOutputStream(); |
| 390 | 387 | wb.write(os); |
| 391 | 388 | byte[] content = os.toByteArray(); |
| ... | ... | @@ -430,20 +427,20 @@ public class AudioController extends BaseController { |
| 430 | 427 | /** |
| 431 | 428 | * 审核结果更新并通知点播音频 |
| 432 | 429 | * |
| 433 | - * @param activity_id 音频id(audioId) | |
| 434 | - * @param state 状态码 | |
| 435 | - * @param attr_tags 常用审核意见(标签) | |
| 436 | - * @param msg 审核备注 | |
| 430 | + * @param activityId 音频id(audioId) | |
| 431 | + * @param state 状态码 | |
| 432 | + * @param attrTags 常用审核意见(标签) | |
| 433 | + * @param msg 审核备注 | |
| 437 | 434 | * @return |
| 438 | 435 | */ |
| 439 | 436 | @PostMapping("/shenheAudio") |
| 440 | 437 | @ResponseBody |
| 441 | - public ResponseBean shenheInfo(Integer id, String activity_id, Integer state, String attr_tags, String msg, String callback, HttpSession session) { | |
| 438 | + public ResponseBean shenheInfo(Integer id, String activityId, Integer state, String attrTags, String msg, String callback, HttpSession session) { | |
| 442 | 439 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 443 | 440 | String userId = sessionUser.getUserId(); |
| 444 | 441 | JSONObject result; |
| 445 | 442 | try { |
| 446 | - result = pass.audioPass(activity_id, state, attr_tags, msg, callback); | |
| 443 | + result = pass.audioPass(activityId, state, attrTags, msg, callback); | |
| 447 | 444 | } catch (Exception e) { |
| 448 | 445 | e.printStackTrace(); |
| 449 | 446 | System.out.println("音频审核失败"); |
| ... | ... | @@ -459,7 +456,7 @@ public class AudioController extends BaseController { |
| 459 | 456 | return new ResponseBean(code, result.getString("msg")); |
| 460 | 457 | } |
| 461 | 458 | state = state == 4 ? 2 : 1; |
| 462 | - int i = audioService.updateAudio(id, userId, null, attr_tags, state, msg); | |
| 459 | + int i = audioService.updateAudio(id, userId, null, attrTags, state, msg); | |
| 463 | 460 | if (i == 0) { |
| 464 | 461 | return new ResponseBean(ErrorEnum.ERROR); |
| 465 | 462 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/ChannelController.java
| ... | ... | @@ -10,7 +10,7 @@ import com.cnlive.shenhe.entity.ShyChannel; |
| 10 | 10 | import com.cnlive.shenhe.entity.ShySites; |
| 11 | 11 | import com.cnlive.shenhe.entity.ShyUsers; |
| 12 | 12 | import com.cnlive.shenhe.service.ChannelService; |
| 13 | -import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; | |
| 13 | +import com.cnlive.shenhe.service.SitesService; | |
| 14 | 14 | import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; |
| 15 | 15 | import com.cnlive.shenhe.utils.AuditPass; |
| 16 | 16 | import com.cnlive.shenhe.utils.CommonConst; |
| ... | ... | @@ -48,7 +48,7 @@ public class ChannelController extends BaseController { |
| 48 | 48 | UsersServiceImpl usersService; |
| 49 | 49 | |
| 50 | 50 | @Autowired |
| 51 | - SitesServiceImpl sitesService; | |
| 51 | + SitesService sitesService; | |
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * 频道列表页 |
| ... | ... | @@ -106,8 +106,7 @@ public class ChannelController extends BaseController { |
| 106 | 106 | user = usersService.select(user); |
| 107 | 107 | if (CommonUtils.isNotNull(user)) { |
| 108 | 108 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 109 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 110 | - updater = userName; | |
| 109 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 111 | 110 | } |
| 112 | 111 | } |
| 113 | 112 | channel.setUpdater(updater); | ... | ... |
src/main/java/com/cnlive/shenhe/controller/CommentsController.java
| ... | ... | @@ -12,7 +12,7 @@ import com.cnlive.shenhe.entity.ShySites; |
| 12 | 12 | import com.cnlive.shenhe.entity.ShyUsers; |
| 13 | 13 | import com.cnlive.shenhe.service.CommentsService; |
| 14 | 14 | import com.cnlive.shenhe.service.ContentService; |
| 15 | -import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; | |
| 15 | +import com.cnlive.shenhe.service.SitesService; | |
| 16 | 16 | import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; |
| 17 | 17 | import com.cnlive.shenhe.utils.AuditPass; |
| 18 | 18 | import com.cnlive.shenhe.utils.CommonConst; |
| ... | ... | @@ -49,7 +49,7 @@ public class CommentsController extends BaseController { |
| 49 | 49 | UsersServiceImpl usersService; |
| 50 | 50 | |
| 51 | 51 | @Autowired |
| 52 | - SitesServiceImpl sitesService; | |
| 52 | + SitesService sitesService; | |
| 53 | 53 | @Autowired |
| 54 | 54 | ContentService contentService; |
| 55 | 55 | |
| ... | ... | @@ -99,8 +99,7 @@ public class CommentsController extends BaseController { |
| 99 | 99 | user = usersService.select(user); |
| 100 | 100 | if (CommonUtils.isNotNull(user)) { |
| 101 | 101 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 102 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 103 | - updater = userName; | |
| 102 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 104 | 103 | } |
| 105 | 104 | } |
| 106 | 105 | comment.setUpdater(updater); |
| ... | ... | @@ -128,14 +127,12 @@ public class CommentsController extends BaseController { |
| 128 | 127 | comment.setComment_original_url(shyContent.getContent_url()); |
| 129 | 128 | } |
| 130 | 129 | } |
| 131 | - | |
| 132 | 130 | //评论的类型 |
| 133 | 131 | if (CommonConst.CATEGORY_TOPIC.equals(comment.getType())) { |
| 134 | 132 | comment.setType("话题"); |
| 135 | 133 | } else { |
| 136 | 134 | comment.setType("其他"); |
| 137 | 135 | } |
| 138 | - | |
| 139 | 136 | } |
| 140 | 137 | } |
| 141 | 138 | /* 获取参数值给前台 用来判断是否需要把查看显示出来 state recive*/ |
| ... | ... | @@ -435,8 +432,7 @@ public class CommentsController extends BaseController { |
| 435 | 432 | user = usersService.select(user); |
| 436 | 433 | if (CommonUtils.isNotNull(user)) { |
| 437 | 434 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 438 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 439 | - updater = userName; | |
| 435 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 440 | 436 | } |
| 441 | 437 | } |
| 442 | 438 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/ContentController.java
| ... | ... | @@ -9,7 +9,7 @@ import com.cnlive.shenhe.entity.ShyContent; |
| 9 | 9 | import com.cnlive.shenhe.entity.ShySites; |
| 10 | 10 | import com.cnlive.shenhe.entity.ShyUsers; |
| 11 | 11 | import com.cnlive.shenhe.service.ContentService; |
| 12 | -import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; | |
| 12 | +import com.cnlive.shenhe.service.SitesService; | |
| 13 | 13 | import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; |
| 14 | 14 | import com.cnlive.shenhe.utils.CommonConst; |
| 15 | 15 | import com.cnlive.shenhe.utils.CommonUtils; |
| ... | ... | @@ -42,7 +42,7 @@ public class ContentController extends BaseController { |
| 42 | 42 | @Autowired |
| 43 | 43 | ContentService contentService; |
| 44 | 44 | @Autowired |
| 45 | - SitesServiceImpl sitesService; | |
| 45 | + SitesService sitesService; | |
| 46 | 46 | |
| 47 | 47 | @Autowired |
| 48 | 48 | UsersServiceImpl usersService; |
| ... | ... | @@ -382,14 +382,12 @@ public class ContentController extends BaseController { |
| 382 | 382 | user = usersService.select(user); |
| 383 | 383 | if (CommonUtils.isNotNull(user)) { |
| 384 | 384 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 385 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 386 | - updater = userName; | |
| 385 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 387 | 386 | } |
| 388 | 387 | } |
| 389 | 388 | } |
| 390 | 389 | cell = row.createCell(10); |
| 391 | 390 | cell.setCellValue(updater); |
| 392 | - | |
| 393 | 391 | cell = row.createCell(11); |
| 394 | 392 | cell.setCellValue(contentList.get(i).getShenhe_msg()); |
| 395 | 393 | cell = row.createCell(12); |
| ... | ... | @@ -399,7 +397,6 @@ public class ContentController extends BaseController { |
| 399 | 397 | cell = row.createCell(14); |
| 400 | 398 | cell.setCellValue(contentList.get(i).getContent_url()); |
| 401 | 399 | } |
| 402 | - | |
| 403 | 400 | ByteArrayOutputStream os = new ByteArrayOutputStream(); |
| 404 | 401 | wb.write(os); |
| 405 | 402 | byte[] content = os.toByteArray(); | ... | ... |
src/main/java/com/cnlive/shenhe/controller/LiveApplyController.java
| ... | ... | @@ -11,7 +11,7 @@ import com.cnlive.shenhe.entity.ShySites; |
| 11 | 11 | import com.cnlive.shenhe.entity.ShyUsers; |
| 12 | 12 | import com.cnlive.shenhe.service.LiveApplyService; |
| 13 | 13 | import com.cnlive.shenhe.service.LiveService; |
| 14 | -import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; | |
| 14 | +import com.cnlive.shenhe.service.SitesService; | |
| 15 | 15 | import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; |
| 16 | 16 | import com.cnlive.shenhe.utils.AuditPass; |
| 17 | 17 | import com.cnlive.shenhe.utils.CommonConst; |
| ... | ... | @@ -52,7 +52,7 @@ public class LiveApplyController extends BaseController { |
| 52 | 52 | @Autowired |
| 53 | 53 | UsersServiceImpl usersService; |
| 54 | 54 | @Autowired |
| 55 | - SitesServiceImpl sitesService; | |
| 55 | + SitesService sitesService; | |
| 56 | 56 | @Autowired |
| 57 | 57 | LiveService liveService; |
| 58 | 58 | @Value("${spring.localhost.url}") |
| ... | ... | @@ -80,7 +80,7 @@ public class LiveApplyController extends BaseController { |
| 80 | 80 | String showMsg = ""; |
| 81 | 81 | for (String shyLiveApplyId : shyLiveApplyIds) { |
| 82 | 82 | ShyLiveapply shyLiveapply = liveApplyService.selectByPrimaryKey(Integer.parseInt(shyLiveApplyId)); |
| 83 | - JSONObject result = null; | |
| 83 | + JSONObject result; | |
| 84 | 84 | try { |
| 85 | 85 | result = pass.liveApplyPass(shyLiveapply.getActivity_id(), state + 2, msg, msg, shyLiveapply.getCallback()); |
| 86 | 86 | } catch (Exception e) { |
| ... | ... | @@ -154,8 +154,7 @@ public class LiveApplyController extends BaseController { |
| 154 | 154 | user = usersService.select(user); |
| 155 | 155 | if (CommonUtils.isNotNull(user)) { |
| 156 | 156 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 157 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 158 | - updater = userName; | |
| 157 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 159 | 158 | } |
| 160 | 159 | } |
| 161 | 160 | liveApply.setUpdater(updater); |
| ... | ... | @@ -186,15 +185,12 @@ public class LiveApplyController extends BaseController { |
| 186 | 185 | @GetMapping("/details") |
| 187 | 186 | public Object getDetailsLiveApply(Model model, Integer id) { |
| 188 | 187 | ShyLiveapply shyLiveapply = liveApplyService.getDetailsLiveApply(id); |
| 189 | - | |
| 190 | 188 | //显示spid简称 |
| 191 | 189 | ShySites shySites = sitesService.findspidDescByspid(shyLiveapply.getSp_id()); |
| 192 | 190 | if (CommonUtils.isNotNull(shySites)) { |
| 193 | 191 | shyLiveapply.setSpid_desc(shySites.getName()); |
| 194 | 192 | } |
| 195 | - | |
| 196 | 193 | model.addAttribute("shyLiveapply", shyLiveapply); |
| 197 | - | |
| 198 | 194 | return "page/liveApplyDetail.html"; |
| 199 | 195 | } |
| 200 | 196 | |
| ... | ... | @@ -223,7 +219,6 @@ public class LiveApplyController extends BaseController { |
| 223 | 219 | } |
| 224 | 220 | } else { |
| 225 | 221 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "您领取的内容不存在,请检查并重试"); |
| 226 | - | |
| 227 | 222 | } |
| 228 | 223 | } |
| 229 | 224 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/LiveController.java
| ... | ... | @@ -10,7 +10,7 @@ import com.cnlive.shenhe.entity.ShyLive; |
| 10 | 10 | import com.cnlive.shenhe.entity.ShySites; |
| 11 | 11 | import com.cnlive.shenhe.entity.ShyUsers; |
| 12 | 12 | import com.cnlive.shenhe.service.LiveService; |
| 13 | -import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; | |
| 13 | +import com.cnlive.shenhe.service.SitesService; | |
| 14 | 14 | import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; |
| 15 | 15 | import com.cnlive.shenhe.service.serviceImpl.VideosServiceImpl; |
| 16 | 16 | import com.cnlive.shenhe.utils.AuditPass; |
| ... | ... | @@ -55,7 +55,7 @@ public class LiveController extends BaseController { |
| 55 | 55 | @Autowired |
| 56 | 56 | UsersServiceImpl usersService; |
| 57 | 57 | @Autowired |
| 58 | - SitesServiceImpl sitesService; | |
| 58 | + SitesService sitesService; | |
| 59 | 59 | @Autowired |
| 60 | 60 | LiveService liveService; |
| 61 | 61 | |
| ... | ... | @@ -71,20 +71,20 @@ public class LiveController extends BaseController { |
| 71 | 71 | /** |
| 72 | 72 | * 审核信息返回接口 |
| 73 | 73 | * |
| 74 | - * @param activity_id 视频id | |
| 75 | - * @param state 状态码 | |
| 76 | - * @param attr_tags 标签 | |
| 77 | - * @param msg 备注信息 | |
| 74 | + * @param activityId 视频id | |
| 75 | + * @param state 状态码 | |
| 76 | + * @param attrTags 标签 | |
| 77 | + * @param msg 备注信息 | |
| 78 | 78 | * @return |
| 79 | 79 | */ |
| 80 | 80 | @PostMapping("/shenheVideo") |
| 81 | 81 | @ResponseBody |
| 82 | - public ResponseBean shenheInfo(Integer id, String activity_id, Integer state, String attr_tags, String msg, String callback, HttpSession session) { | |
| 82 | + public ResponseBean shenheInfo(Integer id, String activityId, Integer state, String attrTags, String msg, String callback, HttpSession session) { | |
| 83 | 83 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 84 | 84 | String userId = sessionUser.getUserId(); |
| 85 | 85 | JSONObject result = null; |
| 86 | 86 | try { |
| 87 | - result = pass.auditPass(activity_id, state, attr_tags, msg, callback); | |
| 87 | + result = pass.auditPass(activityId, state, attrTags, msg, callback); | |
| 88 | 88 | } catch (Exception e) { |
| 89 | 89 | e.printStackTrace(); |
| 90 | 90 | System.out.println("视频审核失败"); |
| ... | ... | @@ -100,7 +100,7 @@ public class LiveController extends BaseController { |
| 100 | 100 | return new ResponseBean(code, result.getString("msg")); |
| 101 | 101 | } |
| 102 | 102 | state = state == 4 ? 2 : 1; |
| 103 | - int i = videosService.updateVideo(id, userId, null, attr_tags, state, msg); | |
| 103 | + int i = videosService.updateVideo(id, userId, null, attrTags, state, msg); | |
| 104 | 104 | if (i == 0) { |
| 105 | 105 | return new ResponseBean(ErrorEnum.ERROR); |
| 106 | 106 | } |
| ... | ... | @@ -148,7 +148,6 @@ public class LiveController extends BaseController { |
| 148 | 148 | orderByClause = "is_hot desc, pre_start_time desc"; |
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | - | |
| 152 | 151 | if (CommonUtils.isNotNull(liveDTO.getContentId())) { |
| 153 | 152 | Map<String, String> map = new HashMap<>(1); |
| 154 | 153 | map.put("id", liveDTO.getContentId().toString()); |
| ... | ... | @@ -162,7 +161,6 @@ public class LiveController extends BaseController { |
| 162 | 161 | liveDTO.setActivity_id(String.valueOf(liveDTO.getContentId())); |
| 163 | 162 | } |
| 164 | 163 | } |
| 165 | - | |
| 166 | 164 | PageInfo<ShyLive> livePage = liveService.getListLive(liveDTO); |
| 167 | 165 | List<ShyLive> list = livePage.getList(); |
| 168 | 166 | if (!list.isEmpty()) { |
| ... | ... | @@ -195,15 +193,12 @@ public class LiveController extends BaseController { |
| 195 | 193 | @GetMapping("/details") |
| 196 | 194 | public Object getDetailsLive(Model model, Integer id) { |
| 197 | 195 | ShyLive live = liveService.getDetailsLive(id); |
| 198 | - | |
| 199 | 196 | //显示spid简称 |
| 200 | 197 | ShySites shySites = sitesService.findspidDescByspid(live.getSp_id()); |
| 201 | 198 | if (CommonUtils.isNotNull(shySites)) { |
| 202 | 199 | live.setSpid_desc(shySites.getName()); |
| 203 | 200 | } |
| 204 | - | |
| 205 | 201 | model.addAttribute("live", live); |
| 206 | - | |
| 207 | 202 | return "page/liveDetail.html"; |
| 208 | 203 | } |
| 209 | 204 | |
| ... | ... | @@ -320,12 +315,11 @@ public class LiveController extends BaseController { |
| 320 | 315 | * |
| 321 | 316 | * @param ids |
| 322 | 317 | * @param |
| 323 | - * @param session | |
| 324 | 318 | * @return |
| 325 | 319 | */ |
| 326 | 320 | @PostMapping("/syncLive") |
| 327 | 321 | @ResponseBody |
| 328 | - public ResponseBean syncLive(String ids, HttpSession session) { | |
| 322 | + public ResponseBean syncLive(String ids) { | |
| 329 | 323 | logger.info("同步直播云信息接口进入"); |
| 330 | 324 | ResponseBean responseBean = new ResponseBean(); |
| 331 | 325 | String[] shyLiveIds = ids.split(","); |
| ... | ... | @@ -470,8 +464,7 @@ public class LiveController extends BaseController { |
| 470 | 464 | user = usersService.select(user); |
| 471 | 465 | if (CommonUtils.isNotNull(user)) { |
| 472 | 466 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 473 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 474 | - updater = userName; | |
| 467 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 475 | 468 | } |
| 476 | 469 | } |
| 477 | 470 | } |
| ... | ... | @@ -496,21 +489,18 @@ public class LiveController extends BaseController { |
| 496 | 489 | } else if (activityCount > 0) { |
| 497 | 490 | activityEndTime = "跨" + activityCount + "天 " + CommonUtils.formatDate(liveList.get(i).getActivity_end_time(), "HH:mm"); |
| 498 | 491 | } |
| 499 | - | |
| 500 | 492 | cell = row.createCell(10);//列 |
| 501 | 493 | cell.setCellValue(activityEndTime); |
| 502 | 494 | cell = row.createCell(11);//时长 |
| 503 | 495 | /*时长需要处理成用户可读,单位:分钟*/ |
| 504 | 496 | long timeLength = (activityEnd - activityStart) / (60 * 1000); |
| 505 | 497 | cell.setCellValue(timeLength); |
| 506 | - | |
| 507 | 498 | cell = row.createCell(12);//列 |
| 508 | 499 | cell.setCellValue(""); |
| 509 | 500 | cell = row.createCell(13);//列 |
| 510 | 501 | cell.setCellValue(""); |
| 511 | 502 | } |
| 512 | 503 | } |
| 513 | - | |
| 514 | 504 | ByteArrayOutputStream os = new ByteArrayOutputStream(); |
| 515 | 505 | wb.write(os); |
| 516 | 506 | byte[] content = os.toByteArray(); | ... | ... |
src/main/java/com/cnlive/shenhe/controller/NotSpeakController.java
| ... | ... | @@ -8,7 +8,9 @@ import com.cnlive.shenhe.dto.NotSpeakDTO; |
| 8 | 8 | import com.cnlive.shenhe.entity.ShyNotspeak; |
| 9 | 9 | import com.cnlive.shenhe.entity.ShySites; |
| 10 | 10 | import com.cnlive.shenhe.entity.ShyUsers; |
| 11 | -import com.cnlive.shenhe.service.serviceImpl.*; | |
| 11 | +import com.cnlive.shenhe.service.NotspeakService; | |
| 12 | +import com.cnlive.shenhe.service.SitesService; | |
| 13 | +import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; | |
| 12 | 14 | import com.cnlive.shenhe.utils.CommonUtils; |
| 13 | 15 | import com.github.pagehelper.PageInfo; |
| 14 | 16 | import org.slf4j.Logger; |
| ... | ... | @@ -33,11 +35,11 @@ import java.util.List; |
| 33 | 35 | public class NotSpeakController extends BaseController { |
| 34 | 36 | private static Logger logger = LoggerFactory.getLogger(NotSpeakController.class); |
| 35 | 37 | @Autowired |
| 36 | - NotspeakServiceImpl notSpeakService; | |
| 38 | + NotspeakService notSpeakService; | |
| 37 | 39 | @Autowired |
| 38 | 40 | UsersServiceImpl usersService; |
| 39 | 41 | @Autowired |
| 40 | - SitesServiceImpl sitesService; | |
| 42 | + SitesService sitesService; | |
| 41 | 43 | |
| 42 | 44 | /** |
| 43 | 45 | * 禁言列表页 |
| ... | ... | @@ -67,8 +69,7 @@ public class NotSpeakController extends BaseController { |
| 67 | 69 | user = usersService.select(user); |
| 68 | 70 | if (CommonUtils.isNotNull(user)) { |
| 69 | 71 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 70 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 71 | - updater = userName; | |
| 72 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 72 | 73 | } |
| 73 | 74 | } |
| 74 | 75 | notspeak.setUpdater(updater); |
| ... | ... | @@ -105,8 +106,7 @@ public class NotSpeakController extends BaseController { |
| 105 | 106 | public ResponseBean notSpeakByComment(Integer commentId, Integer time, HttpSession session) { |
| 106 | 107 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 107 | 108 | String userId = sessionUser.getUserId(); |
| 108 | - ResponseBean success = notSpeakService.notSpeakByComment(commentId, time, userId); | |
| 109 | - return success; | |
| 109 | + return notSpeakService.notSpeakByComment(commentId, time, userId); | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |
| ... | ... | @@ -123,8 +123,7 @@ public class NotSpeakController extends BaseController { |
| 123 | 123 | public ResponseBean querySpeakState(Integer commentId, HttpSession session) { |
| 124 | 124 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 125 | 125 | String userId = sessionUser.getUserId(); |
| 126 | - ResponseBean success = notSpeakService.querySpeakState(commentId, userId); | |
| 127 | - return success; | |
| 126 | + return notSpeakService.querySpeakState(commentId, userId); | |
| 128 | 127 | } |
| 129 | 128 | |
| 130 | 129 | /** |
| ... | ... | @@ -141,7 +140,6 @@ public class NotSpeakController extends BaseController { |
| 141 | 140 | public ResponseBean speak(Integer notSpeakId, Integer type, Integer time, HttpSession session) { |
| 142 | 141 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 143 | 142 | String userId = sessionUser.getUserId(); |
| 144 | - ResponseBean success = notSpeakService.speak(notSpeakId, type, time, userId); | |
| 145 | - return success; | |
| 143 | + return notSpeakService.speak(notSpeakId, type, time, userId); | |
| 146 | 144 | } |
| 147 | 145 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/SitesController.java
| ... | ... | @@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject; |
| 5 | 5 | import com.cnlive.shenhe.bean.SessionUser; |
| 6 | 6 | import com.cnlive.shenhe.dto.SitesDTO; |
| 7 | 7 | import com.cnlive.shenhe.entity.ShySites; |
| 8 | -import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; | |
| 8 | +import com.cnlive.shenhe.service.SitesService; | |
| 9 | 9 | import com.cnlive.shenhe.utils.CommonConst; |
| 10 | 10 | import com.cnlive.shenhe.utils.CommonUtils; |
| 11 | 11 | import com.github.pagehelper.PageInfo; |
| ... | ... | @@ -34,7 +34,7 @@ public class SitesController extends BaseController { |
| 34 | 34 | private static Logger logger = LoggerFactory.getLogger(SitesController.class); |
| 35 | 35 | |
| 36 | 36 | @Autowired |
| 37 | - SitesServiceImpl sitesService; | |
| 37 | + SitesService sitesService; | |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * 站点白名单分页列表 |
| ... | ... | @@ -84,27 +84,26 @@ public class SitesController extends BaseController { |
| 84 | 84 | |
| 85 | 85 | |
| 86 | 86 | @PostMapping(value = "/write") |
| 87 | - public String write(Model model, Integer siteId, String[] write_business, HttpSession session, String redirect_url) { | |
| 87 | + public String write(Model model, Integer siteId, String[] writeBusiness, HttpSession session, String redirectUrl) { | |
| 88 | 88 | ShySites site = sitesService.get(siteId); |
| 89 | 89 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 90 | 90 | if (CommonUtils.isNull(sessionUser)) { |
| 91 | 91 | return "redirect:/users/login"; |
| 92 | 92 | } |
| 93 | - String write = ""; | |
| 94 | - if (CommonUtils.isNotNull(write_business) && write_business.length > 0) { | |
| 95 | - for (String w : write_business) { | |
| 96 | - write = write + "," + w; | |
| 93 | + StringBuilder write = new StringBuilder(); | |
| 94 | + if (CommonUtils.isNotNull(writeBusiness) && writeBusiness.length > 0) { | |
| 95 | + for (String w : writeBusiness) { | |
| 96 | + write.append(",").append(w); | |
| 97 | 97 | } |
| 98 | - write = write.substring(1); | |
| 98 | + write = new StringBuilder(write.substring(1)); | |
| 99 | 99 | } |
| 100 | - site.setWrite_business(write); | |
| 100 | + site.setWrite_business(write.toString()); | |
| 101 | 101 | boolean success = sitesService.update(site); |
| 102 | 102 | if (success) { |
| 103 | - return "redirect:" + redirect_url; | |
| 103 | + return "redirect:" + redirectUrl; | |
| 104 | 104 | } else { |
| 105 | 105 | setmodelResult(model); |
| 106 | 106 | return "error.html"; |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | - | |
| 110 | 109 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/TopicController.java
| ... | ... | @@ -7,7 +7,7 @@ import com.cnlive.shenhe.bean.SessionUser; |
| 7 | 7 | import com.cnlive.shenhe.dto.TopicDTO; |
| 8 | 8 | import com.cnlive.shenhe.entity.ShySites; |
| 9 | 9 | import com.cnlive.shenhe.entity.ShyTopic; |
| 10 | -import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; | |
| 10 | +import com.cnlive.shenhe.service.SitesService; | |
| 11 | 11 | import com.cnlive.shenhe.service.serviceImpl.TopicServiceImpl; |
| 12 | 12 | import com.cnlive.shenhe.utils.CommonConst; |
| 13 | 13 | import com.cnlive.shenhe.utils.CommonUtils; |
| ... | ... | @@ -40,7 +40,7 @@ public class TopicController extends BaseController { |
| 40 | 40 | @Autowired |
| 41 | 41 | TopicServiceImpl topicService; |
| 42 | 42 | @Autowired |
| 43 | - SitesServiceImpl sitesService; | |
| 43 | + SitesService sitesService; | |
| 44 | 44 | |
| 45 | 45 | @Value("${spring.localhost.url}") |
| 46 | 46 | private String localhost_url; |
| ... | ... | @@ -131,7 +131,7 @@ public class TopicController extends BaseController { |
| 131 | 131 | public ResponseBean pass(String ids, HttpSession session) { |
| 132 | 132 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 133 | 133 | String userId = sessionUser.getUserId(); |
| 134 | - boolean success = false; | |
| 134 | + boolean success; | |
| 135 | 135 | String[] topicIds = ids.split(","); |
| 136 | 136 | for (String id : topicIds) { |
| 137 | 137 | success = topicService.callback(id, "审核通过", CommonConst.AUDIT_SUCCESS, userId, ""); |
| ... | ... | @@ -153,7 +153,7 @@ public class TopicController extends BaseController { |
| 153 | 153 | public ResponseBean refuse(String ids, String msg, HttpSession session) { |
| 154 | 154 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 155 | 155 | String userId = sessionUser.getUserId(); |
| 156 | - boolean success = false; | |
| 156 | + boolean success; | |
| 157 | 157 | String[] contentIds = ids.split(","); |
| 158 | 158 | for (String id : contentIds) { |
| 159 | 159 | success = topicService.callback(id, msg, CommonConst.AUDIT_REFUSE, userId, ""); | ... | ... |
src/main/java/com/cnlive/shenhe/controller/UsersController.java
| ... | ... | @@ -8,7 +8,7 @@ import com.cnlive.shenhe.entity.ShyLog; |
| 8 | 8 | import com.cnlive.shenhe.entity.ShySites; |
| 9 | 9 | import com.cnlive.shenhe.entity.ShyUsers; |
| 10 | 10 | import com.cnlive.shenhe.service.ShyLogService; |
| 11 | -import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; | |
| 11 | +import com.cnlive.shenhe.service.SitesService; | |
| 12 | 12 | import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; |
| 13 | 13 | import com.cnlive.shenhe.utils.CommonConst; |
| 14 | 14 | import com.cnlive.shenhe.utils.CommonUtils; |
| ... | ... | @@ -42,7 +42,7 @@ public class UsersController extends BaseController { |
| 42 | 42 | @Autowired |
| 43 | 43 | private UsersServiceImpl usersService; |
| 44 | 44 | @Autowired |
| 45 | - private SitesServiceImpl sitesService; | |
| 45 | + private SitesService sitesService; | |
| 46 | 46 | @Autowired |
| 47 | 47 | private ShyLogService shyLogService; |
| 48 | 48 | |
| ... | ... | @@ -221,24 +221,23 @@ public class UsersController extends BaseController { |
| 221 | 221 | |
| 222 | 222 | |
| 223 | 223 | @PostMapping(value = "/users/write") |
| 224 | - public String write(Model model, Integer userId, String[] write_notice, HttpSession session, String redirect_url) { | |
| 224 | + public String write(Model model, Integer userId, String[] writeNotice, HttpSession session, String redirectUrl) { | |
| 225 | 225 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 226 | 226 | ShyUsers user = usersService.get(userId); |
| 227 | - String write = ""; | |
| 228 | - if (CommonUtils.isNotNull(write_notice) && write_notice.length > 0) { | |
| 229 | - for (String w : write_notice) { | |
| 230 | - write = write + "," + w; | |
| 227 | + StringBuilder write = new StringBuilder(); | |
| 228 | + if (CommonUtils.isNotNull(writeNotice) && writeNotice.length > 0) { | |
| 229 | + for (String w : writeNotice) { | |
| 230 | + write.append(",").append(w); | |
| 231 | 231 | } |
| 232 | - write = write.substring(1); | |
| 232 | + write = new StringBuilder(write.substring(1)); | |
| 233 | 233 | } |
| 234 | - user.setNotice_show(write); | |
| 234 | + user.setNotice_show(write.toString()); | |
| 235 | 235 | boolean success = usersService.update(user); |
| 236 | 236 | if (success) { |
| 237 | - return "redirect:" + redirect_url; | |
| 237 | + return "redirect:" + redirectUrl; | |
| 238 | 238 | } else { |
| 239 | 239 | setmodelResult(model); |
| 240 | 240 | return "error.html"; |
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | - | |
| 244 | 243 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/UsersFreeController.java
| ... | ... | @@ -8,7 +8,7 @@ import com.cnlive.shenhe.bean.SessionUser; |
| 8 | 8 | import com.cnlive.shenhe.dto.UsersFreeDTO; |
| 9 | 9 | import com.cnlive.shenhe.entity.ShySites; |
| 10 | 10 | import com.cnlive.shenhe.entity.ShyUsersfree; |
| 11 | -import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; | |
| 11 | +import com.cnlive.shenhe.service.SitesService; | |
| 12 | 12 | import com.cnlive.shenhe.service.serviceImpl.UsersfreeServiceImpl; |
| 13 | 13 | import com.cnlive.shenhe.utils.CommonConst; |
| 14 | 14 | import com.cnlive.shenhe.utils.CommonUtils; |
| ... | ... | @@ -41,7 +41,7 @@ public class UsersFreeController extends BaseController { |
| 41 | 41 | @Autowired |
| 42 | 42 | UsersfreeServiceImpl usersfreeService; |
| 43 | 43 | @Autowired |
| 44 | - SitesServiceImpl sitesService; | |
| 44 | + SitesService sitesService; | |
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * 返回分页列表 |
| ... | ... | @@ -101,41 +101,39 @@ public class UsersFreeController extends BaseController { |
| 101 | 101 | * |
| 102 | 102 | * @param id |
| 103 | 103 | * @param isEnable |
| 104 | - * @param session | |
| 105 | 104 | * @return |
| 106 | 105 | */ |
| 107 | 106 | @PostMapping("/updateState") |
| 108 | 107 | @ResponseBody |
| 109 | - public ResponseBean updateState(Integer id, Boolean isEnable, HttpSession session) { | |
| 108 | + public ResponseBean updateState(Integer id, Boolean isEnable) { | |
| 110 | 109 | Integer n = usersfreeService.updateState(id, isEnable); |
| 111 | 110 | if (n > 0) { |
| 112 | - return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前用户" + (isEnable == true ? "启用" : "禁用") + "成功"); | |
| 111 | + return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前用户" + (isEnable ? "启用" : "禁用") + "成功"); | |
| 113 | 112 | } |
| 114 | 113 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "操作失败,请重试"); |
| 115 | 114 | } |
| 116 | 115 | |
| 117 | 116 | |
| 118 | 117 | @PostMapping(value = "/write") |
| 119 | - public String write(Model model, String userId, String userMobile, Integer spId, String[] write_business, HttpSession session, String redirect_url) { | |
| 118 | + public String write(Model model, String userId, String userMobile, Integer spId, String[] writeBusiness, HttpSession session, String redirectUrl) { | |
| 120 | 119 | if (CommonUtils.isEmpty(userId) && CommonUtils.isEmpty(userMobile)) { |
| 121 | 120 | setmodelParam(model, "userId,userMobile不能为空!"); |
| 122 | 121 | return "error.html"; |
| 123 | 122 | } |
| 124 | 123 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 125 | - String write = ""; | |
| 126 | - if (CommonUtils.isNotNull(write_business) && write_business.length > 0) { | |
| 127 | - for (String w : write_business) { | |
| 128 | - write = write + "," + w; | |
| 124 | + StringBuilder write = new StringBuilder(); | |
| 125 | + if (CommonUtils.isNotNull(writeBusiness) && writeBusiness.length > 0) { | |
| 126 | + for (String w : writeBusiness) { | |
| 127 | + write.append(",").append(w); | |
| 129 | 128 | } |
| 130 | - write = write.substring(1); | |
| 129 | + write = new StringBuilder(write.substring(1)); | |
| 131 | 130 | } |
| 132 | - boolean success = usersfreeService.update(userId, userMobile, write, spId, sessionUser.getUserId()); | |
| 131 | + boolean success = usersfreeService.update(userId, userMobile, write.toString(), spId, sessionUser.getUserId()); | |
| 133 | 132 | if (success) { |
| 134 | - return "redirect:" + redirect_url; | |
| 133 | + return "redirect:" + redirectUrl; | |
| 135 | 134 | } else { |
| 136 | 135 | setmodelResult(model); |
| 137 | 136 | return "error.html"; |
| 138 | 137 | } |
| 139 | 138 | } |
| 140 | - | |
| 141 | 139 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/VideosController.java
| ... | ... | @@ -9,7 +9,7 @@ import com.cnlive.shenhe.dto.VideosDTO; |
| 9 | 9 | import com.cnlive.shenhe.entity.*; |
| 10 | 10 | import com.cnlive.shenhe.service.ShyActivityService; |
| 11 | 11 | import com.cnlive.shenhe.service.ShyLogService; |
| 12 | -import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; | |
| 12 | +import com.cnlive.shenhe.service.SitesService; | |
| 13 | 13 | import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; |
| 14 | 14 | import com.cnlive.shenhe.service.serviceImpl.VideosServiceImpl; |
| 15 | 15 | import com.cnlive.shenhe.utils.AuditPass; |
| ... | ... | @@ -55,7 +55,7 @@ public class VideosController extends BaseController { |
| 55 | 55 | @Autowired |
| 56 | 56 | private UsersServiceImpl usersService; |
| 57 | 57 | @Autowired |
| 58 | - private SitesServiceImpl sitesService; | |
| 58 | + private SitesService sitesService; | |
| 59 | 59 | @Autowired |
| 60 | 60 | private ShyActivityService shyActivityService; |
| 61 | 61 | @Autowired |
| ... | ... | @@ -82,7 +82,7 @@ public class VideosController extends BaseController { |
| 82 | 82 | */ |
| 83 | 83 | @PostMapping("/shenheVideo") |
| 84 | 84 | @ResponseBody |
| 85 | - public ResponseBean shenheInfo(Integer id, String activity_id, Integer state, String attr_tags, String msg, String callback, String video_title, | |
| 85 | + public ResponseBean shenheInfo(Integer id, String activity_id, Integer state, String attr_tags, String msg, String callback, | |
| 86 | 86 | HttpSession session, HttpServletRequest request) { |
| 87 | 87 | logger.info("id:{},activity_id:{},state:{},attr_tags:{},msg:{},callback:{}", id, activity_id, state, attr_tags, msg, callback); |
| 88 | 88 | AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal(); |
| ... | ... | @@ -94,7 +94,6 @@ public class VideosController extends BaseController { |
| 94 | 94 | JSONObject result; |
| 95 | 95 | try { |
| 96 | 96 | result = pass.auditPass(activity_id, state, attr_tags, msg, callback); |
| 97 | - | |
| 98 | 97 | ShyLog shyLog = new ShyLog(); |
| 99 | 98 | shyLog.setVideoId(activity_id); |
| 100 | 99 | shyLog.setVideoName(shyVideos.getVideo_title()); |
| ... | ... | @@ -103,7 +102,6 @@ public class VideosController extends BaseController { |
| 103 | 102 | shyLog.setOperationType("人工审核"); |
| 104 | 103 | shyLog.setRemark(msg); |
| 105 | 104 | shyLogService.addShyLog(shyLog); |
| 106 | - | |
| 107 | 105 | } catch (Exception e) { |
| 108 | 106 | e.printStackTrace(); |
| 109 | 107 | logger.error("视频审核失败", e); |
| ... | ... | @@ -143,7 +141,6 @@ public class VideosController extends BaseController { |
| 143 | 141 | if (!StringUtils.isEmpty(videosDTO.getShen_auditor_id())) { |
| 144 | 142 | if ((!"自动审核".equals(videosDTO.getShen_auditor_id())) && (!"白名单".equals(videosDTO.getShen_auditor_id()))) { |
| 145 | 143 | videosDTO.setShen_auditor_id(usersService.findspidByName(videosDTO.getShen_auditor_id())); |
| 146 | - | |
| 147 | 144 | } |
| 148 | 145 | } |
| 149 | 146 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| ... | ... | @@ -166,7 +163,6 @@ public class VideosController extends BaseController { |
| 166 | 163 | } else if (CommonUtils.isEmpty(videosDTO.getSp_desc()) && videosDTO.getSpid() == 0) { |
| 167 | 164 | videosDTO.setSpid(null); |
| 168 | 165 | } |
| 169 | - | |
| 170 | 166 | if (CommonUtils.isNotNull(videosDTO.getContentId())) { |
| 171 | 167 | Map<String, String> map = new HashMap<>(1); |
| 172 | 168 | map.put("id", videosDTO.getContentId().toString()); |
| ... | ... | @@ -180,7 +176,6 @@ public class VideosController extends BaseController { |
| 180 | 176 | videosDTO.setVideo_id(String.valueOf(videosDTO.getContentId())); |
| 181 | 177 | } |
| 182 | 178 | } |
| 183 | - | |
| 184 | 179 | PageInfo<ShyVideos> videoPage = videosService.getListVideo(videosDTO); |
| 185 | 180 | //查询查询条件 |
| 186 | 181 | List<ShyActivity> activityList = shyActivityService.selectAll(); |
| ... | ... | @@ -454,8 +449,7 @@ public class VideosController extends BaseController { |
| 454 | 449 | user = usersService.select(user); |
| 455 | 450 | if (CommonUtils.isNotNull(user)) { |
| 456 | 451 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 457 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 458 | - updater = userName; | |
| 452 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 459 | 453 | } |
| 460 | 454 | } |
| 461 | 455 | } |
| ... | ... | @@ -489,7 +483,6 @@ public class VideosController extends BaseController { |
| 489 | 483 | cell = row.createCell(15);//列 |
| 490 | 484 | cell.setCellValue(shyVideosList.get(i).getSpid()); |
| 491 | 485 | cell = row.createCell(16);//列 |
| 492 | - | |
| 493 | 486 | //显示spid简称 |
| 494 | 487 | ShySites shySites = sitesService.findspidDescByspid(shyVideosList.get(i).getSpid()); |
| 495 | 488 | if (CommonUtils.isNotNull(shySites)) { |
| ... | ... | @@ -504,7 +497,6 @@ public class VideosController extends BaseController { |
| 504 | 497 | cell = row.createCell(17);//列 |
| 505 | 498 | cell.setCellValue(shyVideosList.get(i).getVideo_user_id()); |
| 506 | 499 | } |
| 507 | - | |
| 508 | 500 | ByteArrayOutputStream os = new ByteArrayOutputStream(); |
| 509 | 501 | wb.write(os); |
| 510 | 502 | byte[] content = os.toByteArray(); | ... | ... |
src/main/java/com/cnlive/shenhe/job/LiveApplyJob.java
| ... | ... | @@ -7,7 +7,7 @@ import com.cnlive.shenhe.entity.ShySites; |
| 7 | 7 | import com.cnlive.shenhe.mapper.ShyLiveapplyMapper; |
| 8 | 8 | import com.cnlive.shenhe.service.EmailService; |
| 9 | 9 | import com.cnlive.shenhe.service.LiveApplyService; |
| 10 | -import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; | |
| 10 | +import com.cnlive.shenhe.service.SitesService; | |
| 11 | 11 | import com.cnlive.shenhe.utils.CommonConst; |
| 12 | 12 | import com.cnlive.shenhe.utils.CommonUtils; |
| 13 | 13 | import com.cnlive.shenhe.utils.HttpUtil; |
| ... | ... | @@ -50,7 +50,7 @@ public class LiveApplyJob { |
| 50 | 50 | private String email_send_URL; |
| 51 | 51 | |
| 52 | 52 | @Autowired |
| 53 | - SitesServiceImpl sitesService; | |
| 53 | + SitesService sitesService; | |
| 54 | 54 | @Autowired |
| 55 | 55 | LiveApplyService liveApplyService; |
| 56 | 56 | @Autowired |
| ... | ... | @@ -88,19 +88,19 @@ public class LiveApplyJob { |
| 88 | 88 | List<ShyLiveapply> shyLiveApplyList = shyLiveApplyMapper.selectByExample(example); |
| 89 | 89 | if (shyLiveApplyList.size() > 0) { |
| 90 | 90 | //开发者对应的id,与app_key相对应 |
| 91 | - String app_id = email_app_id; | |
| 91 | + String appId = email_app_id; | |
| 92 | 92 | //开发者帐号对应的key. 请开发者谨慎保管此值。 |
| 93 | - String app_key = email_app_key; | |
| 93 | + String appKey = email_app_key; | |
| 94 | 94 | //调用邮件发送服务器的地址 |
| 95 | - String URL = email_send_URL; | |
| 95 | + String url = email_send_URL; | |
| 96 | 96 | List<ShyEmail> shyEmailList = emailService.getEmailSendList(CommonConst.EMAIL_LIVEAPPLY); |
| 97 | 97 | logger.info("直播申请邮件通知开始,共" + shyLiveApplyList.size() + "个申请,每个申请通知" + shyEmailList.size() + "个邮箱"); |
| 98 | 98 | for (ShyLiveapply liveApply : shyLiveApplyList) { |
| 99 | 99 | logger.info("当前发送邮件的直播申请id为:" + liveApply.getId()); |
| 100 | 100 | //初始化通知状态 |
| 101 | - Integer notice_state = liveApply.getEmail_notice_state(); | |
| 101 | + Integer noticeState = liveApply.getEmail_notice_state(); | |
| 102 | 102 | //初始化通知消息 |
| 103 | - String notice_msg = liveApply.getEmail_notice_msg(); | |
| 103 | + String noticeMsg = liveApply.getEmail_notice_msg(); | |
| 104 | 104 | //显示spid简称 |
| 105 | 105 | ShySites shySites = sitesService.findspidDescByspid(liveApply.getSp_id()); |
| 106 | 106 | if (CommonUtils.isNotNull(shySites)) { |
| ... | ... | @@ -117,46 +117,44 @@ public class LiveApplyJob { |
| 117 | 117 | String title = liveApply.getSpid_desc() + "新直播开播申请"; |
| 118 | 118 | String templateId = "4017"; |
| 119 | 119 | Map<String, String> params = new HashMap<>(); |
| 120 | - params.put("appId", app_id); | |
| 120 | + params.put("appId", appId); | |
| 121 | 121 | params.put("emailAddr", emailAddr); |
| 122 | 122 | params.put("title", title); |
| 123 | 123 | params.put("content", content); |
| 124 | 124 | params.put("templateId", templateId); |
| 125 | - params.put("sign", OpenUtil.sign(params, app_key)); | |
| 125 | + params.put("sign", OpenUtil.sign(params, appKey)); | |
| 126 | 126 | HttpUtil httpUtil = HttpUtil.init(); |
| 127 | 127 | httpUtil.setParamMap(params); |
| 128 | 128 | try { |
| 129 | - Map<String, String> post = httpUtil.post(URL); | |
| 129 | + Map<String, String> post = httpUtil.post(url); | |
| 130 | 130 | logger.info("当前发送邮件用户为:" + emailAddr + ",发送邮件的直播申请审核云id为:" + liveApply.getId() + "结果为:" + post.get("result")); |
| 131 | 131 | JSONObject result = JSONObject.parseObject(post.get("result")); |
| 132 | 132 | if (result == null) { |
| 133 | - notice_state = CommonConst.NOTICE_FAIL; | |
| 134 | - notice_msg = notice_msg + "\n" + dateTime + " 邮件服务器调用失败,result为空"; | |
| 133 | + noticeState = CommonConst.NOTICE_FAIL; | |
| 134 | + noticeMsg = noticeMsg + "\n" + dateTime + " 邮件服务器调用失败,result为空"; | |
| 135 | 135 | break; |
| 136 | 136 | } |
| 137 | 137 | Integer code = result.getInteger("errorCode"); |
| 138 | 138 | if (code != 0) { |
| 139 | - notice_state = CommonConst.NOTICE_FAIL; | |
| 140 | - notice_msg = notice_msg + "\n" + dateTime + " 邮件服务器调用失败,result返回消息为:" + result.getString("errorMessage"); | |
| 139 | + noticeState = CommonConst.NOTICE_FAIL; | |
| 140 | + noticeMsg = noticeMsg + "\n" + dateTime + " 邮件服务器调用失败,result返回消息为:" + result.getString("errorMessage"); | |
| 141 | 141 | break; |
| 142 | 142 | } else { |
| 143 | - notice_state = CommonConst.NOTICE_SUCCESS; | |
| 144 | - notice_msg = notice_msg + "\n" + dateTime + " 邮件" + emailAddr + "(" + shyEmail.getRemark() + ")发送成功"; | |
| 143 | + noticeState = CommonConst.NOTICE_SUCCESS; | |
| 144 | + noticeMsg = noticeMsg + "\n" + dateTime + " 邮件" + emailAddr + "(" + shyEmail.getRemark() + ")发送成功"; | |
| 145 | 145 | } |
| 146 | 146 | } catch (Exception e) { |
| 147 | 147 | logger.info("异常结果为:{}", e.getMessage()); |
| 148 | - notice_state = CommonConst.NOTICE_FAIL; | |
| 149 | - notice_msg = notice_msg + "\n" + dateTime + " 邮件服务器调用失败,服务器报错了"; | |
| 148 | + noticeState = CommonConst.NOTICE_FAIL; | |
| 149 | + noticeMsg = noticeMsg + "\n" + dateTime + " 邮件服务器调用失败,服务器报错了"; | |
| 150 | 150 | break; |
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | - | |
| 154 | - liveApply.setEmail_notice_state(notice_state); | |
| 155 | - liveApply.setEmail_notice_msg(notice_msg); | |
| 153 | + liveApply.setEmail_notice_state(noticeState); | |
| 154 | + liveApply.setEmail_notice_msg(noticeMsg); | |
| 156 | 155 | liveApplyService.updateShyLiveApply(liveApply); |
| 157 | 156 | } |
| 158 | 157 | } |
| 159 | - | |
| 160 | 158 | } |
| 161 | 159 | |
| 162 | 160 | /** |
| ... | ... | @@ -182,5 +180,4 @@ public class LiveApplyJob { |
| 182 | 180 | } |
| 183 | 181 | } |
| 184 | 182 | } |
| 185 | - | |
| 186 | 183 | } | ... | ... |
src/main/java/com/cnlive/shenhe/job/NotSpeakJob.java
| 1 | 1 | package com.cnlive.shenhe.job; |
| 2 | 2 | |
| 3 | 3 | import com.cnlive.shenhe.entity.ShyNotspeak; |
| 4 | -import com.cnlive.shenhe.service.serviceImpl.NotspeakServiceImpl; | |
| 4 | +import com.cnlive.shenhe.service.NotspeakService; | |
| 5 | 5 | import com.cnlive.shenhe.utils.CommonConst; |
| 6 | 6 | import org.slf4j.Logger; |
| 7 | 7 | import org.slf4j.LoggerFactory; |
| ... | ... | @@ -19,7 +19,7 @@ public class NotSpeakJob { |
| 19 | 19 | |
| 20 | 20 | private static Logger logger = LoggerFactory.getLogger(NotSpeakJob.class); |
| 21 | 21 | @Autowired |
| 22 | - NotspeakServiceImpl notSpeakService; | |
| 22 | + NotspeakService notSpeakService; | |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * 自动解除禁言 |
| ... | ... | @@ -35,6 +35,4 @@ public class NotSpeakJob { |
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | - | |
| 39 | - | |
| 40 | 38 | } | ... | ... |
src/main/java/com/cnlive/shenhe/service/NotspeakService.java
0 → 100644
| 1 | +package com.cnlive.shenhe.service; | |
| 2 | + | |
| 3 | +import com.cnlive.shenhe.bean.ResponseBean; | |
| 4 | +import com.cnlive.shenhe.dto.NotSpeakDTO; | |
| 5 | +import com.cnlive.shenhe.entity.ShyNotspeak; | |
| 6 | +import com.github.pagehelper.PageInfo; | |
| 7 | + | |
| 8 | +import java.util.List; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * @Author: yan-zhao-wang | |
| 12 | + * @DateTime: 2022-11-07 9:09 | |
| 13 | + */ | |
| 14 | +public interface NotspeakService { | |
| 15 | + /** | |
| 16 | + * 根据条件获取禁言集合列表 | |
| 17 | + * | |
| 18 | + * @param shyNotspeak | |
| 19 | + * @return | |
| 20 | + */ | |
| 21 | + List<ShyNotspeak> findShyNotSpeak(ShyNotspeak shyNotspeak); | |
| 22 | + | |
| 23 | + /** | |
| 24 | + * 根据主键修改禁言 返回布尔类型 | |
| 25 | + * | |
| 26 | + * @param shyNotspeak | |
| 27 | + * @return | |
| 28 | + */ | |
| 29 | + boolean updateShyNotSpeak(ShyNotspeak shyNotspeak); | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * 入禁言对象 返货布尔类型 | |
| 33 | + * | |
| 34 | + * @param shyNotspeak | |
| 35 | + * @return | |
| 36 | + */ | |
| 37 | + boolean impotShyNotSpeak(ShyNotspeak shyNotspeak); | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 根据评论禁言 | |
| 41 | + * | |
| 42 | + * @param commentId | |
| 43 | + * @param time | |
| 44 | + * @param userId | |
| 45 | + * @return | |
| 46 | + */ | |
| 47 | + ResponseBean notSpeakByComment(Integer commentId, Integer time, String userId); | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 查询禁言状态 | |
| 51 | + * | |
| 52 | + * @param commentId | |
| 53 | + * @param userId | |
| 54 | + * @return | |
| 55 | + */ | |
| 56 | + ResponseBean querySpeakState(Integer commentId, String userId); | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * 禁言回调 | |
| 60 | + * | |
| 61 | + * @param notSpeakId | |
| 62 | + * @param type | |
| 63 | + * @param time | |
| 64 | + * @param userId | |
| 65 | + * @return | |
| 66 | + */ | |
| 67 | + ResponseBean speak(Integer notSpeakId, Integer type, Integer time, String userId); | |
| 68 | + | |
| 69 | + /** | |
| 70 | + * 根据评论进行禁言 | |
| 71 | + * | |
| 72 | + * @param commentId | |
| 73 | + * @param time | |
| 74 | + * @param userId | |
| 75 | + * @return | |
| 76 | + */ | |
| 77 | + boolean writeNotSpeakByComment(Integer commentId, Integer time, String userId); | |
| 78 | + | |
| 79 | + /** | |
| 80 | + * 获取禁言分页、条件查询列表 | |
| 81 | + * | |
| 82 | + * @param notSpeakDTO | |
| 83 | + * @return | |
| 84 | + */ | |
| 85 | + PageInfo<ShyNotspeak> getPage(NotSpeakDTO notSpeakDTO); | |
| 86 | + | |
| 87 | + /** | |
| 88 | + * 根据主键id查询禁言对象 | |
| 89 | + * | |
| 90 | + * @param id | |
| 91 | + * @return | |
| 92 | + */ | |
| 93 | + ShyNotspeak selectByPrimaryKey(Integer id); | |
| 94 | + | |
| 95 | + /** | |
| 96 | + * 根据主键修改禁言对象 | |
| 97 | + * | |
| 98 | + * @param shyNotspeak | |
| 99 | + * @return | |
| 100 | + */ | |
| 101 | + int updateByPrimaryKeySelective(ShyNotspeak shyNotspeak); | |
| 102 | + | |
| 103 | + /** | |
| 104 | + * 获取禁言时间 | |
| 105 | + * | |
| 106 | + * @return | |
| 107 | + */ | |
| 108 | + List<ShyNotspeak> getNotSpeakByTime(); | |
| 109 | +} | ... | ... |
src/main/java/com/cnlive/shenhe/service/SitesService.java
0 → 100644
| 1 | +package com.cnlive.shenhe.service; | |
| 2 | + | |
| 3 | +import com.cnlive.shenhe.dto.SitesDTO; | |
| 4 | +import com.cnlive.shenhe.entity.ShySites; | |
| 5 | +import com.github.pagehelper.PageInfo; | |
| 6 | + | |
| 7 | +import java.util.List; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * @Author: yan-zhao-wang | |
| 11 | + * @DateTime: 2022-11-07 9:09 | |
| 12 | + */ | |
| 13 | +public interface SitesService { | |
| 14 | + /** | |
| 15 | + * 分页、条件查询 返回列表 | |
| 16 | + * | |
| 17 | + * @param sitesDTO | |
| 18 | + * @return | |
| 19 | + */ | |
| 20 | + PageInfo<ShySites> getPage(SitesDTO sitesDTO); | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * 根据主键id查询白名单对象 | |
| 24 | + * | |
| 25 | + * @param siteId | |
| 26 | + * @return | |
| 27 | + */ | |
| 28 | + ShySites get(Integer siteId); | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 根据主键修改白名单对象 | |
| 32 | + * | |
| 33 | + * @param site | |
| 34 | + * @return | |
| 35 | + */ | |
| 36 | + boolean update(ShySites site); | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * 根据spid查询白名单对象 | |
| 40 | + * | |
| 41 | + * @param spId | |
| 42 | + * @return | |
| 43 | + */ | |
| 44 | + ShySites findspidDescByspid(int spId); | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * 根据name查询白名单对象 | |
| 48 | + * | |
| 49 | + * @param sp_desc | |
| 50 | + * @return | |
| 51 | + */ | |
| 52 | + ShySites findspidBySpdesc(String sp_desc); | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 获取免审白名单列表(点播) | |
| 56 | + * | |
| 57 | + * @param business_ | |
| 58 | + * @return | |
| 59 | + */ | |
| 60 | + List<Integer> getBusinessList(Integer business_); | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * 获取用户(操作人) | |
| 64 | + * | |
| 65 | + * @param updater | |
| 66 | + * @param auditor_id | |
| 67 | + * @return | |
| 68 | + */ | |
| 69 | + String getUpdater(String updater, String auditor_id); | |
| 70 | +} | ... | ... |
src/main/java/com/cnlive/shenhe/service/serviceImpl/AudioServiceImpl.java
| ... | ... | @@ -4,10 +4,13 @@ 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.dto.AudioDTO; |
| 7 | -import com.cnlive.shenhe.entity.*; | |
| 7 | +import com.cnlive.shenhe.entity.ShyAudio; | |
| 8 | +import com.cnlive.shenhe.entity.ShyUsers; | |
| 9 | +import com.cnlive.shenhe.entity.ShyYidun; | |
| 8 | 10 | import com.cnlive.shenhe.mapper.ShyAudioMapper; |
| 9 | 11 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| 10 | 12 | import com.cnlive.shenhe.service.AudioService; |
| 13 | +import com.cnlive.shenhe.service.SitesService; | |
| 11 | 14 | import com.cnlive.shenhe.utils.*; |
| 12 | 15 | import com.github.pagehelper.PageHelper; |
| 13 | 16 | import com.github.pagehelper.PageInfo; |
| ... | ... | @@ -44,7 +47,7 @@ public class AudioServiceImpl implements AudioService { |
| 44 | 47 | ShyUsersMapper shyUsersMapper; |
| 45 | 48 | |
| 46 | 49 | @Autowired |
| 47 | - SitesServiceImpl sitesService; | |
| 50 | + SitesService sitesService; | |
| 48 | 51 | @Autowired |
| 49 | 52 | YiDunServiceImpl yiDunServiceImpl; |
| 50 | 53 | @Value("${yiDun_audio_callback}") |
| ... | ... | @@ -91,8 +94,7 @@ public class AudioServiceImpl implements AudioService { |
| 91 | 94 | */ |
| 92 | 95 | @Override |
| 93 | 96 | public ShyAudio selectByPrimaryKey(Integer id) { |
| 94 | - ShyAudio shyAudio = shyAudioMapper.selectByPrimaryKey(id); | |
| 95 | - return shyAudio; | |
| 97 | + return shyAudioMapper.selectByPrimaryKey(id); | |
| 96 | 98 | } |
| 97 | 99 | |
| 98 | 100 | /** |
| ... | ... | @@ -103,8 +105,7 @@ public class AudioServiceImpl implements AudioService { |
| 103 | 105 | */ |
| 104 | 106 | @Override |
| 105 | 107 | public List<ShyAudio> findshyAudio(ShyAudio shyAudio) { |
| 106 | - List<ShyAudio> shyAudiolist = shyAudioMapper.selectByRowBounds(shyAudio, new RowBounds(0, 100)); | |
| 107 | - return shyAudiolist; | |
| 108 | + return shyAudioMapper.selectByRowBounds(shyAudio, new RowBounds(0, 100)); | |
| 108 | 109 | } |
| 109 | 110 | |
| 110 | 111 | /** |
| ... | ... | @@ -135,7 +136,6 @@ public class AudioServiceImpl implements AudioService { |
| 135 | 136 | audioService.updateAudio(shyAudio.getId(), null, shyAudio.getUploader(), "", CommonConst.AUDIT_CALLBACK_FAIL, shyAudio.getMsg()); |
| 136 | 137 | logger.error("点播音频回调失败,activity_id:{},code:{},msg:{}", shyAudio.getAudioId(), code, result.getString("msg")); |
| 137 | 138 | } |
| 138 | - | |
| 139 | 139 | return 0; |
| 140 | 140 | } |
| 141 | 141 | |
| ... | ... | @@ -238,7 +238,6 @@ public class AudioServiceImpl implements AudioService { |
| 238 | 238 | showMsg = showMsg + "," + shyAudio.getAudioTitle() + " 更新失败"; |
| 239 | 239 | return showMsg; |
| 240 | 240 | } |
| 241 | - | |
| 242 | 241 | return showMsg; |
| 243 | 242 | } |
| 244 | 243 | |
| ... | ... | @@ -246,28 +245,28 @@ public class AudioServiceImpl implements AudioService { |
| 246 | 245 | * 根据id查询到音频对象进行修改 |
| 247 | 246 | * |
| 248 | 247 | * @param id |
| 249 | - * @param auditor_id | |
| 248 | + * @param auditorId | |
| 250 | 249 | * @param updater |
| 251 | - * @param attr_tags | |
| 250 | + * @param attrTags | |
| 252 | 251 | * @param state |
| 253 | 252 | * @param msg |
| 254 | 253 | * @return |
| 255 | 254 | */ |
| 256 | 255 | @Override |
| 257 | - public int updateAudio(Integer id, String auditor_id, String updater, String attr_tags, Integer state, String msg) { | |
| 256 | + public int updateAudio(Integer id, String auditorId, String updater, String attrTags, Integer state, String msg) { | |
| 258 | 257 | ShyAudio shyAudio = shyAudioMapper.selectByPrimaryKey(id); |
| 259 | - shyAudio.setAuditor_id(auditor_id); | |
| 258 | + shyAudio.setAuditor_id(auditorId); | |
| 260 | 259 | shyAudio.setState(state); |
| 261 | - if (CommonUtils.isNotEmpty(attr_tags)) { | |
| 262 | - shyAudio.setAttr_tags(attr_tags); | |
| 260 | + if (CommonUtils.isNotEmpty(attrTags)) { | |
| 261 | + shyAudio.setAttr_tags(attrTags); | |
| 263 | 262 | } |
| 264 | 263 | if (CommonUtils.isNotEmpty(msg)) { |
| 265 | 264 | shyAudio.setMsg(msg); |
| 266 | 265 | } |
| 267 | 266 | shyAudio.setUploader(updater); |
| 268 | - if (CommonUtils.isNotEmpty(auditor_id)) { | |
| 267 | + if (CommonUtils.isNotEmpty(auditorId)) { | |
| 269 | 268 | shyAudio.setReceive(CommonConst.RECEIVE_AFTER); |
| 270 | - shyAudio.setReceive_user_id(auditor_id); | |
| 269 | + shyAudio.setReceive_user_id(auditorId); | |
| 271 | 270 | shyAudio.setShenhe_type(CommonConst.AUDIT_TYPE_USER); |
| 272 | 271 | } |
| 273 | 272 | return shyAudioMapper.updateByPrimaryKey(shyAudio); |
| ... | ... | @@ -337,8 +336,7 @@ public class AudioServiceImpl implements AudioService { |
| 337 | 336 | user.setUser_id(auditorId); |
| 338 | 337 | user = shyUsersMapper.selectOne(user); |
| 339 | 338 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 340 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 341 | - updater = userName; | |
| 339 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 342 | 340 | } |
| 343 | 341 | shyAudio.setUploader(updater); |
| 344 | 342 | } |
| ... | ... | @@ -387,8 +385,7 @@ public class AudioServiceImpl implements AudioService { |
| 387 | 385 | } |
| 388 | 386 | //默认按上传时间倒序排序 |
| 389 | 387 | example.setOrderByClause("createTime desc"); |
| 390 | - List<ShyAudio> shyAudioList = shyAudioMapper.selectByExample(example); | |
| 391 | - return shyAudioList; | |
| 388 | + return shyAudioMapper.selectByExample(example); | |
| 392 | 389 | } |
| 393 | 390 | |
| 394 | 391 | ... | ... |
src/main/java/com/cnlive/shenhe/service/serviceImpl/ChannelServiceImpl.java
| ... | ... | @@ -8,6 +8,7 @@ import com.cnlive.shenhe.entity.ShyUsers; |
| 8 | 8 | import com.cnlive.shenhe.mapper.ShyChannelMapper; |
| 9 | 9 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| 10 | 10 | import com.cnlive.shenhe.service.ChannelService; |
| 11 | +import com.cnlive.shenhe.service.SitesService; | |
| 11 | 12 | import com.cnlive.shenhe.utils.AuditPass; |
| 12 | 13 | import com.cnlive.shenhe.utils.CommonConst; |
| 13 | 14 | import com.cnlive.shenhe.utils.CommonUtils; |
| ... | ... | @@ -39,7 +40,7 @@ public class ChannelServiceImpl implements ChannelService { |
| 39 | 40 | AuditPass pass; |
| 40 | 41 | |
| 41 | 42 | @Autowired |
| 42 | - SitesServiceImpl sitesService; | |
| 43 | + SitesService sitesService; | |
| 43 | 44 | |
| 44 | 45 | /** |
| 45 | 46 | * 根据条件查询频道集合 |
| ... | ... | @@ -61,10 +62,7 @@ public class ChannelServiceImpl implements ChannelService { |
| 61 | 62 | @Override |
| 62 | 63 | public boolean updateshyChannel(ShyChannel shyChannel) { |
| 63 | 64 | int result = shyChannelMapper.updateByPrimaryKey(shyChannel); |
| 64 | - if (result == 0) { | |
| 65 | - return false; | |
| 66 | - } | |
| 67 | - return true; | |
| 65 | + return result != 0; | |
| 68 | 66 | } |
| 69 | 67 | |
| 70 | 68 | /** |
| ... | ... | @@ -76,10 +74,7 @@ public class ChannelServiceImpl implements ChannelService { |
| 76 | 74 | @Override |
| 77 | 75 | public boolean impotChannel(ShyChannel shyChannel) { |
| 78 | 76 | int result = shyChannelMapper.insertSelective(shyChannel); |
| 79 | - if (result == 0) { | |
| 80 | - return false; | |
| 81 | - } | |
| 82 | - return true; | |
| 77 | + return result != 0; | |
| 83 | 78 | } |
| 84 | 79 | |
| 85 | 80 | /** |
| ... | ... | @@ -153,8 +148,7 @@ public class ChannelServiceImpl implements ChannelService { |
| 153 | 148 | user.setUser_id(auditorId); |
| 154 | 149 | user = shyUsersMapper.selectOne(user); |
| 155 | 150 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 156 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 157 | - updater = userName; | |
| 151 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 158 | 152 | } |
| 159 | 153 | comment.setUpdater(updater); |
| 160 | 154 | } |
| ... | ... | @@ -228,8 +222,7 @@ public class ChannelServiceImpl implements ChannelService { |
| 228 | 222 | */ |
| 229 | 223 | @Override |
| 230 | 224 | public ShyChannel selectByPrimaryKey(Integer id) { |
| 231 | - ShyChannel shyChannel = shyChannelMapper.selectByPrimaryKey(id); | |
| 232 | - return shyChannel; | |
| 225 | + return shyChannelMapper.selectByPrimaryKey(id); | |
| 233 | 226 | } |
| 234 | 227 | |
| 235 | 228 | /** | ... | ... |
src/main/java/com/cnlive/shenhe/service/serviceImpl/CommentsServiceImpl.java
| ... | ... | @@ -7,6 +7,7 @@ import com.cnlive.shenhe.entity.ShyUsers; |
| 7 | 7 | import com.cnlive.shenhe.mapper.ShyCommentsMapper; |
| 8 | 8 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| 9 | 9 | import com.cnlive.shenhe.service.CommentsService; |
| 10 | +import com.cnlive.shenhe.service.SitesService; | |
| 10 | 11 | import com.cnlive.shenhe.utils.AuditPass; |
| 11 | 12 | import com.cnlive.shenhe.utils.CommonConst; |
| 12 | 13 | import com.cnlive.shenhe.utils.CommonUtils; |
| ... | ... | @@ -37,7 +38,7 @@ public class CommentsServiceImpl implements CommentsService { |
| 37 | 38 | @Autowired |
| 38 | 39 | AuditPass pass; |
| 39 | 40 | @Autowired |
| 40 | - SitesServiceImpl sitesService; | |
| 41 | + SitesService sitesService; | |
| 41 | 42 | |
| 42 | 43 | |
| 43 | 44 | /** |
| ... | ... | @@ -48,8 +49,7 @@ public class CommentsServiceImpl implements CommentsService { |
| 48 | 49 | */ |
| 49 | 50 | @Override |
| 50 | 51 | public List<ShyComments> findShyComments(ShyComments shyComments) { |
| 51 | - List<ShyComments> commentsList = shyCommentsMapper.selectByRowBounds(shyComments, new RowBounds(0, 100)); | |
| 52 | - return commentsList; | |
| 52 | + return shyCommentsMapper.selectByRowBounds(shyComments, new RowBounds(0, 100)); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
| ... | ... | @@ -61,10 +61,7 @@ public class CommentsServiceImpl implements CommentsService { |
| 61 | 61 | @Override |
| 62 | 62 | public boolean updateShyComments1(ShyComments shyComments) { |
| 63 | 63 | int result = shyCommentsMapper.updateByPrimaryKey(shyComments); |
| 64 | - if (result == 0) { | |
| 65 | - return false; | |
| 66 | - } | |
| 67 | - return true; | |
| 64 | + return result != 0; | |
| 68 | 65 | } |
| 69 | 66 | |
| 70 | 67 | /** |
| ... | ... | @@ -76,10 +73,7 @@ public class CommentsServiceImpl implements CommentsService { |
| 76 | 73 | @Override |
| 77 | 74 | public boolean impotComments(ShyComments shyComments) { |
| 78 | 75 | int result = shyCommentsMapper.insertSelective(shyComments); |
| 79 | - if (result == 0) { | |
| 80 | - return false; | |
| 81 | - } | |
| 82 | - return true; | |
| 76 | + return result != 0; | |
| 83 | 77 | } |
| 84 | 78 | |
| 85 | 79 | /** |
| ... | ... | @@ -219,8 +213,7 @@ public class CommentsServiceImpl implements CommentsService { |
| 219 | 213 | user.setUser_id(auditorId); |
| 220 | 214 | user = shyUsersMapper.selectOne(user); |
| 221 | 215 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 222 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 223 | - updater = userName; | |
| 216 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 224 | 217 | } |
| 225 | 218 | comment.setUpdater(updater); |
| 226 | 219 | } |
| ... | ... | @@ -283,7 +276,6 @@ public class CommentsServiceImpl implements CommentsService { |
| 283 | 276 | success = false; |
| 284 | 277 | } |
| 285 | 278 | } |
| 286 | - | |
| 287 | 279 | } |
| 288 | 280 | return success; |
| 289 | 281 | } |
| ... | ... | @@ -365,8 +357,7 @@ public class CommentsServiceImpl implements CommentsService { |
| 365 | 357 | */ |
| 366 | 358 | @Override |
| 367 | 359 | public ShyComments selectByPrimaryKey(Integer id) { |
| 368 | - ShyComments shyComments = shyCommentsMapper.selectByPrimaryKey(id); | |
| 369 | - return shyComments; | |
| 360 | + return shyCommentsMapper.selectByPrimaryKey(id); | |
| 370 | 361 | } |
| 371 | 362 | |
| 372 | 363 | /** | ... | ... |
src/main/java/com/cnlive/shenhe/service/serviceImpl/ContentServiceImpl.java
| ... | ... | @@ -7,6 +7,7 @@ import com.cnlive.shenhe.entity.*; |
| 7 | 7 | import com.cnlive.shenhe.mapper.ShyContentMapper; |
| 8 | 8 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| 9 | 9 | import com.cnlive.shenhe.service.ContentService; |
| 10 | +import com.cnlive.shenhe.service.SitesService; | |
| 10 | 11 | import com.cnlive.shenhe.utils.*; |
| 11 | 12 | import com.github.pagehelper.PageHelper; |
| 12 | 13 | import com.github.pagehelper.PageInfo; |
| ... | ... | @@ -37,7 +38,7 @@ public class ContentServiceImpl implements ContentService { |
| 37 | 38 | @Autowired |
| 38 | 39 | AuditPass pass; |
| 39 | 40 | @Autowired |
| 40 | - SitesServiceImpl sitesService; | |
| 41 | + SitesService sitesService; | |
| 41 | 42 | @Autowired |
| 42 | 43 | VideosServiceImpl videosService; |
| 43 | 44 | @Autowired |
| ... | ... | @@ -86,8 +87,7 @@ public class ContentServiceImpl implements ContentService { |
| 86 | 87 | criteria.andEqualTo("content_tag", checkParamList); |
| 87 | 88 | criteria.andEqualTo("shenhe_type", CommonConst.AUDIT_TYPE_MACHANE); |
| 88 | 89 | criteria.andEqualTo("receive_status", CommonConst.RECEIVE_BEFORE); |
| 89 | - List<ShyContent> ShyContent = shyContentMapper.selectByExampleAndRowBounds(example, new RowBounds(0, 100)); | |
| 90 | - return ShyContent; | |
| 90 | + return shyContentMapper.selectByExampleAndRowBounds(example, new RowBounds(0, 100)); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
| ... | ... | @@ -99,10 +99,7 @@ public class ContentServiceImpl implements ContentService { |
| 99 | 99 | @Override |
| 100 | 100 | public boolean updateShyContent(ShyContent shyContent) { |
| 101 | 101 | int result = shyContentMapper.updateByPrimaryKeySelective(shyContent); |
| 102 | - if (result == 0) { | |
| 103 | - return false; | |
| 104 | - } | |
| 105 | - return true; | |
| 102 | + return result != 0; | |
| 106 | 103 | } |
| 107 | 104 | |
| 108 | 105 | /** |
| ... | ... | @@ -114,10 +111,7 @@ public class ContentServiceImpl implements ContentService { |
| 114 | 111 | @Override |
| 115 | 112 | public boolean impotContent(ShyContent shyContent) { |
| 116 | 113 | int result = shyContentMapper.insertSelective(shyContent); |
| 117 | - if (result == 0) { | |
| 118 | - return false; | |
| 119 | - } | |
| 120 | - return true; | |
| 114 | + return result != 0; | |
| 121 | 115 | } |
| 122 | 116 | |
| 123 | 117 | /** |
| ... | ... | @@ -181,7 +175,6 @@ public class ContentServiceImpl implements ContentService { |
| 181 | 175 | */ |
| 182 | 176 | @Override |
| 183 | 177 | public List<ShyContent> findByCondition(ContentDTO contentDTO) { |
| 184 | - | |
| 185 | 178 | Example example = new Example(ShyContent.class); |
| 186 | 179 | Example.Criteria criteria = example.createCriteria(); |
| 187 | 180 | if (CommonUtils.isNotEmpty(contentDTO.getOrderByClause())) { |
| ... | ... | @@ -210,8 +203,7 @@ public class ContentServiceImpl implements ContentService { |
| 210 | 203 | if (CommonUtils.isNotNull(contentDTO.getReceive_status())) { |
| 211 | 204 | criteria.andEqualTo("receive_status", contentDTO.getReceive_status()); |
| 212 | 205 | } |
| 213 | - List<ShyContent> shyContentList = shyContentMapper.selectByExample(example); | |
| 214 | - return shyContentList; | |
| 206 | + return shyContentMapper.selectByExample(example); | |
| 215 | 207 | } |
| 216 | 208 | |
| 217 | 209 | |
| ... | ... | @@ -232,8 +224,7 @@ public class ContentServiceImpl implements ContentService { |
| 232 | 224 | user.setUser_id(auditorId); |
| 233 | 225 | user = shyUsersMapper.selectOne(user); |
| 234 | 226 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 235 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 236 | - updater = userName; | |
| 227 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 237 | 228 | } |
| 238 | 229 | content.setUpdater(updater); |
| 239 | 230 | } |
| ... | ... | @@ -407,8 +398,7 @@ public class ContentServiceImpl implements ContentService { |
| 407 | 398 | */ |
| 408 | 399 | @Override |
| 409 | 400 | public ShyContent selectByPrimaryKey(Integer id) { |
| 410 | - ShyContent shyContent = shyContentMapper.selectByPrimaryKey(id); | |
| 411 | - return shyContent; | |
| 401 | + return shyContentMapper.selectByPrimaryKey(id); | |
| 412 | 402 | } |
| 413 | 403 | |
| 414 | 404 | /** |
| ... | ... | @@ -428,18 +418,18 @@ public class ContentServiceImpl implements ContentService { |
| 428 | 418 | * @param spId |
| 429 | 419 | */ |
| 430 | 420 | @Override |
| 431 | - public Integer getShenheType(Integer spId, String ContentTag) { | |
| 421 | + public Integer getShenheType(Integer spId, String contentTag) { | |
| 432 | 422 | //获取图文免审sp |
| 433 | 423 | List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_CONTENT); |
| 434 | 424 | //初始化一个审核状态 |
| 435 | 425 | //审核类型,1:免审,2:机审,3:人工审 默认人工审 |
| 436 | 426 | Integer shenheType = CommonConst.AUDIT_TYPE_USER; |
| 437 | 427 | //如果当前sp是免审sp |
| 438 | - if (sites.contains(spId) || ContentTag.startsWith("cms_") || ContentTag.startsWith("edu_")) { | |
| 428 | + if (sites.contains(spId) || contentTag.startsWith("cms_") || contentTag.startsWith("edu_")) { | |
| 439 | 429 | //免审 |
| 440 | 430 | shenheType = CommonConst.AUDIT_TYPE_FREE; |
| 441 | 431 | } else { |
| 442 | - if ("content".equals(ContentTag)) { | |
| 432 | + if ("content".equals(contentTag)) { | |
| 443 | 433 | //机审 |
| 444 | 434 | shenheType = CommonConst.AUDIT_TYPE_MACHANE; |
| 445 | 435 | } |
| ... | ... | @@ -481,7 +471,6 @@ public class ContentServiceImpl implements ContentService { |
| 481 | 471 | e.printStackTrace(); |
| 482 | 472 | } |
| 483 | 473 | } |
| 484 | - | |
| 485 | 474 | } |
| 486 | 475 | |
| 487 | 476 | ... | ... |
src/main/java/com/cnlive/shenhe/service/serviceImpl/LiveApplyServiceImpl.java
| ... | ... | @@ -10,6 +10,7 @@ import com.cnlive.shenhe.entity.ShyUsers; |
| 10 | 10 | import com.cnlive.shenhe.mapper.ShyLiveapplyMapper; |
| 11 | 11 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| 12 | 12 | import com.cnlive.shenhe.service.LiveApplyService; |
| 13 | +import com.cnlive.shenhe.service.SitesService; | |
| 13 | 14 | import com.cnlive.shenhe.utils.CommonConst; |
| 14 | 15 | import com.cnlive.shenhe.utils.CommonUtils; |
| 15 | 16 | import com.github.pagehelper.PageHelper; |
| ... | ... | @@ -39,7 +40,7 @@ public class LiveApplyServiceImpl implements LiveApplyService { |
| 39 | 40 | @Autowired |
| 40 | 41 | ShyUsersMapper shyUsersMapper; |
| 41 | 42 | @Autowired |
| 42 | - SitesServiceImpl sitesService; | |
| 43 | + SitesService sitesService; | |
| 43 | 44 | |
| 44 | 45 | /** |
| 45 | 46 | * 导入直播申请 |
| ... | ... | @@ -50,10 +51,7 @@ public class LiveApplyServiceImpl implements LiveApplyService { |
| 50 | 51 | @Override |
| 51 | 52 | public boolean impotLiveApply(ShyLiveapply shyLiveApply) { |
| 52 | 53 | int result = shyLiveApplyMapper.insertSelective(shyLiveApply); |
| 53 | - if (result == 0) { | |
| 54 | - return false; | |
| 55 | - } | |
| 56 | - return true; | |
| 54 | + return result != 0; | |
| 57 | 55 | } |
| 58 | 56 | |
| 59 | 57 | /** |
| ... | ... | @@ -64,8 +62,7 @@ public class LiveApplyServiceImpl implements LiveApplyService { |
| 64 | 62 | */ |
| 65 | 63 | @Override |
| 66 | 64 | public ShyLiveapply selectByPrimaryKey(Integer id) { |
| 67 | - ShyLiveapply shyLiveApply = shyLiveApplyMapper.selectByPrimaryKey(id); | |
| 68 | - return shyLiveApply; | |
| 65 | + return shyLiveApplyMapper.selectByPrimaryKey(id); | |
| 69 | 66 | } |
| 70 | 67 | |
| 71 | 68 | /** |
| ... | ... | @@ -76,8 +73,7 @@ public class LiveApplyServiceImpl implements LiveApplyService { |
| 76 | 73 | */ |
| 77 | 74 | @Override |
| 78 | 75 | public List<ShyLiveapply> findShyLiveApply(ShyLiveapply shyLiveApply) { |
| 79 | - List<ShyLiveapply> shyLiveApplylist = shyLiveApplyMapper.selectByRowBounds(shyLiveApply, new RowBounds(0, 100)); | |
| 80 | - return shyLiveApplylist; | |
| 76 | + return shyLiveApplyMapper.selectByRowBounds(shyLiveApply, new RowBounds(0, 100)); | |
| 81 | 77 | } |
| 82 | 78 | |
| 83 | 79 | /** |
| ... | ... | @@ -89,26 +85,23 @@ public class LiveApplyServiceImpl implements LiveApplyService { |
| 89 | 85 | @Override |
| 90 | 86 | public boolean updateShyLiveApply(ShyLiveapply shyLiveApply) { |
| 91 | 87 | int i = shyLiveApplyMapper.updateByPrimaryKey(shyLiveApply); |
| 92 | - if (i == 0) { | |
| 93 | - return false; | |
| 94 | - } | |
| 95 | - return true; | |
| 88 | + return i != 0; | |
| 96 | 89 | } |
| 97 | 90 | |
| 98 | 91 | /** |
| 99 | 92 | * 修改直播申请对象 返回int类型 |
| 100 | 93 | * |
| 101 | 94 | * @param id |
| 102 | - * @param auditor_id | |
| 95 | + * @param auditorId | |
| 103 | 96 | * @param updater |
| 104 | 97 | * @param status |
| 105 | 98 | * @param msg |
| 106 | 99 | * @return |
| 107 | 100 | */ |
| 108 | 101 | @Override |
| 109 | - public int updateLiveApply(Integer id, String auditor_id, String updater, Integer status, String msg) { | |
| 102 | + public int updateLiveApply(Integer id, String auditorId, String updater, Integer status, String msg) { | |
| 110 | 103 | ShyLiveapply shyLiveapply = shyLiveApplyMapper.selectByPrimaryKey(id); |
| 111 | - shyLiveapply.setAuditor(auditor_id); | |
| 104 | + shyLiveapply.setAuditor(auditorId); | |
| 112 | 105 | shyLiveapply.setShenhe_state(status); |
| 113 | 106 | shyLiveapply.setReceive(CommonConst.RECEIVE_AFTER); |
| 114 | 107 | shyLiveapply.setShenhe_msg(msg); |
| ... | ... | @@ -197,8 +190,7 @@ public class LiveApplyServiceImpl implements LiveApplyService { |
| 197 | 190 | user.setUser_id(auditorId); |
| 198 | 191 | user = shyUsersMapper.selectOne(user); |
| 199 | 192 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 200 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 201 | - updater = userName; | |
| 193 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 202 | 194 | } |
| 203 | 195 | shyLiveapply.setUpdater(updater); |
| 204 | 196 | } |
| ... | ... | @@ -334,8 +326,7 @@ public class LiveApplyServiceImpl implements LiveApplyService { |
| 334 | 326 | criteria.andEqualTo("auditor", liveApplyDTO.getUserId()); |
| 335 | 327 | } |
| 336 | 328 | } |
| 337 | - List<ShyLiveapply> shyLiveApplyList = shyLiveApplyMapper.selectByExample(example); | |
| 338 | - return shyLiveApplyList; | |
| 329 | + return shyLiveApplyMapper.selectByExample(example); | |
| 339 | 330 | } |
| 340 | 331 | |
| 341 | 332 | /** |
| ... | ... | @@ -358,6 +349,4 @@ public class LiveApplyServiceImpl implements LiveApplyService { |
| 358 | 349 | } |
| 359 | 350 | shyLiveApply.setShenhe_type(shenheType); |
| 360 | 351 | } |
| 361 | - | |
| 362 | - | |
| 363 | 352 | } | ... | ... |
src/main/java/com/cnlive/shenhe/service/serviceImpl/NotspeakServiceImpl.java
| ... | ... | @@ -9,6 +9,7 @@ import com.cnlive.shenhe.entity.ShyComments; |
| 9 | 9 | import com.cnlive.shenhe.entity.ShyNotspeak; |
| 10 | 10 | import com.cnlive.shenhe.mapper.ShyCommentsMapper; |
| 11 | 11 | import com.cnlive.shenhe.mapper.ShyNotspeakMapper; |
| 12 | +import com.cnlive.shenhe.service.NotspeakService; | |
| 12 | 13 | import com.cnlive.shenhe.utils.AuditPass; |
| 13 | 14 | import com.cnlive.shenhe.utils.CommonConst; |
| 14 | 15 | import com.cnlive.shenhe.utils.CommonUtils; |
| ... | ... | @@ -30,7 +31,7 @@ import java.util.List; |
| 30 | 31 | * @Description: |
| 31 | 32 | */ |
| 32 | 33 | @Service |
| 33 | -public class NotspeakServiceImpl { | |
| 34 | +public class NotspeakServiceImpl implements NotspeakService { | |
| 34 | 35 | |
| 35 | 36 | private static Logger logger = LoggerFactory.getLogger(NotspeakServiceImpl.class); |
| 36 | 37 | @Autowired |
| ... | ... | @@ -44,46 +45,48 @@ public class NotspeakServiceImpl { |
| 44 | 45 | |
| 45 | 46 | /** |
| 46 | 47 | * 根据条件获取禁言集合列表 |
| 48 | + * | |
| 47 | 49 | * @param shyNotspeak |
| 48 | 50 | * @return |
| 49 | 51 | */ |
| 50 | - public List<ShyNotspeak> findshyNotspeak(ShyNotspeak shyNotspeak) { | |
| 52 | + @Override | |
| 53 | + public List<ShyNotspeak> findShyNotSpeak(ShyNotspeak shyNotspeak) { | |
| 51 | 54 | return shyNotspeakMapper.selectByRowBounds(shyNotspeak, new RowBounds(0, 100)); |
| 52 | 55 | } |
| 53 | 56 | |
| 54 | 57 | /** |
| 55 | 58 | * 根据主键修改禁言 返回布尔类型 |
| 59 | + * | |
| 56 | 60 | * @param shyNotspeak |
| 57 | 61 | * @return |
| 58 | 62 | */ |
| 59 | - public boolean updateshyNotspeak(ShyNotspeak shyNotspeak) { | |
| 63 | + @Override | |
| 64 | + public boolean updateShyNotSpeak(ShyNotspeak shyNotspeak) { | |
| 60 | 65 | int result = shyNotspeakMapper.updateByPrimaryKey(shyNotspeak); |
| 61 | - if (result == 0) { | |
| 62 | - return false; | |
| 63 | - } | |
| 64 | - return true; | |
| 66 | + return result != 0; | |
| 65 | 67 | } |
| 66 | 68 | |
| 67 | 69 | /** |
| 68 | 70 | * 导入禁言对象 返货布尔类型 |
| 71 | + * | |
| 69 | 72 | * @param shyNotspeak |
| 70 | 73 | * @return |
| 71 | 74 | */ |
| 72 | - public boolean impotshyNotspeak(ShyNotspeak shyNotspeak) { | |
| 75 | + @Override | |
| 76 | + public boolean impotShyNotSpeak(ShyNotspeak shyNotspeak) { | |
| 73 | 77 | int result = shyNotspeakMapper.insertSelective(shyNotspeak); |
| 74 | - if (result == 0) { | |
| 75 | - return false; | |
| 76 | - } | |
| 77 | - return true; | |
| 78 | + return result != 0; | |
| 78 | 79 | } |
| 79 | 80 | |
| 80 | 81 | /** |
| 81 | 82 | * 根据评论禁言 |
| 83 | + * | |
| 82 | 84 | * @param commentId |
| 83 | 85 | * @param time |
| 84 | 86 | * @param userId |
| 85 | 87 | * @return |
| 86 | 88 | */ |
| 89 | + @Override | |
| 87 | 90 | public ResponseBean notSpeakByComment(Integer commentId, Integer time, String userId) { |
| 88 | 91 | ResponseBean success; |
| 89 | 92 | ShyComments comment = shyCommentsMapper.selectByPrimaryKey(commentId); |
| ... | ... | @@ -133,16 +136,18 @@ public class NotspeakServiceImpl { |
| 133 | 136 | |
| 134 | 137 | /** |
| 135 | 138 | * 查询禁言状态 |
| 139 | + * | |
| 136 | 140 | * @param commentId |
| 137 | 141 | * @param userId |
| 138 | 142 | * @return |
| 139 | 143 | */ |
| 144 | + @Override | |
| 140 | 145 | public ResponseBean querySpeakState(Integer commentId, String userId) { |
| 141 | 146 | ShyComments comment = shyCommentsMapper.selectByPrimaryKey(commentId); |
| 142 | 147 | ShyNotspeak shyNotspeak = new ShyNotspeak(); |
| 143 | 148 | shyNotspeak.setUser_id(comment.getComment_user_id()); |
| 144 | 149 | shyNotspeak.setState(CommonConst.SPEAK_NOT); |
| 145 | - List<ShyNotspeak> shyNotspeakList = findshyNotspeak(shyNotspeak); | |
| 150 | + List<ShyNotspeak> shyNotspeakList = findShyNotSpeak(shyNotspeak); | |
| 146 | 151 | if (shyNotspeakList.size() > 0) { |
| 147 | 152 | shyNotspeak = shyNotspeakList.get(0); |
| 148 | 153 | return new ResponseBean(500, "当前用户已被禁言,禁言剩余时长:" + (shyNotspeak.getEnd_time().getTime() - System.currentTimeMillis()) / (1000 * 60) + "分钟,解禁时间:" + CommonUtils.formatDate(shyNotspeak.getEnd_time(), "yyyy-MM-dd HH:mm:ss")); |
| ... | ... | @@ -152,12 +157,14 @@ public class NotspeakServiceImpl { |
| 152 | 157 | |
| 153 | 158 | /** |
| 154 | 159 | * 禁言回调 |
| 160 | + * | |
| 155 | 161 | * @param notSpeakId |
| 156 | 162 | * @param type |
| 157 | 163 | * @param time |
| 158 | 164 | * @param userId |
| 159 | 165 | * @return |
| 160 | 166 | */ |
| 167 | + @Override | |
| 161 | 168 | public ResponseBean speak(Integer notSpeakId, Integer type, Integer time, String userId) { |
| 162 | 169 | ResponseBean success; |
| 163 | 170 | ShyNotspeak shyNotspeak = selectByPrimaryKey(notSpeakId); |
| ... | ... | @@ -203,7 +210,7 @@ public class NotspeakServiceImpl { |
| 203 | 210 | } |
| 204 | 211 | shyNotspeak.setUpdated_at(CommonUtils.getCurrentTime()); |
| 205 | 212 | shyNotspeak.setMsg(shyNotspeak.getMsg() + "\n" + msg); |
| 206 | - boolean res = updateshyNotspeak(shyNotspeak); | |
| 213 | + boolean res = updateShyNotSpeak(shyNotspeak); | |
| 207 | 214 | if (!res) { |
| 208 | 215 | success = new ResponseBean(500, "评论禁言修改禁言表失败!"); |
| 209 | 216 | return success; |
| ... | ... | @@ -213,7 +220,16 @@ public class NotspeakServiceImpl { |
| 213 | 220 | return new ResponseBean(); |
| 214 | 221 | } |
| 215 | 222 | |
| 223 | + /** | |
| 224 | + * 根据评论进行禁言 | |
| 225 | + * | |
| 226 | + * @param commentId | |
| 227 | + * @param time | |
| 228 | + * @param userId | |
| 229 | + * @return | |
| 230 | + */ | |
| 216 | 231 | |
| 232 | + @Override | |
| 217 | 233 | public boolean writeNotSpeakByComment(Integer commentId, Integer time, String userId) { |
| 218 | 234 | boolean result = false; |
| 219 | 235 | ShyComments comment = shyCommentsMapper.selectByPrimaryKey(commentId); |
| ... | ... | @@ -236,7 +252,7 @@ public class NotspeakServiceImpl { |
| 236 | 252 | notspeak.setCount(notspeak.getCount() + 1); |
| 237 | 253 | notspeak.setUpdater(""); |
| 238 | 254 | notspeak.setAuditor(userId); |
| 239 | - result = updateshyNotspeak(notspeak); | |
| 255 | + result = updateShyNotSpeak(notspeak); | |
| 240 | 256 | } else { |
| 241 | 257 | shyNotspeak.setUser_name(comment.getComment_user_name()); |
| 242 | 258 | shyNotspeak.setUser_id(comment.getComment_user_id()); |
| ... | ... | @@ -252,16 +268,18 @@ public class NotspeakServiceImpl { |
| 252 | 268 | shyNotspeak.setCount(1); |
| 253 | 269 | shyNotspeak.setUpdater(""); |
| 254 | 270 | shyNotspeak.setAuditor(userId); |
| 255 | - result = impotshyNotspeak(shyNotspeak); | |
| 271 | + result = impotShyNotSpeak(shyNotspeak); | |
| 256 | 272 | } |
| 257 | 273 | return result; |
| 258 | 274 | } |
| 259 | 275 | |
| 260 | 276 | /** |
| 261 | 277 | * 获取禁言分页、条件查询列表 |
| 278 | + * | |
| 262 | 279 | * @param notSpeakDTO |
| 263 | 280 | * @return |
| 264 | 281 | */ |
| 282 | + @Override | |
| 265 | 283 | public PageInfo<ShyNotspeak> getPage(NotSpeakDTO notSpeakDTO) { |
| 266 | 284 | logger.info("接受参数对象为,NotSpeakDTO:{}", JSON.toJSONString(notSpeakDTO)); |
| 267 | 285 | Example example = new Example(ShyNotspeak.class); |
| ... | ... | @@ -289,30 +307,38 @@ public class NotspeakServiceImpl { |
| 289 | 307 | |
| 290 | 308 | /** |
| 291 | 309 | * 根据主键id查询禁言对象 |
| 310 | + * | |
| 292 | 311 | * @param id |
| 293 | 312 | * @return |
| 294 | 313 | */ |
| 314 | + @Override | |
| 295 | 315 | public ShyNotspeak selectByPrimaryKey(Integer id) { |
| 296 | - ShyNotspeak shyNotspeak = shyNotspeakMapper.selectByPrimaryKey(id); | |
| 297 | - return shyNotspeak; | |
| 316 | + return shyNotspeakMapper.selectByPrimaryKey(id); | |
| 298 | 317 | } |
| 299 | 318 | |
| 300 | 319 | /** |
| 301 | 320 | * 根据主键修改禁言对象 |
| 321 | + * | |
| 302 | 322 | * @param shyNotspeak |
| 303 | 323 | * @return |
| 304 | 324 | */ |
| 325 | + @Override | |
| 305 | 326 | public int updateByPrimaryKeySelective(ShyNotspeak shyNotspeak) { |
| 306 | 327 | return shyNotspeakMapper.updateByPrimaryKeySelective(shyNotspeak); |
| 307 | 328 | } |
| 308 | 329 | |
| 330 | + /** | |
| 331 | + * 获取禁言时间 | |
| 332 | + * | |
| 333 | + * @return | |
| 334 | + */ | |
| 335 | + @Override | |
| 309 | 336 | public List<ShyNotspeak> getNotSpeakByTime() { |
| 310 | 337 | Example example = new Example(ShyNotspeak.class); |
| 311 | 338 | Example.Criteria criteria = example.createCriteria(); |
| 312 | 339 | criteria.andEqualTo("state", CommonConst.SPEAK_NOT); |
| 313 | 340 | criteria.andLessThan("end_time", CommonUtils.getCurrentTime()); |
| 314 | - List<ShyNotspeak> shyNotspeakList = shyNotspeakMapper.selectByExample(example); | |
| 315 | - return shyNotspeakList; | |
| 341 | + return shyNotspeakMapper.selectByExample(example); | |
| 316 | 342 | } |
| 317 | 343 | } |
| 318 | 344 | ... | ... |
src/main/java/com/cnlive/shenhe/service/serviceImpl/SitesServiceImpl.java
| ... | ... | @@ -5,6 +5,7 @@ import com.cnlive.shenhe.dto.SitesDTO; |
| 5 | 5 | import com.cnlive.shenhe.entity.ShySites; |
| 6 | 6 | import com.cnlive.shenhe.entity.ShyUsers; |
| 7 | 7 | import com.cnlive.shenhe.mapper.ShySitesMapper; |
| 8 | +import com.cnlive.shenhe.service.SitesService; | |
| 8 | 9 | import com.cnlive.shenhe.utils.CommonUtils; |
| 9 | 10 | import com.github.pagehelper.PageHelper; |
| 10 | 11 | import com.github.pagehelper.PageInfo; |
| ... | ... | @@ -25,7 +26,7 @@ import java.util.List; |
| 25 | 26 | * @Description: |
| 26 | 27 | */ |
| 27 | 28 | @Service |
| 28 | -public class SitesServiceImpl { | |
| 29 | +public class SitesServiceImpl implements SitesService { | |
| 29 | 30 | |
| 30 | 31 | private static Logger logger = LoggerFactory.getLogger(SitesServiceImpl.class); |
| 31 | 32 | @Autowired |
| ... | ... | @@ -39,6 +40,7 @@ public class SitesServiceImpl { |
| 39 | 40 | * @param sitesDTO |
| 40 | 41 | * @return |
| 41 | 42 | */ |
| 43 | + @Override | |
| 42 | 44 | public PageInfo<ShySites> getPage(SitesDTO sitesDTO) { |
| 43 | 45 | logger.info("接受参数列表为,SitesDTO:{}", JSON.toJSONString(sitesDTO)); |
| 44 | 46 | Example example = new Example(ShySites.class); |
| ... | ... | @@ -68,6 +70,7 @@ public class SitesServiceImpl { |
| 68 | 70 | * @param siteId |
| 69 | 71 | * @return |
| 70 | 72 | */ |
| 73 | + @Override | |
| 71 | 74 | public ShySites get(Integer siteId) { |
| 72 | 75 | return shySitesMapper.selectByPrimaryKey(siteId); |
| 73 | 76 | } |
| ... | ... | @@ -78,6 +81,7 @@ public class SitesServiceImpl { |
| 78 | 81 | * @param site |
| 79 | 82 | * @return |
| 80 | 83 | */ |
| 84 | + @Override | |
| 81 | 85 | public boolean update(ShySites site) { |
| 82 | 86 | return shySitesMapper.updateByPrimaryKeySelective(site) == 1; |
| 83 | 87 | } |
| ... | ... | @@ -88,12 +92,11 @@ public class SitesServiceImpl { |
| 88 | 92 | * @param spId |
| 89 | 93 | * @return |
| 90 | 94 | */ |
| 95 | + @Override | |
| 91 | 96 | public ShySites findspidDescByspid(int spId) { |
| 92 | 97 | Example example = new Example(ShySites.class); |
| 93 | 98 | Example.Criteria criteria = example.createCriteria(); |
| 94 | - if (CommonUtils.isNotNull(spId)) { | |
| 95 | - criteria.andEqualTo("spid", spId); | |
| 96 | - } | |
| 99 | + criteria.andEqualTo("spid", spId); | |
| 97 | 100 | List<ShySites> shySites = shySitesMapper.selectByExample(example); |
| 98 | 101 | if (CommonUtils.isNotNull(shySites) && shySites.size() > 0) { |
| 99 | 102 | return shySites.get(0); |
| ... | ... | @@ -104,14 +107,15 @@ public class SitesServiceImpl { |
| 104 | 107 | /** |
| 105 | 108 | * 根据name查询白名单对象 |
| 106 | 109 | * |
| 107 | - * @param sp_desc | |
| 110 | + * @param spDesc | |
| 108 | 111 | * @return |
| 109 | 112 | */ |
| 110 | - public ShySites findspidBySpdesc(String sp_desc) { | |
| 113 | + @Override | |
| 114 | + public ShySites findspidBySpdesc(String spDesc) { | |
| 111 | 115 | Example example = new Example(ShySites.class); |
| 112 | 116 | Example.Criteria criteria = example.createCriteria(); |
| 113 | - if (CommonUtils.isNotEmpty(sp_desc)) { | |
| 114 | - criteria.andEqualTo("name", sp_desc); | |
| 117 | + if (CommonUtils.isNotEmpty(spDesc)) { | |
| 118 | + criteria.andEqualTo("name", spDesc); | |
| 115 | 119 | } |
| 116 | 120 | List<ShySites> shySites = shySitesMapper.selectByExample(example); |
| 117 | 121 | if (CommonUtils.isNotNull(shySites) && shySites.size() > 0) { |
| ... | ... | @@ -125,6 +129,7 @@ public class SitesServiceImpl { |
| 125 | 129 | * |
| 126 | 130 | * @return |
| 127 | 131 | */ |
| 132 | + @Override | |
| 128 | 133 | public List<Integer> getBusinessList(Integer business_) { |
| 129 | 134 | List<ShySites> sitesList = shySitesMapper.selectAll(); |
| 130 | 135 | List<Integer> sites = new ArrayList<Integer>(); |
| ... | ... | @@ -144,19 +149,18 @@ public class SitesServiceImpl { |
| 144 | 149 | * 获取用户(操作人) |
| 145 | 150 | * |
| 146 | 151 | * @param updater |
| 147 | - * @param auditor_id | |
| 152 | + * @param auditorId | |
| 148 | 153 | * @return |
| 149 | 154 | */ |
| 150 | - public String getUpdater(String updater, String auditor_id) { | |
| 151 | - | |
| 152 | - if (CommonUtils.isNotEmpty(auditor_id)) { | |
| 155 | + @Override | |
| 156 | + public String getUpdater(String updater, String auditorId) { | |
| 157 | + if (CommonUtils.isNotEmpty(auditorId)) { | |
| 153 | 158 | ShyUsers user = new ShyUsers(); |
| 154 | - user.setUser_id(auditor_id); | |
| 159 | + user.setUser_id(auditorId); | |
| 155 | 160 | user = usersService.select(user); |
| 156 | 161 | if (CommonUtils.isNotNull(user)) { |
| 157 | 162 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 158 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 159 | - updater = userName; | |
| 163 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 160 | 164 | } |
| 161 | 165 | } |
| 162 | 166 | return updater; | ... | ... |
src/main/java/com/cnlive/shenhe/service/serviceImpl/TopicServiceImpl.java
| ... | ... | @@ -3,9 +3,9 @@ package com.cnlive.shenhe.service.serviceImpl; |
| 3 | 3 | import com.alibaba.fastjson.JSON; |
| 4 | 4 | import com.alibaba.fastjson.JSONObject; |
| 5 | 5 | import com.cnlive.shenhe.dto.TopicDTO; |
| 6 | -import com.cnlive.shenhe.entity.ShyContent; | |
| 7 | 6 | import com.cnlive.shenhe.entity.ShyTopic; |
| 8 | 7 | import com.cnlive.shenhe.mapper.ShyTopicMapper; |
| 8 | +import com.cnlive.shenhe.service.SitesService; | |
| 9 | 9 | import com.cnlive.shenhe.utils.CommonConst; |
| 10 | 10 | import com.cnlive.shenhe.utils.CommonUtils; |
| 11 | 11 | import com.cnlive.shenhe.utils.TransitServiceUtils; |
| ... | ... | @@ -18,7 +18,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
| 18 | 18 | import org.springframework.stereotype.Service; |
| 19 | 19 | import tk.mybatis.mapper.entity.Example; |
| 20 | 20 | |
| 21 | -import java.util.Date; | |
| 22 | 21 | import java.util.List; |
| 23 | 22 | |
| 24 | 23 | /** |
| ... | ... | @@ -35,7 +34,7 @@ public class TopicServiceImpl { |
| 35 | 34 | @Autowired |
| 36 | 35 | TransitServiceUtils transitServiceUtils; |
| 37 | 36 | @Autowired |
| 38 | - SitesServiceImpl sitesService; | |
| 37 | + SitesService sitesService; | |
| 39 | 38 | |
| 40 | 39 | public ShyTopic getShyTopic(ShyTopic shyTopic) { |
| 41 | 40 | List<ShyTopic> shyTopicList = shyTopicMapper.select(shyTopic); |
| ... | ... | @@ -63,10 +62,7 @@ public class TopicServiceImpl { |
| 63 | 62 | */ |
| 64 | 63 | public boolean updateshyTopic(ShyTopic shyTopic) { |
| 65 | 64 | int result = shyTopicMapper.updateByPrimaryKey(shyTopic); |
| 66 | - if (result == 0) { | |
| 67 | - return false; | |
| 68 | - } | |
| 69 | - return true; | |
| 65 | + return result != 0; | |
| 70 | 66 | } |
| 71 | 67 | |
| 72 | 68 | /** |
| ... | ... | @@ -77,10 +73,7 @@ public class TopicServiceImpl { |
| 77 | 73 | */ |
| 78 | 74 | public boolean impotshyTopic(ShyTopic shyTopic) { |
| 79 | 75 | int result = shyTopicMapper.insertSelective(shyTopic); |
| 80 | - if (result == 0) { | |
| 81 | - return false; | |
| 82 | - } | |
| 83 | - return true; | |
| 76 | + return result != 0; | |
| 84 | 77 | } |
| 85 | 78 | |
| 86 | 79 | /** |
| ... | ... | @@ -135,47 +128,6 @@ public class TopicServiceImpl { |
| 135 | 128 | return pageInfo; |
| 136 | 129 | } |
| 137 | 130 | |
| 138 | - /** | |
| 139 | - * 根据条件导出数据excel | |
| 140 | - * | |
| 141 | - * @return | |
| 142 | - */ | |
| 143 | - public List<ShyTopic> findByCondition(String title, String content_tag, String contentId, Date start_date, | |
| 144 | - Date end_date, Integer receive_status, Integer page, | |
| 145 | - Integer pageSize, String orderByClause, Integer spid) { | |
| 146 | - | |
| 147 | - Example example = new Example(ShyContent.class); | |
| 148 | - Example.Criteria criteria = example.createCriteria(); | |
| 149 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 150 | - example.setOrderByClause(orderByClause); | |
| 151 | - } else { | |
| 152 | - example.setOrderByClause("create_date desc"); | |
| 153 | - } | |
| 154 | - if (CommonUtils.isNotNull(start_date)) { | |
| 155 | - criteria.andGreaterThanOrEqualTo("create_date", start_date); | |
| 156 | - } | |
| 157 | - if (CommonUtils.isNotNull(end_date)) { | |
| 158 | - criteria.andLessThanOrEqualTo("create_date", end_date); | |
| 159 | - } | |
| 160 | - if (CommonUtils.isNotEmpty(title)) { | |
| 161 | - criteria.andLike("title", "%" + title + "%"); | |
| 162 | - } | |
| 163 | - if (CommonUtils.isNotNull(spid)) { | |
| 164 | - criteria.andEqualTo("sp_id", spid); | |
| 165 | - } | |
| 166 | - if (CommonUtils.isNotEmpty(contentId)) { | |
| 167 | - criteria.andEqualTo("content_id", contentId); | |
| 168 | - } | |
| 169 | - if (CommonUtils.isNotEmpty(content_tag)) { | |
| 170 | - criteria.andEqualTo("content_tag", content_tag); | |
| 171 | - } | |
| 172 | - if (CommonUtils.isNotNull(receive_status)) { | |
| 173 | - criteria.andEqualTo("receive_status", receive_status); | |
| 174 | - } | |
| 175 | - List<ShyTopic> shyContentList = shyTopicMapper.selectByExample(example); | |
| 176 | - return shyContentList; | |
| 177 | - } | |
| 178 | - | |
| 179 | 131 | |
| 180 | 132 | /** |
| 181 | 133 | * 话题回调 |
| ... | ... | @@ -216,7 +168,6 @@ public class TopicServiceImpl { |
| 216 | 168 | if (i != 1) { |
| 217 | 169 | success = false; |
| 218 | 170 | } |
| 219 | - | |
| 220 | 171 | return success; |
| 221 | 172 | } |
| 222 | 173 | |
| ... | ... | @@ -228,8 +179,7 @@ public class TopicServiceImpl { |
| 228 | 179 | * @return |
| 229 | 180 | */ |
| 230 | 181 | public ShyTopic selectByPrimaryKey(Integer id) { |
| 231 | - ShyTopic shyTopic = shyTopicMapper.selectByPrimaryKey(id); | |
| 232 | - return shyTopic; | |
| 182 | + return shyTopicMapper.selectByPrimaryKey(id); | |
| 233 | 183 | } |
| 234 | 184 | |
| 235 | 185 | /** | ... | ... |
src/main/java/com/cnlive/shenhe/service/serviceImpl/VideosServiceImpl.java
| ... | ... | @@ -13,6 +13,7 @@ import com.cnlive.shenhe.entity.ShyYidun; |
| 13 | 13 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| 14 | 14 | import com.cnlive.shenhe.mapper.ShyVideosMapper; |
| 15 | 15 | import com.cnlive.shenhe.service.ShyActivityService; |
| 16 | +import com.cnlive.shenhe.service.SitesService; | |
| 16 | 17 | import com.cnlive.shenhe.utils.*; |
| 17 | 18 | import com.github.pagehelper.PageHelper; |
| 18 | 19 | import com.github.pagehelper.PageInfo; |
| ... | ... | @@ -46,7 +47,7 @@ public class VideosServiceImpl { |
| 46 | 47 | @Autowired |
| 47 | 48 | private VideosServiceImpl videosService; |
| 48 | 49 | @Autowired |
| 49 | - private SitesServiceImpl sitesService; | |
| 50 | + private SitesService sitesService; | |
| 50 | 51 | @Autowired |
| 51 | 52 | private UsersfreeServiceImpl usersfreeServiceImpl; |
| 52 | 53 | @Autowired |
| ... | ... | @@ -68,10 +69,7 @@ public class VideosServiceImpl { |
| 68 | 69 | */ |
| 69 | 70 | public boolean impotVideo(ShyVideos shyVideos) { |
| 70 | 71 | int result = shyVideosMapper.insertSelective(shyVideos); |
| 71 | - if (result == 0) { | |
| 72 | - return false; | |
| 73 | - } | |
| 74 | - return true; | |
| 72 | + return result != 0; | |
| 75 | 73 | } |
| 76 | 74 | |
| 77 | 75 | /** |
| ... | ... | @@ -81,8 +79,7 @@ public class VideosServiceImpl { |
| 81 | 79 | * @return |
| 82 | 80 | */ |
| 83 | 81 | public ShyVideos selectByPrimaryKey(Integer id) { |
| 84 | - ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id); | |
| 85 | - return shyVideos; | |
| 82 | + return shyVideosMapper.selectByPrimaryKey(id); | |
| 86 | 83 | } |
| 87 | 84 | |
| 88 | 85 | /** |
| ... | ... | @@ -92,8 +89,7 @@ public class VideosServiceImpl { |
| 92 | 89 | * @return |
| 93 | 90 | */ |
| 94 | 91 | public List<ShyVideos> findshyVideo(ShyVideos shyVideos) { |
| 95 | - List<ShyVideos> shyVideoslist = shyVideosMapper.selectByRowBounds(shyVideos, new RowBounds(0, 100)); | |
| 96 | - return shyVideoslist; | |
| 92 | + return shyVideosMapper.selectByRowBounds(shyVideos, new RowBounds(0, 100)); | |
| 97 | 93 | } |
| 98 | 94 | |
| 99 | 95 | /** |
| ... | ... | @@ -104,10 +100,7 @@ public class VideosServiceImpl { |
| 104 | 100 | */ |
| 105 | 101 | public boolean updateshyVideos(ShyVideos shyVideos) { |
| 106 | 102 | int i = shyVideosMapper.updateByPrimaryKeySelective(shyVideos); |
| 107 | - if (i == 0) { | |
| 108 | - return false; | |
| 109 | - } | |
| 110 | - return true; | |
| 103 | + return i != 0; | |
| 111 | 104 | } |
| 112 | 105 | |
| 113 | 106 | /** |
| ... | ... | @@ -240,8 +233,7 @@ public class VideosServiceImpl { |
| 240 | 233 | user.setUser_id(auditorId); |
| 241 | 234 | user = shyUsersMapper.selectOne(user); |
| 242 | 235 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 243 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 244 | - updater = userName; | |
| 236 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 245 | 237 | } |
| 246 | 238 | shyVideos.setUpdater(updater); |
| 247 | 239 | } |
| ... | ... | @@ -366,8 +358,7 @@ public class VideosServiceImpl { |
| 366 | 358 | } |
| 367 | 359 | } |
| 368 | 360 | //默认按上传时间倒序排序 |
| 369 | - List<ShyVideos> shyVideosList = shyVideosMapper.selectByExample(example); | |
| 370 | - return shyVideosList; | |
| 361 | + return shyVideosMapper.selectByExample(example); | |
| 371 | 362 | } |
| 372 | 363 | |
| 373 | 364 | /** |
| ... | ... | @@ -375,9 +366,8 @@ public class VideosServiceImpl { |
| 375 | 366 | * type:1:文本 2:图片 3.网页 4:点播音频 |
| 376 | 367 | * |
| 377 | 368 | * @param cid 审核云中视频的id |
| 378 | - * @return | |
| 379 | 369 | */ |
| 380 | - public int videoFilter(Integer cid) { | |
| 370 | + public void videoFilter(Integer cid) { | |
| 381 | 371 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(cid); |
| 382 | 372 | shyVideos.setUpdater("自动审核"); |
| 383 | 373 | Integer plat = shyVideos.getPlat(); |
| ... | ... | @@ -431,13 +421,10 @@ public class VideosServiceImpl { |
| 431 | 421 | shyYidun.setCheck_type(CommonConstStates.TUPIAN); |
| 432 | 422 | shyYidun.setDuration(shyVideos.getDuration()); |
| 433 | 423 | shyYidun.setCreate_time(new Date()); |
| 434 | - | |
| 435 | 424 | yiDunServiceImpl.addYiDunMsg(shyYidun); |
| 436 | - | |
| 437 | 425 | } catch (Exception e) { |
| 438 | 426 | e.printStackTrace(); |
| 439 | 427 | } |
| 440 | - return 0; | |
| 441 | 428 | } |
| 442 | 429 | |
| 443 | 430 | /** | ... | ... |