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