Commit 8f62499fc1757e1a65e896213b419888e48ead39
1 parent
90ec071e
开发用户白名单、用户管理service接口并优化
Showing
25 changed files
with
262 additions
and
140 deletions
src/main/java/com/cnlive/shenhe/controller/AudioController.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.AudioService; | 12 | import com.cnlive.shenhe.service.AudioService; |
| 13 | import com.cnlive.shenhe.service.SitesService; | 13 | import com.cnlive.shenhe.service.SitesService; |
| 14 | -import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; | 14 | +import com.cnlive.shenhe.service.UsersService; |
| 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; |
| 17 | import com.cnlive.shenhe.utils.CommonUtils; | 17 | import com.cnlive.shenhe.utils.CommonUtils; |
| @@ -54,7 +54,7 @@ public class AudioController extends BaseController { | @@ -54,7 +54,7 @@ public class AudioController extends BaseController { | ||
| 54 | AudioService audioService; | 54 | AudioService audioService; |
| 55 | 55 | ||
| 56 | @Autowired | 56 | @Autowired |
| 57 | - UsersServiceImpl usersService; | 57 | + UsersService usersService; |
| 58 | 58 | ||
| 59 | @Value("${qn_domain}") | 59 | @Value("${qn_domain}") |
| 60 | String qn_domain; | 60 | String qn_domain; |
| @@ -427,20 +427,20 @@ public class AudioController extends BaseController { | @@ -427,20 +427,20 @@ public class AudioController extends BaseController { | ||
| 427 | /** | 427 | /** |
| 428 | * 审核结果更新并通知点播音频 | 428 | * 审核结果更新并通知点播音频 |
| 429 | * | 429 | * |
| 430 | - * @param activityId 音频id(audioId) | 430 | + * @param activity_id 音频id(audioId) |
| 431 | * @param state 状态码 | 431 | * @param state 状态码 |
| 432 | - * @param attrTags 常用审核意见(标签) | 432 | + * @param attr_tags 常用审核意见(标签) |
| 433 | * @param msg 审核备注 | 433 | * @param msg 审核备注 |
| 434 | * @return | 434 | * @return |
| 435 | */ | 435 | */ |
| 436 | @PostMapping("/shenheAudio") | 436 | @PostMapping("/shenheAudio") |
| 437 | @ResponseBody | 437 | @ResponseBody |
| 438 | - public ResponseBean shenheInfo(Integer id, String activityId, Integer state, String attrTags, String msg, String callback, HttpSession session) { | 438 | + public ResponseBean shenheInfo(Integer id, String activity_id, Integer state, String attr_tags, String msg, String callback, HttpSession session) { |
| 439 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | 439 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 440 | String userId = sessionUser.getUserId(); | 440 | String userId = sessionUser.getUserId(); |
| 441 | JSONObject result; | 441 | JSONObject result; |
| 442 | try { | 442 | try { |
| 443 | - result = pass.audioPass(activityId, state, attrTags, msg, callback); | 443 | + result = pass.audioPass(activity_id, state, attr_tags, msg, callback); |
| 444 | } catch (Exception e) { | 444 | } catch (Exception e) { |
| 445 | e.printStackTrace(); | 445 | e.printStackTrace(); |
| 446 | System.out.println("音频审核失败"); | 446 | System.out.println("音频审核失败"); |
| @@ -456,7 +456,7 @@ public class AudioController extends BaseController { | @@ -456,7 +456,7 @@ public class AudioController extends BaseController { | ||
| 456 | return new ResponseBean(code, result.getString("msg")); | 456 | return new ResponseBean(code, result.getString("msg")); |
| 457 | } | 457 | } |
| 458 | state = state == 4 ? 2 : 1; | 458 | state = state == 4 ? 2 : 1; |
| 459 | - int i = audioService.updateAudio(id, userId, null, attrTags, state, msg); | 459 | + int i = audioService.updateAudio(id, userId, null, attr_tags, state, msg); |
| 460 | if (i == 0) { | 460 | if (i == 0) { |
| 461 | return new ResponseBean(ErrorEnum.ERROR); | 461 | return new ResponseBean(ErrorEnum.ERROR); |
| 462 | } | 462 | } |
src/main/java/com/cnlive/shenhe/controller/ChannelController.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.ChannelService; | 12 | import com.cnlive.shenhe.service.ChannelService; |
| 13 | import com.cnlive.shenhe.service.SitesService; | 13 | import com.cnlive.shenhe.service.SitesService; |
| 14 | -import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; | 14 | +import com.cnlive.shenhe.service.UsersService; |
| 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; |
| 17 | import com.cnlive.shenhe.utils.CommonUtils; | 17 | import com.cnlive.shenhe.utils.CommonUtils; |
| @@ -45,7 +45,7 @@ public class ChannelController extends BaseController { | @@ -45,7 +45,7 @@ public class ChannelController extends BaseController { | ||
| 45 | ChannelService channelService; | 45 | ChannelService channelService; |
| 46 | 46 | ||
| 47 | @Autowired | 47 | @Autowired |
| 48 | - UsersServiceImpl usersService; | 48 | + UsersService usersService; |
| 49 | 49 | ||
| 50 | @Autowired | 50 | @Autowired |
| 51 | SitesService sitesService; | 51 | SitesService sitesService; |
src/main/java/com/cnlive/shenhe/controller/CommentsController.java
| @@ -13,7 +13,7 @@ import com.cnlive.shenhe.entity.ShyUsers; | @@ -13,7 +13,7 @@ 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.SitesService; | 15 | import com.cnlive.shenhe.service.SitesService; |
| 16 | -import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; | 16 | +import com.cnlive.shenhe.service.UsersService; |
| 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; |
| 19 | import com.cnlive.shenhe.utils.CommonUtils; | 19 | import com.cnlive.shenhe.utils.CommonUtils; |
| @@ -46,7 +46,7 @@ public class CommentsController extends BaseController { | @@ -46,7 +46,7 @@ public class CommentsController extends BaseController { | ||
| 46 | CommentsService commentsService; | 46 | CommentsService commentsService; |
| 47 | 47 | ||
| 48 | @Autowired | 48 | @Autowired |
| 49 | - UsersServiceImpl usersService; | 49 | + UsersService usersService; |
| 50 | 50 | ||
| 51 | @Autowired | 51 | @Autowired |
| 52 | SitesService sitesService; | 52 | SitesService sitesService; |
src/main/java/com/cnlive/shenhe/controller/ContentController.java
| @@ -10,7 +10,7 @@ import com.cnlive.shenhe.entity.ShySites; | @@ -10,7 +10,7 @@ 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.SitesService; | 12 | import com.cnlive.shenhe.service.SitesService; |
| 13 | -import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; | 13 | +import com.cnlive.shenhe.service.UsersService; |
| 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; |
| 16 | import com.github.pagehelper.PageInfo; | 16 | import com.github.pagehelper.PageInfo; |
| @@ -45,7 +45,7 @@ public class ContentController extends BaseController { | @@ -45,7 +45,7 @@ public class ContentController extends BaseController { | ||
| 45 | SitesService sitesService; | 45 | SitesService sitesService; |
| 46 | 46 | ||
| 47 | @Autowired | 47 | @Autowired |
| 48 | - UsersServiceImpl usersService; | 48 | + UsersService usersService; |
| 49 | 49 | ||
| 50 | /** | 50 | /** |
| 51 | * 图文列表 | 51 | * 图文列表 |
src/main/java/com/cnlive/shenhe/controller/EmailController.java
| @@ -9,7 +9,7 @@ import com.cnlive.shenhe.dto.EmailDTO; | @@ -9,7 +9,7 @@ import com.cnlive.shenhe.dto.EmailDTO; | ||
| 9 | import com.cnlive.shenhe.entity.ShyEmail; | 9 | import com.cnlive.shenhe.entity.ShyEmail; |
| 10 | import com.cnlive.shenhe.entity.ShyUsers; | 10 | import com.cnlive.shenhe.entity.ShyUsers; |
| 11 | import com.cnlive.shenhe.service.EmailService; | 11 | import com.cnlive.shenhe.service.EmailService; |
| 12 | -import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; | 12 | +import com.cnlive.shenhe.service.UsersService; |
| 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; |
| 15 | import com.github.pagehelper.PageInfo; | 15 | import com.github.pagehelper.PageInfo; |
| @@ -39,7 +39,7 @@ public class EmailController extends BaseController { | @@ -39,7 +39,7 @@ public class EmailController extends BaseController { | ||
| 39 | @Autowired | 39 | @Autowired |
| 40 | EmailService emailService; | 40 | EmailService emailService; |
| 41 | @Autowired | 41 | @Autowired |
| 42 | - UsersServiceImpl usersService; | 42 | + UsersService usersService; |
| 43 | 43 | ||
| 44 | /** | 44 | /** |
| 45 | * 展示分页 条件查询结果 | 45 | * 展示分页 条件查询结果 |
| @@ -69,8 +69,7 @@ public class EmailController extends BaseController { | @@ -69,8 +69,7 @@ public class EmailController extends BaseController { | ||
| 69 | user = usersService.select(user); | 69 | user = usersService.select(user); |
| 70 | if (CommonUtils.isNotNull(user)) { | 70 | if (CommonUtils.isNotNull(user)) { |
| 71 | String emailAdd = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 71 | String emailAdd = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 72 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? emailAdd : user.getUsername(); | ||
| 73 | - updater = userName; | 72 | + updater = CommonUtils.isEmpty(user.getUsername()) ? emailAdd : user.getUsername(); |
| 74 | } | 73 | } |
| 75 | } | 74 | } |
| 76 | shyEmail.setUpdater(updater); | 75 | shyEmail.setUpdater(updater); |
| @@ -106,7 +105,7 @@ public class EmailController extends BaseController { | @@ -106,7 +105,7 @@ public class EmailController extends BaseController { | ||
| 106 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | 105 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 107 | Integer n = emailService.updateState(id, isEnable, sessionUser.getUserId()); | 106 | Integer n = emailService.updateState(id, isEnable, sessionUser.getUserId()); |
| 108 | if (n > 0) { | 107 | if (n > 0) { |
| 109 | - return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前用户" + (isEnable == true ? "启用" : "禁用") + "成功"); | 108 | + return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前用户" + (isEnable ? "启用" : "禁用") + "成功"); |
| 110 | } | 109 | } |
| 111 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "操作失败,请重试"); | 110 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "操作失败,请重试"); |
| 112 | } | 111 | } |
| @@ -148,14 +147,14 @@ public class EmailController extends BaseController { | @@ -148,14 +147,14 @@ public class EmailController extends BaseController { | ||
| 148 | return "error.html"; | 147 | return "error.html"; |
| 149 | } | 148 | } |
| 150 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | 149 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 151 | - String write = ""; | 150 | + StringBuilder write = new StringBuilder(); |
| 152 | if (CommonUtils.isNotNull(write_business) && write_business.length > 0) { | 151 | if (CommonUtils.isNotNull(write_business) && write_business.length > 0) { |
| 153 | for (String w : write_business) { | 152 | for (String w : write_business) { |
| 154 | - write = write + "," + w; | 153 | + write.append(",").append(w); |
| 155 | } | 154 | } |
| 156 | - write = write.substring(1); | 155 | + write = new StringBuilder(write.substring(1)); |
| 157 | } | 156 | } |
| 158 | - boolean success = emailService.update(id, email, remark, write, sessionUser.getUserId()); | 157 | + boolean success = emailService.update(id, email, remark, write.toString(), sessionUser.getUserId()); |
| 159 | if (success) { | 158 | if (success) { |
| 160 | return "redirect:" + redirect_url; | 159 | return "redirect:" + redirect_url; |
| 161 | } else { | 160 | } else { |
src/main/java/com/cnlive/shenhe/controller/LiveApplyController.java
| @@ -12,7 +12,7 @@ import com.cnlive.shenhe.entity.ShyUsers; | @@ -12,7 +12,7 @@ import com.cnlive.shenhe.entity.ShyUsers; | ||
| 12 | import com.cnlive.shenhe.service.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.SitesService; | 14 | import com.cnlive.shenhe.service.SitesService; |
| 15 | -import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; | 15 | +import com.cnlive.shenhe.service.UsersService; |
| 16 | import com.cnlive.shenhe.utils.AuditPass; | 16 | import com.cnlive.shenhe.utils.AuditPass; |
| 17 | import com.cnlive.shenhe.utils.CommonConst; | 17 | import com.cnlive.shenhe.utils.CommonConst; |
| 18 | import com.cnlive.shenhe.utils.CommonUtils; | 18 | import com.cnlive.shenhe.utils.CommonUtils; |
| @@ -50,7 +50,7 @@ public class LiveApplyController extends BaseController { | @@ -50,7 +50,7 @@ public class LiveApplyController extends BaseController { | ||
| 50 | @Autowired | 50 | @Autowired |
| 51 | AuditPass pass; | 51 | AuditPass pass; |
| 52 | @Autowired | 52 | @Autowired |
| 53 | - UsersServiceImpl usersService; | 53 | + UsersService usersService; |
| 54 | @Autowired | 54 | @Autowired |
| 55 | SitesService sitesService; | 55 | SitesService sitesService; |
| 56 | @Autowired | 56 | @Autowired |
| @@ -268,7 +268,7 @@ public class LiveApplyController extends BaseController { | @@ -268,7 +268,7 @@ public class LiveApplyController extends BaseController { | ||
| 268 | String showMsg = ""; | 268 | String showMsg = ""; |
| 269 | for (String shyLiveId : shyLiveIds) { | 269 | for (String shyLiveId : shyLiveIds) { |
| 270 | ShyLiveapply shyLiveapply = liveApplyService.selectByPrimaryKey(Integer.parseInt(shyLiveId)); | 270 | ShyLiveapply shyLiveapply = liveApplyService.selectByPrimaryKey(Integer.parseInt(shyLiveId)); |
| 271 | - JSONObject result = null; | 271 | + JSONObject result; |
| 272 | try { | 272 | try { |
| 273 | result = pass.liveApplyPass(shyLiveapply.getActivity_id(), 4, msg, msg, shyLiveapply.getCallback()); | 273 | result = pass.liveApplyPass(shyLiveapply.getActivity_id(), 4, msg, msg, shyLiveapply.getCallback()); |
| 274 | } catch (Exception e) { | 274 | } catch (Exception e) { |
src/main/java/com/cnlive/shenhe/controller/LiveController.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.LiveService; | 12 | import com.cnlive.shenhe.service.LiveService; |
| 13 | import com.cnlive.shenhe.service.SitesService; | 13 | import com.cnlive.shenhe.service.SitesService; |
| 14 | -import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; | 14 | +import com.cnlive.shenhe.service.UsersService; |
| 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; |
| 17 | import com.cnlive.shenhe.utils.CommonConst; | 17 | import com.cnlive.shenhe.utils.CommonConst; |
| @@ -53,7 +53,7 @@ public class LiveController extends BaseController { | @@ -53,7 +53,7 @@ public class LiveController extends BaseController { | ||
| 53 | @Autowired | 53 | @Autowired |
| 54 | VideosServiceImpl videosService; | 54 | VideosServiceImpl videosService; |
| 55 | @Autowired | 55 | @Autowired |
| 56 | - UsersServiceImpl usersService; | 56 | + UsersService usersService; |
| 57 | @Autowired | 57 | @Autowired |
| 58 | SitesService sitesService; | 58 | SitesService sitesService; |
| 59 | @Autowired | 59 | @Autowired |
| @@ -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 activityId 视频id | 74 | + * @param activity_id 视频id |
| 75 | * @param state 状态码 | 75 | * @param state 状态码 |
| 76 | - * @param attrTags 标签 | 76 | + * @param attr_tags 标签 |
| 77 | * @param msg 备注信息 | 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 activityId, Integer state, String attrTags, String msg, String callback, HttpSession session) { | 82 | + public ResponseBean shenheInfo(Integer id, String activity_id, Integer state, String attr_tags, 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; |
| 86 | try { | 86 | try { |
| 87 | - result = pass.auditPass(activityId, state, attrTags, msg, callback); | 87 | + result = pass.auditPass(activity_id, state, attr_tags, 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, attrTags, state, msg); | 103 | + int i = videosService.updateVideo(id, userId, null, attr_tags, state, msg); |
| 104 | if (i == 0) { | 104 | if (i == 0) { |
| 105 | return new ResponseBean(ErrorEnum.ERROR); | 105 | return new ResponseBean(ErrorEnum.ERROR); |
| 106 | } | 106 | } |
| @@ -540,6 +540,4 @@ public class LiveController extends BaseController { | @@ -540,6 +540,4 @@ public class LiveController extends BaseController { | ||
| 540 | } | 540 | } |
| 541 | } | 541 | } |
| 542 | } | 542 | } |
| 543 | - | ||
| 544 | - | ||
| 545 | } | 543 | } |
src/main/java/com/cnlive/shenhe/controller/NotSpeakController.java
| @@ -10,7 +10,7 @@ import com.cnlive.shenhe.entity.ShySites; | @@ -10,7 +10,7 @@ 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.NotspeakService; | 11 | import com.cnlive.shenhe.service.NotspeakService; |
| 12 | import com.cnlive.shenhe.service.SitesService; | 12 | import com.cnlive.shenhe.service.SitesService; |
| 13 | -import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; | 13 | +import com.cnlive.shenhe.service.UsersService; |
| 14 | import com.cnlive.shenhe.utils.CommonUtils; | 14 | import com.cnlive.shenhe.utils.CommonUtils; |
| 15 | import com.github.pagehelper.PageInfo; | 15 | import com.github.pagehelper.PageInfo; |
| 16 | import org.slf4j.Logger; | 16 | import org.slf4j.Logger; |
| @@ -37,7 +37,7 @@ public class NotSpeakController extends BaseController { | @@ -37,7 +37,7 @@ public class NotSpeakController extends BaseController { | ||
| 37 | @Autowired | 37 | @Autowired |
| 38 | NotspeakService notSpeakService; | 38 | NotspeakService notSpeakService; |
| 39 | @Autowired | 39 | @Autowired |
| 40 | - UsersServiceImpl usersService; | 40 | + UsersService usersService; |
| 41 | @Autowired | 41 | @Autowired |
| 42 | SitesService sitesService; | 42 | SitesService sitesService; |
| 43 | 43 |
src/main/java/com/cnlive/shenhe/controller/SitesController.java
| @@ -65,15 +65,15 @@ public class SitesController extends BaseController { | @@ -65,15 +65,15 @@ public class SitesController extends BaseController { | ||
| 65 | if (!list.isEmpty()) { | 65 | if (!list.isEmpty()) { |
| 66 | for (ShySites site : list) { | 66 | for (ShySites site : list) { |
| 67 | 67 | ||
| 68 | - String writeBusinessName = site.getWrite_business(); | ||
| 69 | - if (CommonUtils.isNotEmpty(writeBusinessName)) { | 68 | + String write_businessName = site.getWrite_business(); |
| 69 | + if (CommonUtils.isNotEmpty(write_businessName)) { | ||
| 70 | for (String bkey : business.keySet()) { | 70 | for (String bkey : business.keySet()) { |
| 71 | - writeBusinessName = writeBusinessName.replace(bkey, business.getString(bkey)); | 71 | + write_businessName = write_businessName.replace(bkey, business.getString(bkey)); |
| 72 | } | 72 | } |
| 73 | } else { | 73 | } else { |
| 74 | - writeBusinessName = "无"; | 74 | + write_businessName = "无"; |
| 75 | } | 75 | } |
| 76 | - site.setWrite_business_name(writeBusinessName); | 76 | + site.setWrite_business_name(write_businessName); |
| 77 | } | 77 | } |
| 78 | } | 78 | } |
| 79 | model.addAttribute("sitePage", sitePage); | 79 | model.addAttribute("sitePage", sitePage); |
| @@ -84,15 +84,15 @@ public class SitesController extends BaseController { | @@ -84,15 +84,15 @@ 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[] writeBusiness, HttpSession session, String redirectUrl) { | 87 | + public String write(Model model, Integer siteId, String[] write_business, HttpSession session, String redirect_url) { |
| 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 | StringBuilder write = new StringBuilder(); | 93 | StringBuilder write = new StringBuilder(); |
| 94 | - if (CommonUtils.isNotNull(writeBusiness) && writeBusiness.length > 0) { | ||
| 95 | - for (String w : writeBusiness) { | 94 | + if (CommonUtils.isNotNull(write_business) && write_business.length > 0) { |
| 95 | + for (String w : write_business) { | ||
| 96 | write.append(",").append(w); | 96 | write.append(",").append(w); |
| 97 | } | 97 | } |
| 98 | write = new StringBuilder(write.substring(1)); | 98 | write = new StringBuilder(write.substring(1)); |
| @@ -100,7 +100,7 @@ public class SitesController extends BaseController { | @@ -100,7 +100,7 @@ public class SitesController extends BaseController { | ||
| 100 | site.setWrite_business(write.toString()); | 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:" + redirectUrl; | 103 | + return "redirect:" + redirect_url; |
| 104 | } else { | 104 | } else { |
| 105 | setmodelResult(model); | 105 | setmodelResult(model); |
| 106 | return "error.html"; | 106 | return "error.html"; |
src/main/java/com/cnlive/shenhe/controller/UsersController.java
| @@ -9,7 +9,7 @@ import com.cnlive.shenhe.entity.ShySites; | @@ -9,7 +9,7 @@ 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.SitesService; | 11 | import com.cnlive.shenhe.service.SitesService; |
| 12 | -import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; | 12 | +import com.cnlive.shenhe.service.UsersService; |
| 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; |
| 15 | import com.github.pagehelper.PageInfo; | 15 | import com.github.pagehelper.PageInfo; |
| @@ -40,7 +40,7 @@ public class UsersController extends BaseController { | @@ -40,7 +40,7 @@ public class UsersController extends BaseController { | ||
| 40 | private static Logger logger = LoggerFactory.getLogger(UsersController.class); | 40 | private static Logger logger = LoggerFactory.getLogger(UsersController.class); |
| 41 | 41 | ||
| 42 | @Autowired | 42 | @Autowired |
| 43 | - private UsersServiceImpl usersService; | 43 | + private UsersService usersService; |
| 44 | @Autowired | 44 | @Autowired |
| 45 | private SitesService sitesService; | 45 | private SitesService sitesService; |
| 46 | @Autowired | 46 | @Autowired |
| @@ -62,7 +62,7 @@ public class UsersController extends BaseController { | @@ -62,7 +62,7 @@ public class UsersController extends BaseController { | ||
| 62 | * 本机的名称 | 62 | * 本机的名称 |
| 63 | */ | 63 | */ |
| 64 | @Value("${spring.localhost.url}") | 64 | @Value("${spring.localhost.url}") |
| 65 | - private String redirectURL; | 65 | + private String redirect_url; |
| 66 | 66 | ||
| 67 | @Value("${CAS_SERVER_LOGIN_URL}") | 67 | @Value("${CAS_SERVER_LOGIN_URL}") |
| 68 | private String CAS_SERVER_LOGIN_URL; | 68 | private String CAS_SERVER_LOGIN_URL; |
| @@ -111,7 +111,7 @@ public class UsersController extends BaseController { | @@ -111,7 +111,7 @@ public class UsersController extends BaseController { | ||
| 111 | shyLog.setOperationType("登录"); | 111 | shyLog.setOperationType("登录"); |
| 112 | shyLog.setRemark(user.getUsername() + "--" + "登录"); | 112 | shyLog.setRemark(user.getUsername() + "--" + "登录"); |
| 113 | shyLogService.addShyLog(shyLog); | 113 | shyLogService.addShyLog(shyLog); |
| 114 | - return "redirect:" + redirectURL + "/videos/page?video_title=&start_date=&end_date=&state=0&receive=0&video_priority="; | 114 | + return "redirect:" + redirect_url + "/videos/page?video_title=&start_date=&end_date=&state=0&receive=0&video_priority="; |
| 115 | } | 115 | } |
| 116 | } | 116 | } |
| 117 | 117 | ||
| @@ -221,12 +221,12 @@ public class UsersController extends BaseController { | @@ -221,12 +221,12 @@ 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[] writeNotice, HttpSession session, String redirectUrl) { | 224 | + public String write(Model model, Integer userId, String[] write_notice, HttpSession session, String redirect_url) { |
| 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 | StringBuilder write = new StringBuilder(); | 227 | StringBuilder write = new StringBuilder(); |
| 228 | - if (CommonUtils.isNotNull(writeNotice) && writeNotice.length > 0) { | ||
| 229 | - for (String w : writeNotice) { | 228 | + if (CommonUtils.isNotNull(write_notice) && write_notice.length > 0) { |
| 229 | + for (String w : write_notice) { | ||
| 230 | write.append(",").append(w); | 230 | write.append(",").append(w); |
| 231 | } | 231 | } |
| 232 | write = new StringBuilder(write.substring(1)); | 232 | write = new StringBuilder(write.substring(1)); |
| @@ -234,7 +234,7 @@ public class UsersController extends BaseController { | @@ -234,7 +234,7 @@ public class UsersController extends BaseController { | ||
| 234 | user.setNotice_show(write.toString()); | 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:" + redirectUrl; | 237 | + return "redirect:" + redirect_url; |
| 238 | } else { | 238 | } else { |
| 239 | setmodelResult(model); | 239 | setmodelResult(model); |
| 240 | return "error.html"; | 240 | return "error.html"; |
src/main/java/com/cnlive/shenhe/controller/UsersFreeController.java
| @@ -9,7 +9,7 @@ import com.cnlive.shenhe.dto.UsersFreeDTO; | @@ -9,7 +9,7 @@ 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.SitesService; | 11 | import com.cnlive.shenhe.service.SitesService; |
| 12 | -import com.cnlive.shenhe.service.serviceImpl.UsersfreeServiceImpl; | 12 | +import com.cnlive.shenhe.service.UsersfreeService; |
| 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; |
| 15 | import com.github.pagehelper.PageInfo; | 15 | import com.github.pagehelper.PageInfo; |
| @@ -39,7 +39,7 @@ public class UsersFreeController extends BaseController { | @@ -39,7 +39,7 @@ public class UsersFreeController extends BaseController { | ||
| 39 | private static Logger logger = LoggerFactory.getLogger(UsersFreeController.class); | 39 | private static Logger logger = LoggerFactory.getLogger(UsersFreeController.class); |
| 40 | 40 | ||
| 41 | @Autowired | 41 | @Autowired |
| 42 | - UsersfreeServiceImpl usersfreeService; | 42 | + UsersfreeService usersfreeService; |
| 43 | @Autowired | 43 | @Autowired |
| 44 | SitesService sitesService; | 44 | SitesService sitesService; |
| 45 | 45 | ||
| @@ -66,7 +66,7 @@ public class UsersFreeController extends BaseController { | @@ -66,7 +66,7 @@ public class UsersFreeController extends BaseController { | ||
| 66 | if (spid == 0) { | 66 | if (spid == 0) { |
| 67 | usersFreeDTO.setSpid(null); | 67 | usersFreeDTO.setSpid(null); |
| 68 | } | 68 | } |
| 69 | - PageInfo<ShyUsersfree> usersPage = usersfreeService.getpage(usersFreeDTO); | 69 | + PageInfo<ShyUsersfree> usersPage = usersfreeService.getPage(usersFreeDTO); |
| 70 | List<ShyUsersfree> list = usersPage.getList(); | 70 | List<ShyUsersfree> list = usersPage.getList(); |
| 71 | JSONObject category = CommonConst.CATEGORY; | 71 | JSONObject category = CommonConst.CATEGORY; |
| 72 | if (!list.isEmpty()) { | 72 | if (!list.isEmpty()) { |
| @@ -115,22 +115,22 @@ public class UsersFreeController extends BaseController { | @@ -115,22 +115,22 @@ public class UsersFreeController extends BaseController { | ||
| 115 | 115 | ||
| 116 | 116 | ||
| 117 | @PostMapping(value = "/write") | 117 | @PostMapping(value = "/write") |
| 118 | - public String write(Model model, String userId, String userMobile, Integer spId, String[] writeBusiness, HttpSession session, String redirectUrl) { | 118 | + public String write(Model model, String userId, String userMobile, Integer spId, String[] write_business, HttpSession session, String redirect_url) { |
| 119 | if (CommonUtils.isEmpty(userId) && CommonUtils.isEmpty(userMobile)) { | 119 | if (CommonUtils.isEmpty(userId) && CommonUtils.isEmpty(userMobile)) { |
| 120 | setmodelParam(model, "userId,userMobile不能为空!"); | 120 | setmodelParam(model, "userId,userMobile不能为空!"); |
| 121 | return "error.html"; | 121 | return "error.html"; |
| 122 | } | 122 | } |
| 123 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | 123 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 124 | StringBuilder write = new StringBuilder(); | 124 | StringBuilder write = new StringBuilder(); |
| 125 | - if (CommonUtils.isNotNull(writeBusiness) && writeBusiness.length > 0) { | ||
| 126 | - for (String w : writeBusiness) { | 125 | + if (CommonUtils.isNotNull(write_business) && write_business.length > 0) { |
| 126 | + for (String w : write_business) { | ||
| 127 | write.append(",").append(w); | 127 | write.append(",").append(w); |
| 128 | } | 128 | } |
| 129 | write = new StringBuilder(write.substring(1)); | 129 | write = new StringBuilder(write.substring(1)); |
| 130 | } | 130 | } |
| 131 | boolean success = usersfreeService.update(userId, userMobile, write.toString(), spId, sessionUser.getUserId()); | 131 | boolean success = usersfreeService.update(userId, userMobile, write.toString(), spId, sessionUser.getUserId()); |
| 132 | if (success) { | 132 | if (success) { |
| 133 | - return "redirect:" + redirectUrl; | 133 | + return "redirect:" + redirect_url; |
| 134 | } else { | 134 | } else { |
| 135 | setmodelResult(model); | 135 | setmodelResult(model); |
| 136 | return "error.html"; | 136 | return "error.html"; |
src/main/java/com/cnlive/shenhe/controller/VideosController.java
| @@ -10,7 +10,7 @@ import com.cnlive.shenhe.entity.*; | @@ -10,7 +10,7 @@ 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.SitesService; | 12 | import com.cnlive.shenhe.service.SitesService; |
| 13 | -import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; | 13 | +import com.cnlive.shenhe.service.UsersService; |
| 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; |
| 16 | import com.cnlive.shenhe.utils.CommonConst; | 16 | import com.cnlive.shenhe.utils.CommonConst; |
| @@ -53,7 +53,7 @@ public class VideosController extends BaseController { | @@ -53,7 +53,7 @@ public class VideosController extends BaseController { | ||
| 53 | @Autowired | 53 | @Autowired |
| 54 | private VideosServiceImpl videosService; | 54 | private VideosServiceImpl videosService; |
| 55 | @Autowired | 55 | @Autowired |
| 56 | - private UsersServiceImpl usersService; | 56 | + private UsersService usersService; |
| 57 | @Autowired | 57 | @Autowired |
| 58 | private SitesService sitesService; | 58 | private SitesService sitesService; |
| 59 | @Autowired | 59 | @Autowired |
| @@ -140,7 +140,7 @@ public class VideosController extends BaseController { | @@ -140,7 +140,7 @@ public class VideosController extends BaseController { | ||
| 140 | logger.info("列表请求参数:{}", JSON.toJSONString(videosDTO)); | 140 | logger.info("列表请求参数:{}", JSON.toJSONString(videosDTO)); |
| 141 | if (!StringUtils.isEmpty(videosDTO.getShen_auditor_id())) { | 141 | if (!StringUtils.isEmpty(videosDTO.getShen_auditor_id())) { |
| 142 | if ((!"自动审核".equals(videosDTO.getShen_auditor_id())) && (!"白名单".equals(videosDTO.getShen_auditor_id()))) { | 142 | if ((!"自动审核".equals(videosDTO.getShen_auditor_id())) && (!"白名单".equals(videosDTO.getShen_auditor_id()))) { |
| 143 | - videosDTO.setShen_auditor_id(usersService.findspidByName(videosDTO.getShen_auditor_id())); | 143 | + videosDTO.setShen_auditor_id(usersService.findSpIdByName(videosDTO.getShen_auditor_id())); |
| 144 | } | 144 | } |
| 145 | } | 145 | } |
| 146 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | 146 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
src/main/java/com/cnlive/shenhe/service/AudioService.java
| @@ -57,9 +57,8 @@ public interface AudioService { | @@ -57,9 +57,8 @@ public interface AudioService { | ||
| 57 | * | 57 | * |
| 58 | * @param shyAudio | 58 | * @param shyAudio |
| 59 | * @param audioState 视频状态,1通过,2不通过 | 59 | * @param audioState 视频状态,1通过,2不通过 |
| 60 | - * @return | ||
| 61 | */ | 60 | */ |
| 62 | - int updateAudioAndShenhe(ShyAudio shyAudio, int audioState); | 61 | + void updateAudioAndShenhe(ShyAudio shyAudio, int audioState); |
| 63 | 62 | ||
| 64 | /** | 63 | /** |
| 65 | * 认领 | 64 | * 认领 |
| @@ -95,14 +94,14 @@ public interface AudioService { | @@ -95,14 +94,14 @@ public interface AudioService { | ||
| 95 | * 根据id查询到音频对象进行修改 | 94 | * 根据id查询到音频对象进行修改 |
| 96 | * | 95 | * |
| 97 | * @param id | 96 | * @param id |
| 98 | - * @param auditor_id | 97 | + * @param auditorId |
| 99 | * @param updater | 98 | * @param updater |
| 100 | - * @param attr_tags | 99 | + * @param attrTags |
| 101 | * @param state | 100 | * @param state |
| 102 | * @param msg | 101 | * @param msg |
| 103 | * @return | 102 | * @return |
| 104 | */ | 103 | */ |
| 105 | - int updateAudio(Integer id, String auditor_id, String updater, String attr_tags, Integer state, String msg); | 104 | + int updateAudio(Integer id, String auditorId, String updater, String attrTags, Integer state, String msg); |
| 106 | 105 | ||
| 107 | /** | 106 | /** |
| 108 | * 分页查询音频数据 | 107 | * 分页查询音频数据 |
src/main/java/com/cnlive/shenhe/service/ContentService.java
| @@ -126,10 +126,10 @@ public interface ContentService { | @@ -126,10 +126,10 @@ public interface ContentService { | ||
| 126 | * 获取审核类型 | 126 | * 获取审核类型 |
| 127 | * | 127 | * |
| 128 | * @param spId | 128 | * @param spId |
| 129 | - * @param ContentTag | 129 | + * @param contentTag |
| 130 | * @return | 130 | * @return |
| 131 | */ | 131 | */ |
| 132 | - Integer getShenheType(Integer spId, String ContentTag); | 132 | + Integer getShenheType(Integer spId, String contentTag); |
| 133 | 133 | ||
| 134 | /** | 134 | /** |
| 135 | * 易盾网站过滤 | 135 | * 易盾网站过滤 |
src/main/java/com/cnlive/shenhe/service/LiveApplyService.java
| @@ -48,13 +48,13 @@ public interface LiveApplyService { | @@ -48,13 +48,13 @@ public interface LiveApplyService { | ||
| 48 | * 修改直播申请对象 返回int类型 | 48 | * 修改直播申请对象 返回int类型 |
| 49 | * | 49 | * |
| 50 | * @param id | 50 | * @param id |
| 51 | - * @param auditor_id | 51 | + * @param auditorId |
| 52 | * @param updater | 52 | * @param updater |
| 53 | * @param status | 53 | * @param status |
| 54 | * @param msg | 54 | * @param msg |
| 55 | * @return | 55 | * @return |
| 56 | */ | 56 | */ |
| 57 | - int updateLiveApply(Integer id, String auditor_id, String updater, Integer status, String msg); | 57 | + int updateLiveApply(Integer id, String auditorId, String updater, Integer status, String msg); |
| 58 | 58 | ||
| 59 | /** | 59 | /** |
| 60 | * 获取分页、条件查询 | 60 | * 获取分页、条件查询 |
src/main/java/com/cnlive/shenhe/service/LiveService.java
| @@ -48,13 +48,13 @@ public interface LiveService { | @@ -48,13 +48,13 @@ public interface LiveService { | ||
| 48 | * 根据id查询,修改对象的关键信息 返回int类型 | 48 | * 根据id查询,修改对象的关键信息 返回int类型 |
| 49 | * | 49 | * |
| 50 | * @param id | 50 | * @param id |
| 51 | - * @param auditor_id | 51 | + * @param auditorId |
| 52 | * @param updater | 52 | * @param updater |
| 53 | - * @param activity_status | 53 | + * @param activityStatus |
| 54 | * @param msg | 54 | * @param msg |
| 55 | * @return | 55 | * @return |
| 56 | */ | 56 | */ |
| 57 | - int updateLive(Integer id, String auditor_id, String updater, Integer activity_status, String msg); | 57 | + int updateLive(Integer id, String auditorId, String updater, Integer activityStatus, String msg); |
| 58 | 58 | ||
| 59 | /** | 59 | /** |
| 60 | * 分页、条件查询、返回分页结果集合 | 60 | * 分页、条件查询、返回分页结果集合 |
src/main/java/com/cnlive/shenhe/service/SitesService.java
| @@ -46,10 +46,10 @@ public interface SitesService { | @@ -46,10 +46,10 @@ public interface SitesService { | ||
| 46 | /** | 46 | /** |
| 47 | * 根据name查询白名单对象 | 47 | * 根据name查询白名单对象 |
| 48 | * | 48 | * |
| 49 | - * @param sp_desc | 49 | + * @param spDesc |
| 50 | * @return | 50 | * @return |
| 51 | */ | 51 | */ |
| 52 | - ShySites findspidBySpdesc(String sp_desc); | 52 | + ShySites findspidBySpdesc(String spDesc); |
| 53 | 53 | ||
| 54 | /** | 54 | /** |
| 55 | * 获取免审白名单列表(点播) | 55 | * 获取免审白名单列表(点播) |
| @@ -63,8 +63,8 @@ public interface SitesService { | @@ -63,8 +63,8 @@ public interface SitesService { | ||
| 63 | * 获取用户(操作人) | 63 | * 获取用户(操作人) |
| 64 | * | 64 | * |
| 65 | * @param updater | 65 | * @param updater |
| 66 | - * @param auditor_id | 66 | + * @param auditorId |
| 67 | * @return | 67 | * @return |
| 68 | */ | 68 | */ |
| 69 | - String getUpdater(String updater, String auditor_id); | 69 | + String getUpdater(String updater, String auditorId); |
| 70 | } | 70 | } |
src/main/java/com/cnlive/shenhe/service/UsersService.java
0 → 100644
| 1 | +package com.cnlive.shenhe.service; | ||
| 2 | + | ||
| 3 | +import com.cnlive.shenhe.dto.UsersDTO; | ||
| 4 | +import com.cnlive.shenhe.entity.ShyUsers; | ||
| 5 | +import com.github.pagehelper.PageInfo; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * @Author: yan-zhao-wang | ||
| 9 | + * @DateTime: 2022-11-08 9:15 | ||
| 10 | + */ | ||
| 11 | +public interface UsersService { | ||
| 12 | + /** | ||
| 13 | + * 用户分页列表 | ||
| 14 | + * | ||
| 15 | + * @param usersDTO | ||
| 16 | + * @return | ||
| 17 | + */ | ||
| 18 | + PageInfo<ShyUsers> getPage(UsersDTO usersDTO); | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 根据spid查询名字 | ||
| 22 | + * | ||
| 23 | + * @param shenAuditorId | ||
| 24 | + * @return | ||
| 25 | + */ | ||
| 26 | + | ||
| 27 | + String findSpIdByName(String shenAuditorId); | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 根据主键id查询用户对象 | ||
| 31 | + * | ||
| 32 | + * @param id | ||
| 33 | + * @return | ||
| 34 | + */ | ||
| 35 | + ShyUsers get(Integer id); | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 根据对象查询 | ||
| 39 | + * | ||
| 40 | + * @param shyUsers | ||
| 41 | + * @return | ||
| 42 | + */ | ||
| 43 | + ShyUsers select(ShyUsers shyUsers); | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * 修改用户 | ||
| 47 | + * | ||
| 48 | + * @param shyUsers | ||
| 49 | + * @return | ||
| 50 | + */ | ||
| 51 | + boolean update(ShyUsers shyUsers); | ||
| 52 | +} |
src/main/java/com/cnlive/shenhe/service/UsersfreeService.java
0 → 100644
| 1 | +package com.cnlive.shenhe.service; | ||
| 2 | + | ||
| 3 | +import com.cnlive.shenhe.dto.UsersFreeDTO; | ||
| 4 | +import com.cnlive.shenhe.entity.ShyUsersfree; | ||
| 5 | +import com.github.pagehelper.PageInfo; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * @Author: yan-zhao-wang | ||
| 9 | + * @DateTime: 2022-11-08 9:15 | ||
| 10 | + */ | ||
| 11 | +public interface UsersfreeService { | ||
| 12 | + /** | ||
| 13 | + * 根据主键id查询用户白名单 | ||
| 14 | + * | ||
| 15 | + * @param id | ||
| 16 | + * @return | ||
| 17 | + */ | ||
| 18 | + ShyUsersfree get(Integer id); | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 根据用户白名单对象查询 | ||
| 22 | + * | ||
| 23 | + * @param shyUsersfree | ||
| 24 | + * @return | ||
| 25 | + */ | ||
| 26 | + ShyUsersfree select(ShyUsersfree shyUsersfree); | ||
| 27 | + | ||
| 28 | + /** | ||
| 29 | + * 修改白名单状态 | ||
| 30 | + * | ||
| 31 | + * @param id | ||
| 32 | + * @param isEnable | ||
| 33 | + * @return | ||
| 34 | + */ | ||
| 35 | + Integer updateState(Integer id, Boolean isEnable); | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 分页、条件查询列表 | ||
| 39 | + * | ||
| 40 | + * @param usersFreeDTO | ||
| 41 | + * @return | ||
| 42 | + */ | ||
| 43 | + PageInfo<ShyUsersfree> getPage(UsersFreeDTO usersFreeDTO); | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * 通过spid、栏目、用户id来查看是否是免审 | ||
| 47 | + * | ||
| 48 | + * @param spId | ||
| 49 | + * @param category | ||
| 50 | + * @param userId | ||
| 51 | + * @return | ||
| 52 | + */ | ||
| 53 | + ShyUsersfree selectUser(Integer spId, String category, String userId); | ||
| 54 | + | ||
| 55 | + /** | ||
| 56 | + * 回调 | ||
| 57 | + * | ||
| 58 | + * @param userId | ||
| 59 | + * @param userMobile | ||
| 60 | + * @param write | ||
| 61 | + * @param spId | ||
| 62 | + * @param updater | ||
| 63 | + * @return | ||
| 64 | + */ | ||
| 65 | + boolean update(String userId, String userMobile, String write, Integer spId, String updater); | ||
| 66 | +} |
src/main/java/com/cnlive/shenhe/service/serviceImpl/AudioServiceImpl.java
| @@ -113,10 +113,9 @@ public class AudioServiceImpl implements AudioService { | @@ -113,10 +113,9 @@ public class AudioServiceImpl implements AudioService { | ||
| 113 | * | 113 | * |
| 114 | * @param shyAudio | 114 | * @param shyAudio |
| 115 | * @param audioState 视频状态,1通过,2不通过 | 115 | * @param audioState 视频状态,1通过,2不通过 |
| 116 | - * @return | ||
| 117 | */ | 116 | */ |
| 118 | @Override | 117 | @Override |
| 119 | - public int updateAudioAndShenhe(ShyAudio shyAudio, int audioState) { | 118 | + public void updateAudioAndShenhe(ShyAudio shyAudio, int audioState) { |
| 120 | //修改点播云音频状态 | 119 | //修改点播云音频状态 |
| 121 | JSONObject result = pass.audioPass(shyAudio.getAudioId(), audioState, shyAudio.getAttr_tags(), shyAudio.getMsg(), shyAudio.getCallback()); | 120 | JSONObject result = pass.audioPass(shyAudio.getAudioId(), audioState, shyAudio.getAttr_tags(), shyAudio.getMsg(), shyAudio.getCallback()); |
| 122 | Integer code = result.getInteger("code"); | 121 | Integer code = result.getInteger("code"); |
| @@ -130,13 +129,11 @@ public class AudioServiceImpl implements AudioService { | @@ -130,13 +129,11 @@ public class AudioServiceImpl implements AudioService { | ||
| 130 | if (i != 1) { | 129 | if (i != 1) { |
| 131 | logger.error("点播音频更改失败,AudioId:{}", shyAudio.getAudioId()); | 130 | logger.error("点播音频更改失败,AudioId:{}", shyAudio.getAudioId()); |
| 132 | } | 131 | } |
| 133 | - return i; | ||
| 134 | } else { | 132 | } else { |
| 135 | shyAudio.setMsg("点播音频回调失败," + shyAudio.getMsg()); | 133 | shyAudio.setMsg("点播音频回调失败," + shyAudio.getMsg()); |
| 136 | audioService.updateAudio(shyAudio.getId(), null, shyAudio.getUploader(), "", CommonConst.AUDIT_CALLBACK_FAIL, shyAudio.getMsg()); | 134 | audioService.updateAudio(shyAudio.getId(), null, shyAudio.getUploader(), "", CommonConst.AUDIT_CALLBACK_FAIL, shyAudio.getMsg()); |
| 137 | logger.error("点播音频回调失败,activity_id:{},code:{},msg:{}", shyAudio.getAudioId(), code, result.getString("msg")); | 135 | logger.error("点播音频回调失败,activity_id:{},code:{},msg:{}", shyAudio.getAudioId(), code, result.getString("msg")); |
| 138 | } | 136 | } |
| 139 | - return 0; | ||
| 140 | } | 137 | } |
| 141 | 138 | ||
| 142 | /** | 139 | /** |
src/main/java/com/cnlive/shenhe/service/serviceImpl/LiveServiceImpl.java
| @@ -49,10 +49,7 @@ public class LiveServiceImpl implements LiveService { | @@ -49,10 +49,7 @@ public class LiveServiceImpl implements LiveService { | ||
| 49 | @Override | 49 | @Override |
| 50 | public boolean impotVideo(ShyLive shyLive) { | 50 | public boolean impotVideo(ShyLive shyLive) { |
| 51 | int result = shyLiveMapper.insertSelective(shyLive); | 51 | int result = shyLiveMapper.insertSelective(shyLive); |
| 52 | - if (result == 0) { | ||
| 53 | - return false; | ||
| 54 | - } | ||
| 55 | - return true; | 52 | + return result != 0; |
| 56 | } | 53 | } |
| 57 | 54 | ||
| 58 | /** | 55 | /** |
| @@ -63,8 +60,7 @@ public class LiveServiceImpl implements LiveService { | @@ -63,8 +60,7 @@ public class LiveServiceImpl implements LiveService { | ||
| 63 | */ | 60 | */ |
| 64 | @Override | 61 | @Override |
| 65 | public ShyLive selectByPrimaryKey(Integer id) { | 62 | public ShyLive selectByPrimaryKey(Integer id) { |
| 66 | - ShyLive shyLive = shyLiveMapper.selectByPrimaryKey(id); | ||
| 67 | - return shyLive; | 63 | + return shyLiveMapper.selectByPrimaryKey(id); |
| 68 | } | 64 | } |
| 69 | 65 | ||
| 70 | /** | 66 | /** |
| @@ -75,8 +71,7 @@ public class LiveServiceImpl implements LiveService { | @@ -75,8 +71,7 @@ public class LiveServiceImpl implements LiveService { | ||
| 75 | */ | 71 | */ |
| 76 | @Override | 72 | @Override |
| 77 | public List<ShyLive> findShyLive(ShyLive shyLive) { | 73 | public List<ShyLive> findShyLive(ShyLive shyLive) { |
| 78 | - List<ShyLive> shyLivelist = shyLiveMapper.selectByRowBounds(shyLive, new RowBounds(0, 100)); | ||
| 79 | - return shyLivelist; | 74 | + return shyLiveMapper.selectByRowBounds(shyLive, new RowBounds(0, 100)); |
| 80 | } | 75 | } |
| 81 | 76 | ||
| 82 | /** | 77 | /** |
| @@ -88,28 +83,25 @@ public class LiveServiceImpl implements LiveService { | @@ -88,28 +83,25 @@ public class LiveServiceImpl implements LiveService { | ||
| 88 | @Override | 83 | @Override |
| 89 | public boolean updateShyLive(ShyLive shyLive) { | 84 | public boolean updateShyLive(ShyLive shyLive) { |
| 90 | int i = shyLiveMapper.updateByPrimaryKey(shyLive); | 85 | int i = shyLiveMapper.updateByPrimaryKey(shyLive); |
| 91 | - if (i == 0) { | ||
| 92 | - return false; | ||
| 93 | - } | ||
| 94 | - return true; | 86 | + return i != 0; |
| 95 | } | 87 | } |
| 96 | 88 | ||
| 97 | /** | 89 | /** |
| 98 | * 根据id查询,修改对象的关键信息 返回int类型 | 90 | * 根据id查询,修改对象的关键信息 返回int类型 |
| 99 | * | 91 | * |
| 100 | * @param id | 92 | * @param id |
| 101 | - * @param auditor_id | 93 | + * @param auditorId |
| 102 | * @param updater | 94 | * @param updater |
| 103 | - * @param activity_status | 95 | + * @param activityStatus |
| 104 | * @param msg | 96 | * @param msg |
| 105 | * @return | 97 | * @return |
| 106 | */ | 98 | */ |
| 107 | @Override | 99 | @Override |
| 108 | - public int updateLive(Integer id, String auditor_id, String updater, Integer activity_status, String msg) { | 100 | + public int updateLive(Integer id, String auditorId, String updater, Integer activityStatus, String msg) { |
| 109 | ShyLive shyLive = shyLiveMapper.selectByPrimaryKey(id); | 101 | ShyLive shyLive = shyLiveMapper.selectByPrimaryKey(id); |
| 110 | - shyLive.setAuditor(auditor_id); | 102 | + shyLive.setAuditor(auditorId); |
| 111 | shyLive.setShenhe_state(CommonConst.RECEIVE_AUDIT); | 103 | shyLive.setShenhe_state(CommonConst.RECEIVE_AUDIT); |
| 112 | - shyLive.setActivity_status(activity_status); | 104 | + shyLive.setActivity_status(activityStatus); |
| 113 | shyLive.setShenhe_msg(msg); | 105 | shyLive.setShenhe_msg(msg); |
| 114 | shyLive.setUpdater(updater); | 106 | shyLive.setUpdater(updater); |
| 115 | shyLive.setIs_hot(CommonConstStates.SHIFOU_REDIANNO); | 107 | shyLive.setIs_hot(CommonConstStates.SHIFOU_REDIANNO); |
| @@ -194,8 +186,7 @@ public class LiveServiceImpl implements LiveService { | @@ -194,8 +186,7 @@ public class LiveServiceImpl implements LiveService { | ||
| 194 | user.setUser_id(auditorId); | 186 | user.setUser_id(auditorId); |
| 195 | user = shyUsersMapper.selectOne(user); | 187 | user = shyUsersMapper.selectOne(user); |
| 196 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 188 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 197 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | ||
| 198 | - updater = userName; | 189 | + updater = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); |
| 199 | } | 190 | } |
| 200 | shyLive.setUpdater(updater); | 191 | shyLive.setUpdater(updater); |
| 201 | } | 192 | } |
| @@ -323,7 +314,6 @@ public class LiveServiceImpl implements LiveService { | @@ -323,7 +314,6 @@ public class LiveServiceImpl implements LiveService { | ||
| 323 | criteria.andEqualTo("activity_status", liveDTO.getActivity_status()); | 314 | criteria.andEqualTo("activity_status", liveDTO.getActivity_status()); |
| 324 | } | 315 | } |
| 325 | criteria.andEqualTo("is_show", CommonConstStates.SHIFOU_XIANSHIYES); | 316 | criteria.andEqualTo("is_show", CommonConstStates.SHIFOU_XIANSHIYES); |
| 326 | - List<ShyLive> shyLiveList = shyLiveMapper.selectByExample(example); | ||
| 327 | - return shyLiveList; | 317 | + return shyLiveMapper.selectByExample(example); |
| 328 | } | 318 | } |
| 329 | } | 319 | } |
src/main/java/com/cnlive/shenhe/service/serviceImpl/SitesServiceImpl.java
| @@ -6,6 +6,7 @@ import com.cnlive.shenhe.entity.ShySites; | @@ -6,6 +6,7 @@ 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.service.SitesService; |
| 9 | +import com.cnlive.shenhe.service.UsersService; | ||
| 9 | import com.cnlive.shenhe.utils.CommonUtils; | 10 | import com.cnlive.shenhe.utils.CommonUtils; |
| 10 | import com.github.pagehelper.PageHelper; | 11 | import com.github.pagehelper.PageHelper; |
| 11 | import com.github.pagehelper.PageInfo; | 12 | import com.github.pagehelper.PageInfo; |
| @@ -32,7 +33,7 @@ public class SitesServiceImpl implements SitesService { | @@ -32,7 +33,7 @@ public class SitesServiceImpl implements SitesService { | ||
| 32 | @Autowired | 33 | @Autowired |
| 33 | ShySitesMapper shySitesMapper; | 34 | ShySitesMapper shySitesMapper; |
| 34 | @Autowired | 35 | @Autowired |
| 35 | - UsersServiceImpl usersService; | 36 | + UsersService usersService; |
| 36 | 37 | ||
| 37 | /** | 38 | /** |
| 38 | * 分页、条件查询 返回列表 | 39 | * 分页、条件查询 返回列表 |
src/main/java/com/cnlive/shenhe/service/serviceImpl/UsersServiceImpl.java
| @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; | @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; | ||
| 4 | import com.cnlive.shenhe.dto.UsersDTO; | 4 | import com.cnlive.shenhe.dto.UsersDTO; |
| 5 | import com.cnlive.shenhe.entity.ShyUsers; | 5 | import com.cnlive.shenhe.entity.ShyUsers; |
| 6 | import com.cnlive.shenhe.mapper.ShyUsersMapper; | 6 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| 7 | +import com.cnlive.shenhe.service.UsersService; | ||
| 7 | import com.cnlive.shenhe.utils.CommonUtils; | 8 | import com.cnlive.shenhe.utils.CommonUtils; |
| 8 | import com.github.pagehelper.PageHelper; | 9 | import com.github.pagehelper.PageHelper; |
| 9 | import com.github.pagehelper.PageInfo; | 10 | import com.github.pagehelper.PageInfo; |
| @@ -21,11 +22,18 @@ import java.util.List; | @@ -21,11 +22,18 @@ import java.util.List; | ||
| 21 | * @Description: | 22 | * @Description: |
| 22 | */ | 23 | */ |
| 23 | @Service | 24 | @Service |
| 24 | -public class UsersServiceImpl { | 25 | +public class UsersServiceImpl implements UsersService { |
| 25 | private static Logger logger = LoggerFactory.getLogger(UsersServiceImpl.class); | 26 | private static Logger logger = LoggerFactory.getLogger(UsersServiceImpl.class); |
| 26 | @Autowired | 27 | @Autowired |
| 27 | ShyUsersMapper shyUsersMapper; | 28 | ShyUsersMapper shyUsersMapper; |
| 28 | 29 | ||
| 30 | + /** | ||
| 31 | + * 用户分页列表 | ||
| 32 | + * | ||
| 33 | + * @param usersDTO | ||
| 34 | + * @return | ||
| 35 | + */ | ||
| 36 | + @Override | ||
| 29 | public PageInfo<ShyUsers> getPage(UsersDTO usersDTO) { | 37 | public PageInfo<ShyUsers> getPage(UsersDTO usersDTO) { |
| 30 | logger.info("接受参数列表为,UsersDTO:{}", JSON.toJSONString(usersDTO)); | 38 | logger.info("接受参数列表为,UsersDTO:{}", JSON.toJSONString(usersDTO)); |
| 31 | Example example = new Example(ShyUsers.class); | 39 | Example example = new Example(ShyUsers.class); |
| @@ -53,15 +61,21 @@ public class UsersServiceImpl { | @@ -53,15 +61,21 @@ public class UsersServiceImpl { | ||
| 53 | return pageInfo; | 61 | return pageInfo; |
| 54 | } | 62 | } |
| 55 | 63 | ||
| 56 | - public String findspidByName(String shenAuditorId) { | 64 | + /** |
| 65 | + * 根据spid查询名字 | ||
| 66 | + * | ||
| 67 | + * @param shenAuditorId | ||
| 68 | + * @return | ||
| 69 | + */ | ||
| 70 | + @Override | ||
| 71 | + public String findSpIdByName(String shenAuditorId) { | ||
| 57 | Example example = new Example(ShyUsers.class); | 72 | Example example = new Example(ShyUsers.class); |
| 58 | Example.Criteria criteria = example.createCriteria(); | 73 | Example.Criteria criteria = example.createCriteria(); |
| 59 | criteria.andEqualTo("username", shenAuditorId); | 74 | criteria.andEqualTo("username", shenAuditorId); |
| 60 | List<ShyUsers> shyUsersList = shyUsersMapper.selectByExample(example); | 75 | List<ShyUsers> shyUsersList = shyUsersMapper.selectByExample(example); |
| 61 | if (CommonUtils.isNotNull(shyUsersList) && shyUsersList.size() > 0) { | 76 | if (CommonUtils.isNotNull(shyUsersList) && shyUsersList.size() > 0) { |
| 62 | ShyUsers shyUsers = shyUsersList.get(0); | 77 | ShyUsers shyUsers = shyUsersList.get(0); |
| 63 | - String userId = shyUsers.getUser_id(); | ||
| 64 | - return userId; | 78 | + return shyUsers.getUser_id(); |
| 65 | } | 79 | } |
| 66 | return null; | 80 | return null; |
| 67 | } | 81 | } |
| @@ -72,7 +86,7 @@ public class UsersServiceImpl { | @@ -72,7 +86,7 @@ public class UsersServiceImpl { | ||
| 72 | * @param id | 86 | * @param id |
| 73 | * @return | 87 | * @return |
| 74 | */ | 88 | */ |
| 75 | - | 89 | + @Override |
| 76 | public ShyUsers get(Integer id) { | 90 | public ShyUsers get(Integer id) { |
| 77 | return shyUsersMapper.selectByPrimaryKey(id); | 91 | return shyUsersMapper.selectByPrimaryKey(id); |
| 78 | } | 92 | } |
| @@ -83,6 +97,7 @@ public class UsersServiceImpl { | @@ -83,6 +97,7 @@ public class UsersServiceImpl { | ||
| 83 | * @param shyUsers | 97 | * @param shyUsers |
| 84 | * @return | 98 | * @return |
| 85 | */ | 99 | */ |
| 100 | + @Override | ||
| 86 | public ShyUsers select(ShyUsers shyUsers) { | 101 | public ShyUsers select(ShyUsers shyUsers) { |
| 87 | return shyUsersMapper.selectOne(shyUsers); | 102 | return shyUsersMapper.selectOne(shyUsers); |
| 88 | } | 103 | } |
| @@ -93,6 +108,7 @@ public class UsersServiceImpl { | @@ -93,6 +108,7 @@ public class UsersServiceImpl { | ||
| 93 | * @param shyUsers | 108 | * @param shyUsers |
| 94 | * @return | 109 | * @return |
| 95 | */ | 110 | */ |
| 111 | + @Override | ||
| 96 | public boolean update(ShyUsers shyUsers) { | 112 | public boolean update(ShyUsers shyUsers) { |
| 97 | return shyUsersMapper.updateByPrimaryKeySelective(shyUsers) == 1; | 113 | return shyUsersMapper.updateByPrimaryKeySelective(shyUsers) == 1; |
| 98 | } | 114 | } |
src/main/java/com/cnlive/shenhe/service/serviceImpl/UsersfreeServiceImpl.java
| @@ -6,6 +6,7 @@ import com.cnlive.shenhe.dto.UsersFreeDTO; | @@ -6,6 +6,7 @@ import com.cnlive.shenhe.dto.UsersFreeDTO; | ||
| 6 | import com.cnlive.shenhe.entity.ShyUsers; | 6 | import com.cnlive.shenhe.entity.ShyUsers; |
| 7 | import com.cnlive.shenhe.entity.ShyUsersfree; | 7 | import com.cnlive.shenhe.entity.ShyUsersfree; |
| 8 | import com.cnlive.shenhe.mapper.ShyUsersfreeMapper; | 8 | import com.cnlive.shenhe.mapper.ShyUsersfreeMapper; |
| 9 | +import com.cnlive.shenhe.service.UsersfreeService; | ||
| 9 | import com.cnlive.shenhe.utils.AuditPass; | 10 | import com.cnlive.shenhe.utils.AuditPass; |
| 10 | import com.cnlive.shenhe.utils.CommonUtils; | 11 | import com.cnlive.shenhe.utils.CommonUtils; |
| 11 | import com.github.pagehelper.PageHelper; | 12 | import com.github.pagehelper.PageHelper; |
| @@ -24,7 +25,7 @@ import java.util.List; | @@ -24,7 +25,7 @@ import java.util.List; | ||
| 24 | * @Description: | 25 | * @Description: |
| 25 | */ | 26 | */ |
| 26 | @Service | 27 | @Service |
| 27 | -public class UsersfreeServiceImpl { | 28 | +public class UsersfreeServiceImpl implements UsersfreeService { |
| 28 | private static Logger logger = LoggerFactory.getLogger(UsersfreeServiceImpl.class); | 29 | private static Logger logger = LoggerFactory.getLogger(UsersfreeServiceImpl.class); |
| 29 | @Autowired | 30 | @Autowired |
| 30 | ShyUsersfreeMapper shyUsersfreeMapper; | 31 | ShyUsersfreeMapper shyUsersfreeMapper; |
| @@ -37,6 +38,7 @@ public class UsersfreeServiceImpl { | @@ -37,6 +38,7 @@ public class UsersfreeServiceImpl { | ||
| 37 | * @param id | 38 | * @param id |
| 38 | * @return | 39 | * @return |
| 39 | */ | 40 | */ |
| 41 | + @Override | ||
| 40 | public ShyUsersfree get(Integer id) { | 42 | public ShyUsersfree get(Integer id) { |
| 41 | return shyUsersfreeMapper.selectByPrimaryKey(id); | 43 | return shyUsersfreeMapper.selectByPrimaryKey(id); |
| 42 | } | 44 | } |
| @@ -47,6 +49,7 @@ public class UsersfreeServiceImpl { | @@ -47,6 +49,7 @@ public class UsersfreeServiceImpl { | ||
| 47 | * @param shyUsersfree | 49 | * @param shyUsersfree |
| 48 | * @return | 50 | * @return |
| 49 | */ | 51 | */ |
| 52 | + @Override | ||
| 50 | public ShyUsersfree select(ShyUsersfree shyUsersfree) { | 53 | public ShyUsersfree select(ShyUsersfree shyUsersfree) { |
| 51 | return shyUsersfreeMapper.selectOne(shyUsersfree); | 54 | return shyUsersfreeMapper.selectOne(shyUsersfree); |
| 52 | } | 55 | } |
| @@ -58,6 +61,7 @@ public class UsersfreeServiceImpl { | @@ -58,6 +61,7 @@ public class UsersfreeServiceImpl { | ||
| 58 | * @param isEnable | 61 | * @param isEnable |
| 59 | * @return | 62 | * @return |
| 60 | */ | 63 | */ |
| 64 | + @Override | ||
| 61 | public Integer updateState(Integer id, Boolean isEnable) { | 65 | public Integer updateState(Integer id, Boolean isEnable) { |
| 62 | ShyUsersfree shyUsersfree = get(id); | 66 | ShyUsersfree shyUsersfree = get(id); |
| 63 | shyUsersfree.setIs_enable(isEnable); | 67 | shyUsersfree.setIs_enable(isEnable); |
| @@ -70,7 +74,8 @@ public class UsersfreeServiceImpl { | @@ -70,7 +74,8 @@ public class UsersfreeServiceImpl { | ||
| 70 | * @param usersFreeDTO | 74 | * @param usersFreeDTO |
| 71 | * @return | 75 | * @return |
| 72 | */ | 76 | */ |
| 73 | - public PageInfo<ShyUsersfree> getpage(UsersFreeDTO usersFreeDTO) { | 77 | + @Override |
| 78 | + public PageInfo<ShyUsersfree> getPage(UsersFreeDTO usersFreeDTO) { | ||
| 74 | logger.info("接受参数列表为,UsersFreeDTO:{}", JSON.toJSONString(usersFreeDTO)); | 79 | logger.info("接受参数列表为,UsersFreeDTO:{}", JSON.toJSONString(usersFreeDTO)); |
| 75 | Example example = new Example(ShyUsers.class); | 80 | Example example = new Example(ShyUsers.class); |
| 76 | Example.Criteria criteria = example.createCriteria(); | 81 | Example.Criteria criteria = example.createCriteria(); |
| @@ -94,15 +99,16 @@ public class UsersfreeServiceImpl { | @@ -94,15 +99,16 @@ public class UsersfreeServiceImpl { | ||
| 94 | /** | 99 | /** |
| 95 | * 通过spid、栏目、用户id来查看是否是免审 | 100 | * 通过spid、栏目、用户id来查看是否是免审 |
| 96 | * | 101 | * |
| 97 | - * @param sp_id | 102 | + * @param spId |
| 98 | * @param category | 103 | * @param category |
| 99 | - * @param user_id | 104 | + * @param userId |
| 100 | * @return | 105 | * @return |
| 101 | */ | 106 | */ |
| 102 | - public ShyUsersfree selectUser(Integer sp_id, String category, String user_id) { | 107 | + @Override |
| 108 | + public ShyUsersfree selectUser(Integer spId, String category, String userId) { | ||
| 103 | ShyUsersfree shyUserfree = new ShyUsersfree(); | 109 | ShyUsersfree shyUserfree = new ShyUsersfree(); |
| 104 | - shyUserfree.setSp_id(sp_id); | ||
| 105 | - shyUserfree.setUser_id(user_id); | 110 | + shyUserfree.setSp_id(spId); |
| 111 | + shyUserfree.setUser_id(userId); | ||
| 106 | shyUserfree.setIs_enable(true); | 112 | shyUserfree.setIs_enable(true); |
| 107 | shyUserfree.setIs_delete(false); | 113 | shyUserfree.setIs_delete(false); |
| 108 | ShyUsersfree shyUserfree1 = shyUsersfreeMapper.selectOne(shyUserfree); | 114 | ShyUsersfree shyUserfree1 = shyUsersfreeMapper.selectOne(shyUserfree); |
| @@ -114,6 +120,7 @@ public class UsersfreeServiceImpl { | @@ -114,6 +120,7 @@ public class UsersfreeServiceImpl { | ||
| 114 | 120 | ||
| 115 | /** | 121 | /** |
| 116 | * 回调 | 122 | * 回调 |
| 123 | + * | ||
| 117 | * @param userId | 124 | * @param userId |
| 118 | * @param userMobile | 125 | * @param userMobile |
| 119 | * @param write | 126 | * @param write |
| @@ -121,8 +128,9 @@ public class UsersfreeServiceImpl { | @@ -121,8 +128,9 @@ public class UsersfreeServiceImpl { | ||
| 121 | * @param updater | 128 | * @param updater |
| 122 | * @return | 129 | * @return |
| 123 | */ | 130 | */ |
| 131 | + @Override | ||
| 124 | public boolean update(String userId, String userMobile, String write, Integer spId, String updater) { | 132 | public boolean update(String userId, String userMobile, String write, Integer spId, String updater) { |
| 125 | - JSONObject result = new JSONObject(); | 133 | + JSONObject result; |
| 126 | try { | 134 | try { |
| 127 | result = pass.queryUser(userId, userMobile); | 135 | result = pass.queryUser(userId, userMobile); |
| 128 | } catch (Exception e) { | 136 | } catch (Exception e) { |
| @@ -159,9 +167,7 @@ public class UsersfreeServiceImpl { | @@ -159,9 +167,7 @@ public class UsersfreeServiceImpl { | ||
| 159 | shyUserfree1.setIs_delete(false); | 167 | shyUserfree1.setIs_delete(false); |
| 160 | shyUserfree1.setIs_enable(true); | 168 | shyUserfree1.setIs_enable(true); |
| 161 | int re = shyUsersfreeMapper.updateByPrimaryKeySelective(shyUserfree1); | 169 | int re = shyUsersfreeMapper.updateByPrimaryKeySelective(shyUserfree1); |
| 162 | - if (re != 1) { | ||
| 163 | - return false; | ||
| 164 | - } | 170 | + return re == 1; |
| 165 | } else { | 171 | } else { |
| 166 | shyUserfree.setMobile(mobile); | 172 | shyUserfree.setMobile(mobile); |
| 167 | shyUserfree.setCategory(write); | 173 | shyUserfree.setCategory(write); |
| @@ -174,11 +180,8 @@ public class UsersfreeServiceImpl { | @@ -174,11 +180,8 @@ public class UsersfreeServiceImpl { | ||
| 174 | shyUserfree.setIs_delete(false); | 180 | shyUserfree.setIs_delete(false); |
| 175 | shyUserfree.setIs_enable(true); | 181 | shyUserfree.setIs_enable(true); |
| 176 | int re = shyUsersfreeMapper.insertSelective(shyUserfree); | 182 | int re = shyUsersfreeMapper.insertSelective(shyUserfree); |
| 177 | - if (re != 1) { | ||
| 178 | - return false; | ||
| 179 | - } | 183 | + return re == 1; |
| 180 | } | 184 | } |
| 181 | } | 185 | } |
| 182 | - return true; | ||
| 183 | } | 186 | } |
| 184 | } | 187 | } |
src/main/java/com/cnlive/shenhe/service/serviceImpl/VideosServiceImpl.java
| @@ -14,6 +14,7 @@ import com.cnlive.shenhe.mapper.ShyUsersMapper; | @@ -14,6 +14,7 @@ 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.service.SitesService; |
| 17 | +import com.cnlive.shenhe.service.UsersfreeService; | ||
| 17 | import com.cnlive.shenhe.utils.*; | 18 | import com.cnlive.shenhe.utils.*; |
| 18 | import com.github.pagehelper.PageHelper; | 19 | import com.github.pagehelper.PageHelper; |
| 19 | import com.github.pagehelper.PageInfo; | 20 | import com.github.pagehelper.PageInfo; |
| @@ -49,7 +50,7 @@ public class VideosServiceImpl { | @@ -49,7 +50,7 @@ public class VideosServiceImpl { | ||
| 49 | @Autowired | 50 | @Autowired |
| 50 | private SitesService sitesService; | 51 | private SitesService sitesService; |
| 51 | @Autowired | 52 | @Autowired |
| 52 | - private UsersfreeServiceImpl usersfreeServiceImpl; | 53 | + private UsersfreeService usersfreeService; |
| 53 | @Autowired | 54 | @Autowired |
| 54 | private YiDunServiceImpl yiDunServiceImpl; | 55 | private YiDunServiceImpl yiDunServiceImpl; |
| 55 | @Autowired | 56 | @Autowired |
| @@ -107,27 +108,27 @@ public class VideosServiceImpl { | @@ -107,27 +108,27 @@ public class VideosServiceImpl { | ||
| 107 | * 根据条件修改video 返回int类型 | 108 | * 根据条件修改video 返回int类型 |
| 108 | * | 109 | * |
| 109 | * @param id | 110 | * @param id |
| 110 | - * @param auditor_id | 111 | + * @param auditorId |
| 111 | * @param updater | 112 | * @param updater |
| 112 | - * @param attr_tags | 113 | + * @param attrTags |
| 113 | * @param state | 114 | * @param state |
| 114 | * @param msg | 115 | * @param msg |
| 115 | * @return | 116 | * @return |
| 116 | */ | 117 | */ |
| 117 | - public int updateVideo(Integer id, String auditor_id, String updater, String attr_tags, Integer state, String msg) { | 118 | + public int updateVideo(Integer id, String auditorId, String updater, String attrTags, Integer state, String msg) { |
| 118 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id); | 119 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id); |
| 119 | - shyVideos.setAuditor_id(auditor_id); | 120 | + shyVideos.setAuditor_id(auditorId); |
| 120 | shyVideos.setState(state); | 121 | shyVideos.setState(state); |
| 121 | - if (CommonUtils.isNotEmpty(attr_tags)) { | ||
| 122 | - shyVideos.setAttr_tags(attr_tags); | 122 | + if (CommonUtils.isNotEmpty(attrTags)) { |
| 123 | + shyVideos.setAttr_tags(attrTags); | ||
| 123 | } | 124 | } |
| 124 | if (CommonUtils.isNotEmpty(msg)) { | 125 | if (CommonUtils.isNotEmpty(msg)) { |
| 125 | shyVideos.setMsg(msg); | 126 | shyVideos.setMsg(msg); |
| 126 | } | 127 | } |
| 127 | shyVideos.setUpdater(updater); | 128 | shyVideos.setUpdater(updater); |
| 128 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 129 | + if (CommonUtils.isNotEmpty(auditorId)) { |
| 129 | shyVideos.setReceive(CommonConst.RECEIVE_AFTER); | 130 | shyVideos.setReceive(CommonConst.RECEIVE_AFTER); |
| 130 | - shyVideos.setReceive_user_id(auditor_id); | 131 | + shyVideos.setReceive_user_id(auditorId); |
| 131 | shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_USER); | 132 | shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_USER); |
| 132 | } | 133 | } |
| 133 | return shyVideosMapper.updateByPrimaryKey(shyVideos); | 134 | return shyVideosMapper.updateByPrimaryKey(shyVideos); |
| @@ -377,7 +378,7 @@ public class VideosServiceImpl { | @@ -377,7 +378,7 @@ public class VideosServiceImpl { | ||
| 377 | } else if (plat.equals(CommonConst.KS_PLAT)) { | 378 | } else if (plat.equals(CommonConst.KS_PLAT)) { |
| 378 | yuming = ks_domain + "/"; | 379 | yuming = ks_domain + "/"; |
| 379 | } | 380 | } |
| 380 | - String url = ""; | 381 | + StringBuilder url = new StringBuilder(); |
| 381 | JSONArray jsonArray = new JSONArray(); | 382 | JSONArray jsonArray = new JSONArray(); |
| 382 | List<String> imgList = JSONArray.parseArray(shyVideos.getAvsample_imgs(), String.class); | 383 | List<String> imgList = JSONArray.parseArray(shyVideos.getAvsample_imgs(), String.class); |
| 383 | for (String imgStr : imgList) { | 384 | for (String imgStr : imgList) { |
| @@ -388,7 +389,7 @@ public class VideosServiceImpl { | @@ -388,7 +389,7 @@ public class VideosServiceImpl { | ||
| 388 | image.put("type", 1); | 389 | image.put("type", 1); |
| 389 | image.put("data", imgUrl); | 390 | image.put("data", imgUrl); |
| 390 | jsonArray.add(image); | 391 | jsonArray.add(image); |
| 391 | - url = url + "(" + uuid + ")"; | 392 | + url.append("(").append(uuid).append(")"); |
| 392 | } | 393 | } |
| 393 | //易盾返回结果的类型 | 394 | //易盾返回结果的类型 |
| 394 | //调用易盾智能图片审核接口 | 395 | //调用易盾智能图片审核接口 |
| @@ -415,7 +416,7 @@ public class VideosServiceImpl { | @@ -415,7 +416,7 @@ public class VideosServiceImpl { | ||
| 415 | ShyYidun shyYidun = new ShyYidun(); | 416 | ShyYidun shyYidun = new ShyYidun(); |
| 416 | shyYidun.setId(UUID.randomUUID().toString()); | 417 | shyYidun.setId(UUID.randomUUID().toString()); |
| 417 | shyYidun.setContent_id(cid.toString()); | 418 | shyYidun.setContent_id(cid.toString()); |
| 418 | - shyYidun.setUrl(url); | 419 | + shyYidun.setUrl(url.toString()); |
| 419 | shyYidun.setDesc_msg(desc); | 420 | shyYidun.setDesc_msg(desc); |
| 420 | //校验图片类型 | 421 | //校验图片类型 |
| 421 | shyYidun.setCheck_type(CommonConstStates.TUPIAN); | 422 | shyYidun.setCheck_type(CommonConstStates.TUPIAN); |
| @@ -491,7 +492,7 @@ public class VideosServiceImpl { | @@ -491,7 +492,7 @@ public class VideosServiceImpl { | ||
| 491 | ShyUsersfree shyUserfree = null; | 492 | ShyUsersfree shyUserfree = null; |
| 492 | //如果用户id存在 | 493 | //如果用户id存在 |
| 493 | if (CommonUtils.isNotEmpty(shyVideo.getVideo_user_id())) { | 494 | if (CommonUtils.isNotEmpty(shyVideo.getVideo_user_id())) { |
| 494 | - shyUserfree = usersfreeServiceImpl.selectUser(shyVideo.getSpid(), shyVideo.getCategory(), shyVideo.getVideo_user_id()); | 495 | + shyUserfree = usersfreeService.selectUser(shyVideo.getSpid(), shyVideo.getCategory(), shyVideo.getVideo_user_id()); |
| 495 | } | 496 | } |
| 496 | //初始化一个审核状态 | 497 | //初始化一个审核状态 |
| 497 | //审核类型,1:免审,2:机审,3:人工审 | 498 | //审核类型,1:免审,2:机审,3:人工审 |
| @@ -537,7 +538,7 @@ public class VideosServiceImpl { | @@ -537,7 +538,7 @@ public class VideosServiceImpl { | ||
| 537 | public String repulse(String shyVideoId, String msg, String userId) { | 538 | public String repulse(String shyVideoId, String msg, String userId) { |
| 538 | String showMsg = ""; | 539 | String showMsg = ""; |
| 539 | ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(shyVideoId)); | 540 | ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(shyVideoId)); |
| 540 | - JSONObject result = null; | 541 | + JSONObject result; |
| 541 | try { | 542 | try { |
| 542 | result = pass.auditPass(shyVideos.getVideo_id(), 4, msg, msg, shyVideos.getCallback()); | 543 | result = pass.auditPass(shyVideos.getVideo_id(), 4, msg, msg, shyVideos.getCallback()); |
| 543 | } catch (Exception e) { | 544 | } catch (Exception e) { |