Commit c7f10d56920e2efdad09cef050c45c5176b004bc
1 parent
d0c12710
开发邮箱、点播活动管理、日志service接口
Showing
14 changed files
with
251 additions
and
77 deletions
src/main/java/com/cnlive/shenhe/api/ShyActivityControllerApi.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.ErrorEnum; | 5 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 6 | import com.cnlive.shenhe.bean.ResponseBean; | 6 | import com.cnlive.shenhe.bean.ResponseBean; |
| 7 | import com.cnlive.shenhe.entity.ShyActivity; | 7 | import com.cnlive.shenhe.entity.ShyActivity; |
| 8 | -import com.cnlive.shenhe.service.serviceImpl.ShyActivityImpl; | 8 | +import com.cnlive.shenhe.service.ShyActivityService; |
| 9 | import org.slf4j.Logger; | 9 | import org.slf4j.Logger; |
| 10 | import org.slf4j.LoggerFactory; | 10 | import org.slf4j.LoggerFactory; |
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -26,7 +26,7 @@ public class ShyActivityControllerApi { | @@ -26,7 +26,7 @@ public class ShyActivityControllerApi { | ||
| 26 | private static Logger logger = LoggerFactory.getLogger(ShyActivityControllerApi.class); | 26 | private static Logger logger = LoggerFactory.getLogger(ShyActivityControllerApi.class); |
| 27 | 27 | ||
| 28 | @Autowired | 28 | @Autowired |
| 29 | - private ShyActivityImpl shyActivityImpl; | 29 | + private ShyActivityService shyActivityService; |
| 30 | 30 | ||
| 31 | @PostMapping("/import") | 31 | @PostMapping("/import") |
| 32 | @ResponseBody | 32 | @ResponseBody |
| @@ -42,10 +42,10 @@ public class ShyActivityControllerApi { | @@ -42,10 +42,10 @@ public class ShyActivityControllerApi { | ||
| 42 | shyActivity.setActivity(activity); | 42 | shyActivity.setActivity(activity); |
| 43 | logger.info("封装对象为:{}", JSON.toJSON(shyActivity)); | 43 | logger.info("封装对象为:{}", JSON.toJSON(shyActivity)); |
| 44 | // 根据id查询是否存在 | 44 | // 根据id查询是否存在 |
| 45 | - Boolean shyActivityObj = shyActivityImpl.selectById(id); | 45 | + Boolean shyActivityObj = shyActivityService.selectById(id); |
| 46 | // 如果对象不存在,就直接添加 | 46 | // 如果对象不存在,就直接添加 |
| 47 | if (shyActivityObj) { | 47 | if (shyActivityObj) { |
| 48 | - Boolean result = shyActivityImpl.insertShyActivity(shyActivity); | 48 | + Boolean result = shyActivityService.insertShyActivity(shyActivity); |
| 49 | if (result) { | 49 | if (result) { |
| 50 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前活动添加成功"); | 50 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前活动添加成功"); |
| 51 | } | 51 | } |
src/main/java/com/cnlive/shenhe/controller/EmailController.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.EmailDTO; | 8 | 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.serviceImpl.EmailServiceImpl; | 11 | +import com.cnlive.shenhe.service.EmailService; |
| 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; |
| @@ -37,7 +37,7 @@ public class EmailController extends BaseController { | @@ -37,7 +37,7 @@ public class EmailController extends BaseController { | ||
| 37 | private static Logger logger = LoggerFactory.getLogger(EmailController.class); | 37 | private static Logger logger = LoggerFactory.getLogger(EmailController.class); |
| 38 | 38 | ||
| 39 | @Autowired | 39 | @Autowired |
| 40 | - EmailServiceImpl emailServiceImpl; | 40 | + EmailService emailService; |
| 41 | @Autowired | 41 | @Autowired |
| 42 | UsersServiceImpl usersService; | 42 | UsersServiceImpl usersService; |
| 43 | 43 | ||
| @@ -56,7 +56,7 @@ public class EmailController extends BaseController { | @@ -56,7 +56,7 @@ public class EmailController extends BaseController { | ||
| 56 | if (CommonUtils.isNull(sessionUser)) { | 56 | if (CommonUtils.isNull(sessionUser)) { |
| 57 | return "redirect:/users/login"; | 57 | return "redirect:/users/login"; |
| 58 | } | 58 | } |
| 59 | - PageInfo<ShyEmail> emailPage = emailServiceImpl.getPage(emailDTO); | 59 | + PageInfo<ShyEmail> emailPage = emailService.getPage(emailDTO); |
| 60 | List<ShyEmail> list = emailPage.getList(); | 60 | List<ShyEmail> list = emailPage.getList(); |
| 61 | JSONObject emailMessage = CommonConst.EMAIL_MESSAGE; | 61 | JSONObject emailMessage = CommonConst.EMAIL_MESSAGE; |
| 62 | if (!list.isEmpty()) { | 62 | if (!list.isEmpty()) { |
| @@ -104,7 +104,7 @@ public class EmailController extends BaseController { | @@ -104,7 +104,7 @@ public class EmailController extends BaseController { | ||
| 104 | @ResponseBody | 104 | @ResponseBody |
| 105 | public ResponseBean updateState(Integer id, Boolean isEnable, HttpSession session) { | 105 | public ResponseBean updateState(Integer id, Boolean isEnable, HttpSession session) { |
| 106 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | 106 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 107 | - Integer n = emailServiceImpl.updateState(id, isEnable, sessionUser.getUserId()); | 107 | + Integer n = emailService.updateState(id, isEnable, sessionUser.getUserId()); |
| 108 | if (n > 0) { | 108 | if (n > 0) { |
| 109 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前用户" + (isEnable == true ? "启用" : "禁用") + "成功"); | 109 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前用户" + (isEnable == true ? "启用" : "禁用") + "成功"); |
| 110 | } | 110 | } |
| @@ -122,7 +122,7 @@ public class EmailController extends BaseController { | @@ -122,7 +122,7 @@ public class EmailController extends BaseController { | ||
| 122 | @ResponseBody | 122 | @ResponseBody |
| 123 | public ResponseBean deleted(Integer id, HttpSession session) { | 123 | public ResponseBean deleted(Integer id, HttpSession session) { |
| 124 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | 124 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 125 | - Integer n = emailServiceImpl.deleted(id, sessionUser.getUserId()); | 125 | + Integer n = emailService.deleted(id, sessionUser.getUserId()); |
| 126 | if (n > 0) { | 126 | if (n > 0) { |
| 127 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "数据删除成功"); | 127 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "数据删除成功"); |
| 128 | } | 128 | } |
| @@ -155,7 +155,7 @@ public class EmailController extends BaseController { | @@ -155,7 +155,7 @@ public class EmailController extends BaseController { | ||
| 155 | } | 155 | } |
| 156 | write = write.substring(1); | 156 | write = write.substring(1); |
| 157 | } | 157 | } |
| 158 | - boolean success = emailServiceImpl.update(id, email, remark, write, sessionUser.getUserId()); | 158 | + boolean success = emailService.update(id, email, remark, write, sessionUser.getUserId()); |
| 159 | if (success) { | 159 | if (success) { |
| 160 | return "redirect:" + redirect_url; | 160 | return "redirect:" + redirect_url; |
| 161 | } else { | 161 | } else { |
src/main/java/com/cnlive/shenhe/controller/ShyActivityController.java
| @@ -5,7 +5,7 @@ import com.cnlive.shenhe.bean.ErrorEnum; | @@ -5,7 +5,7 @@ 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.ShyActivityDTO; | 6 | import com.cnlive.shenhe.dto.ShyActivityDTO; |
| 7 | import com.cnlive.shenhe.entity.ShyActivity; | 7 | import com.cnlive.shenhe.entity.ShyActivity; |
| 8 | -import com.cnlive.shenhe.service.serviceImpl.ShyActivityImpl; | 8 | +import com.cnlive.shenhe.service.ShyActivityService; |
| 9 | import com.github.pagehelper.PageInfo; | 9 | import com.github.pagehelper.PageInfo; |
| 10 | import org.slf4j.Logger; | 10 | import org.slf4j.Logger; |
| 11 | import org.slf4j.LoggerFactory; | 11 | import org.slf4j.LoggerFactory; |
| @@ -17,8 +17,6 @@ import org.springframework.web.bind.annotation.PostMapping; | @@ -17,8 +17,6 @@ import org.springframework.web.bind.annotation.PostMapping; | ||
| 17 | import org.springframework.web.bind.annotation.RequestMapping; | 17 | import org.springframework.web.bind.annotation.RequestMapping; |
| 18 | import org.springframework.web.bind.annotation.ResponseBody; | 18 | import org.springframework.web.bind.annotation.ResponseBody; |
| 19 | 19 | ||
| 20 | -import java.util.List; | ||
| 21 | - | ||
| 22 | /** | 20 | /** |
| 23 | * @author Administrator | 21 | * @author Administrator |
| 24 | * @author yanzhaowang | 22 | * @author yanzhaowang |
| @@ -31,7 +29,7 @@ public class ShyActivityController extends BaseController { | @@ -31,7 +29,7 @@ public class ShyActivityController extends BaseController { | ||
| 31 | private static Logger logger = LoggerFactory.getLogger(ShyActivityController.class); | 29 | private static Logger logger = LoggerFactory.getLogger(ShyActivityController.class); |
| 32 | 30 | ||
| 33 | @Autowired | 31 | @Autowired |
| 34 | - private ShyActivityImpl shyActivityImpl; | 32 | + private ShyActivityService shyActivityService; |
| 35 | 33 | ||
| 36 | /** | 34 | /** |
| 37 | * 添加活动 | 35 | * 添加活动 |
| @@ -43,7 +41,7 @@ public class ShyActivityController extends BaseController { | @@ -43,7 +41,7 @@ public class ShyActivityController extends BaseController { | ||
| 43 | @ResponseBody | 41 | @ResponseBody |
| 44 | public ResponseBean insterShyActivity(ShyActivity shyActivity) { | 42 | public ResponseBean insterShyActivity(ShyActivity shyActivity) { |
| 45 | try { | 43 | try { |
| 46 | - Boolean result = shyActivityImpl.insertShyActivity(shyActivity); | 44 | + Boolean result = shyActivityService.insertShyActivity(shyActivity); |
| 47 | if (result) { | 45 | if (result) { |
| 48 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前活动添加成功"); | 46 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前活动添加成功"); |
| 49 | } | 47 | } |
| @@ -63,7 +61,7 @@ public class ShyActivityController extends BaseController { | @@ -63,7 +61,7 @@ public class ShyActivityController extends BaseController { | ||
| 63 | @PostMapping("/delete") | 61 | @PostMapping("/delete") |
| 64 | @ResponseBody | 62 | @ResponseBody |
| 65 | public ResponseBean deleteShyActivity(Integer id) { | 63 | public ResponseBean deleteShyActivity(Integer id) { |
| 66 | - Boolean result = shyActivityImpl.deleteShyActivity(id); | 64 | + Boolean result = shyActivityService.deleteShyActivity(id); |
| 67 | if (result) { | 65 | if (result) { |
| 68 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "删除当前活动成功"); | 66 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "删除当前活动成功"); |
| 69 | } | 67 | } |
| @@ -81,7 +79,7 @@ public class ShyActivityController extends BaseController { | @@ -81,7 +79,7 @@ public class ShyActivityController extends BaseController { | ||
| 81 | @ResponseBody | 79 | @ResponseBody |
| 82 | public ResponseBean updateShyActivity(ShyActivity shyActivity) { | 80 | public ResponseBean updateShyActivity(ShyActivity shyActivity) { |
| 83 | try { | 81 | try { |
| 84 | - Boolean result = shyActivityImpl.updateShyActivity(shyActivity); | 82 | + Boolean result = shyActivityService.updateShyActivity(shyActivity); |
| 85 | if (result) { | 83 | if (result) { |
| 86 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "修改当前活动成功"); | 84 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "修改当前活动成功"); |
| 87 | } | 85 | } |
| @@ -103,12 +101,9 @@ public class ShyActivityController extends BaseController { | @@ -103,12 +101,9 @@ public class ShyActivityController extends BaseController { | ||
| 103 | @GetMapping("/page") | 101 | @GetMapping("/page") |
| 104 | public String getShyActivity(ShyActivityDTO shyActivityDTO, Model model) { | 102 | public String getShyActivity(ShyActivityDTO shyActivityDTO, Model model) { |
| 105 | logger.info("列表请求参数:{}", JSON.toJSONString(shyActivityDTO)); | 103 | logger.info("列表请求参数:{}", JSON.toJSONString(shyActivityDTO)); |
| 106 | - PageInfo<ShyActivity> shyActivityPageInfo = shyActivityImpl.selectByExample(shyActivityDTO); | ||
| 107 | - List<ShyActivity> list = shyActivityPageInfo.getList(); | 104 | + PageInfo<ShyActivity> shyActivityPageInfo = shyActivityService.selectByExample(shyActivityDTO); |
| 108 | model.addAttribute("exempt_from_trial", shyActivityDTO.getExempt_from_trial()); | 105 | model.addAttribute("exempt_from_trial", shyActivityDTO.getExempt_from_trial()); |
| 109 | model.addAttribute("ShyActivitylist", shyActivityPageInfo); | 106 | model.addAttribute("ShyActivitylist", shyActivityPageInfo); |
| 110 | return "page/activity.html"; | 107 | return "page/activity.html"; |
| 111 | } | 108 | } |
| 112 | - | ||
| 113 | - | ||
| 114 | } | 109 | } |
src/main/java/com/cnlive/shenhe/controller/ShyLogController.java
| @@ -5,7 +5,7 @@ import com.cnlive.shenhe.bean.ErrorEnum; | @@ -5,7 +5,7 @@ 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.ShyLogDTO; | 6 | import com.cnlive.shenhe.dto.ShyLogDTO; |
| 7 | import com.cnlive.shenhe.entity.ShyLog; | 7 | import com.cnlive.shenhe.entity.ShyLog; |
| 8 | -import com.cnlive.shenhe.service.serviceImpl.ShyLogServiceImpl; | 8 | +import com.cnlive.shenhe.service.ShyLogService; |
| 9 | import com.github.pagehelper.PageInfo; | 9 | import com.github.pagehelper.PageInfo; |
| 10 | import org.slf4j.Logger; | 10 | import org.slf4j.Logger; |
| 11 | import org.slf4j.LoggerFactory; | 11 | import org.slf4j.LoggerFactory; |
| @@ -28,7 +28,7 @@ public class ShyLogController { | @@ -28,7 +28,7 @@ public class ShyLogController { | ||
| 28 | private static Logger logger = LoggerFactory.getLogger(ShyLogController.class); | 28 | private static Logger logger = LoggerFactory.getLogger(ShyLogController.class); |
| 29 | 29 | ||
| 30 | @Autowired | 30 | @Autowired |
| 31 | - private ShyLogServiceImpl shyLogServiceImpl; | 31 | + private ShyLogService shyLogService; |
| 32 | 32 | ||
| 33 | /** | 33 | /** |
| 34 | * 获取分页列表数据 | 34 | * 获取分页列表数据 |
| @@ -40,7 +40,7 @@ public class ShyLogController { | @@ -40,7 +40,7 @@ public class ShyLogController { | ||
| 40 | @GetMapping("/page") | 40 | @GetMapping("/page") |
| 41 | public String getShyLog(ShyLogDTO shyLogDTO, Model model) { | 41 | public String getShyLog(ShyLogDTO shyLogDTO, Model model) { |
| 42 | logger.info("进入查询日志方法,接受的对象为,ShyLogDTO:{}", JSON.toJSONString(shyLogDTO)); | 42 | logger.info("进入查询日志方法,接受的对象为,ShyLogDTO:{}", JSON.toJSONString(shyLogDTO)); |
| 43 | - PageInfo<ShyLog> shyLogPageInfo = shyLogServiceImpl.selectByExample(shyLogDTO); | 43 | + PageInfo<ShyLog> shyLogPageInfo = shyLogService.selectByExample(shyLogDTO); |
| 44 | model.addAttribute("shyLogPageInfo", shyLogPageInfo); | 44 | model.addAttribute("shyLogPageInfo", shyLogPageInfo); |
| 45 | return "page/log.html"; | 45 | return "page/log.html"; |
| 46 | } | 46 | } |
| @@ -55,7 +55,7 @@ public class ShyLogController { | @@ -55,7 +55,7 @@ public class ShyLogController { | ||
| 55 | @ResponseBody | 55 | @ResponseBody |
| 56 | public ResponseBean insterShyLog(ShyLog shyLog) { | 56 | public ResponseBean insterShyLog(ShyLog shyLog) { |
| 57 | logger.info("访问了日志添加方法,接受的对象为,ShyLog:{}", JSON.toJSONString(shyLog)); | 57 | logger.info("访问了日志添加方法,接受的对象为,ShyLog:{}", JSON.toJSONString(shyLog)); |
| 58 | - Boolean result = shyLogServiceImpl.addShyLog(shyLog); | 58 | + Boolean result = shyLogService.addShyLog(shyLog); |
| 59 | if (result) { | 59 | if (result) { |
| 60 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前日志添加成功"); | 60 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前日志添加成功"); |
| 61 | } | 61 | } |
src/main/java/com/cnlive/shenhe/controller/UsersController.java
| @@ -7,7 +7,7 @@ import com.cnlive.shenhe.dto.UsersDTO; | @@ -7,7 +7,7 @@ import com.cnlive.shenhe.dto.UsersDTO; | ||
| 7 | import com.cnlive.shenhe.entity.ShyLog; | 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.serviceImpl.ShyLogServiceImpl; | 10 | +import com.cnlive.shenhe.service.ShyLogService; |
| 11 | import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; | 11 | import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; |
| 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; |
| @@ -44,7 +44,7 @@ public class UsersController extends BaseController { | @@ -44,7 +44,7 @@ public class UsersController extends BaseController { | ||
| 44 | @Autowired | 44 | @Autowired |
| 45 | private SitesServiceImpl sitesService; | 45 | private SitesServiceImpl sitesService; |
| 46 | @Autowired | 46 | @Autowired |
| 47 | - private ShyLogServiceImpl shyLogService; | 47 | + private ShyLogService shyLogService; |
| 48 | 48 | ||
| 49 | /** | 49 | /** |
| 50 | * 登录入口 | 50 | * 登录入口 |
src/main/java/com/cnlive/shenhe/controller/VideosController.java
| @@ -7,7 +7,11 @@ import com.cnlive.shenhe.bean.ResponseBean; | @@ -7,7 +7,11 @@ import com.cnlive.shenhe.bean.ResponseBean; | ||
| 7 | import com.cnlive.shenhe.bean.SessionUser; | 7 | import com.cnlive.shenhe.bean.SessionUser; |
| 8 | import com.cnlive.shenhe.dto.VideosDTO; | 8 | import com.cnlive.shenhe.dto.VideosDTO; |
| 9 | import com.cnlive.shenhe.entity.*; | 9 | import com.cnlive.shenhe.entity.*; |
| 10 | -import com.cnlive.shenhe.service.serviceImpl.*; | 10 | +import com.cnlive.shenhe.service.ShyActivityService; |
| 11 | +import com.cnlive.shenhe.service.ShyLogService; | ||
| 12 | +import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; | ||
| 13 | +import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; | ||
| 14 | +import com.cnlive.shenhe.service.serviceImpl.VideosServiceImpl; | ||
| 11 | import com.cnlive.shenhe.utils.AuditPass; | 15 | import com.cnlive.shenhe.utils.AuditPass; |
| 12 | import com.cnlive.shenhe.utils.CommonConst; | 16 | import com.cnlive.shenhe.utils.CommonConst; |
| 13 | import com.cnlive.shenhe.utils.CommonUtils; | 17 | import com.cnlive.shenhe.utils.CommonUtils; |
| @@ -53,9 +57,9 @@ public class VideosController extends BaseController { | @@ -53,9 +57,9 @@ public class VideosController extends BaseController { | ||
| 53 | @Autowired | 57 | @Autowired |
| 54 | private SitesServiceImpl sitesService; | 58 | private SitesServiceImpl sitesService; |
| 55 | @Autowired | 59 | @Autowired |
| 56 | - private ShyActivityImpl shyActivityImpl; | 60 | + private ShyActivityService shyActivityService; |
| 57 | @Autowired | 61 | @Autowired |
| 58 | - private ShyLogServiceImpl shyLogService; | 62 | + private ShyLogService shyLogService; |
| 59 | 63 | ||
| 60 | @Value("${qn_domain}") | 64 | @Value("${qn_domain}") |
| 61 | private String qn_domain; | 65 | private String qn_domain; |
| @@ -179,7 +183,7 @@ public class VideosController extends BaseController { | @@ -179,7 +183,7 @@ public class VideosController extends BaseController { | ||
| 179 | 183 | ||
| 180 | PageInfo<ShyVideos> videoPage = videosService.getListVideo(videosDTO); | 184 | PageInfo<ShyVideos> videoPage = videosService.getListVideo(videosDTO); |
| 181 | //查询查询条件 | 185 | //查询查询条件 |
| 182 | - List<ShyActivity> activityList = shyActivityImpl.selectAll(); | 186 | + List<ShyActivity> activityList = shyActivityService.selectAll(); |
| 183 | List<ShyVideos> list = videoPage.getList(); | 187 | List<ShyVideos> list = videoPage.getList(); |
| 184 | if (!list.isEmpty()) { | 188 | if (!list.isEmpty()) { |
| 185 | for (ShyVideos videos : list) { | 189 | for (ShyVideos videos : list) { |
| @@ -263,7 +267,7 @@ public class VideosController extends BaseController { | @@ -263,7 +267,7 @@ public class VideosController extends BaseController { | ||
| 263 | yuming = ks_domain + "/"; | 267 | yuming = ks_domain + "/"; |
| 264 | } | 268 | } |
| 265 | detailsContent.setAttr_tags(CommonUtils.isEmpty(detailsContent.getAttr_tags()) ? "" : detailsContent.getAttr_tags()); | 269 | detailsContent.setAttr_tags(CommonUtils.isEmpty(detailsContent.getAttr_tags()) ? "" : detailsContent.getAttr_tags()); |
| 266 | - List<ShyActivity> activityList = shyActivityImpl.selectAll(); | 270 | + List<ShyActivity> activityList = shyActivityService.selectAll(); |
| 267 | ShySites shySites = sitesService.findspidDescByspid(detailsContent.getSpid()); | 271 | ShySites shySites = sitesService.findspidDescByspid(detailsContent.getSpid()); |
| 268 | if (CommonUtils.isNotNull(shySites)) { | 272 | if (CommonUtils.isNotNull(shySites)) { |
| 269 | if (CommonUtils.isNotEmpty(detailsContent.getCategory()) && detailsContent.getCategory().equals(CommonConst.CATEGORY_WITNESS)) { | 273 | if (CommonUtils.isNotEmpty(detailsContent.getCategory()) && detailsContent.getCategory().equals(CommonConst.CATEGORY_WITNESS)) { |
src/main/java/com/cnlive/shenhe/job/LiveApplyJob.java
| @@ -5,8 +5,8 @@ import com.cnlive.shenhe.entity.ShyEmail; | @@ -5,8 +5,8 @@ import com.cnlive.shenhe.entity.ShyEmail; | ||
| 5 | import com.cnlive.shenhe.entity.ShyLiveapply; | 5 | import com.cnlive.shenhe.entity.ShyLiveapply; |
| 6 | import com.cnlive.shenhe.entity.ShySites; | 6 | 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.LiveApplyService; | 9 | import com.cnlive.shenhe.service.LiveApplyService; |
| 9 | -import com.cnlive.shenhe.service.serviceImpl.EmailServiceImpl; | ||
| 10 | import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; | 10 | import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; |
| 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; |
| @@ -57,7 +57,7 @@ public class LiveApplyJob { | @@ -57,7 +57,7 @@ public class LiveApplyJob { | ||
| 57 | ShyLiveapplyMapper shyLiveApplyMapper; | 57 | ShyLiveapplyMapper shyLiveApplyMapper; |
| 58 | 58 | ||
| 59 | @Autowired | 59 | @Autowired |
| 60 | - EmailServiceImpl emailServiceImpl; | 60 | + EmailService emailService; |
| 61 | 61 | ||
| 62 | @Scheduled(fixedRate = 60 * 1000) | 62 | @Scheduled(fixedRate = 60 * 1000) |
| 63 | public void updateLiveApply() { | 63 | public void updateLiveApply() { |
| @@ -93,7 +93,7 @@ public class LiveApplyJob { | @@ -93,7 +93,7 @@ public class LiveApplyJob { | ||
| 93 | String app_key = email_app_key; | 93 | String app_key = email_app_key; |
| 94 | //调用邮件发送服务器的地址 | 94 | //调用邮件发送服务器的地址 |
| 95 | String URL = email_send_URL; | 95 | String URL = email_send_URL; |
| 96 | - List<ShyEmail> shyEmailList = emailServiceImpl.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()); |
| @@ -144,7 +144,7 @@ public class LiveApplyJob { | @@ -144,7 +144,7 @@ public class LiveApplyJob { | ||
| 144 | notice_msg = notice_msg + "\n" + dateTime + " 邮件" + emailAddr + "(" + shyEmail.getRemark() + ")发送成功"; | 144 | notice_msg = notice_msg + "\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; | 148 | notice_state = CommonConst.NOTICE_FAIL; |
| 149 | notice_msg = notice_msg + "\n" + dateTime + " 邮件服务器调用失败,服务器报错了"; | 149 | notice_msg = notice_msg + "\n" + dateTime + " 邮件服务器调用失败,服务器报错了"; |
| 150 | break; | 150 | break; |
src/main/java/com/cnlive/shenhe/service/EmailService.java
0 → 100644
| 1 | +package com.cnlive.shenhe.service; | ||
| 2 | + | ||
| 3 | +import com.cnlive.shenhe.dto.EmailDTO; | ||
| 4 | +import com.cnlive.shenhe.entity.ShyEmail; | ||
| 5 | +import com.github.pagehelper.PageInfo; | ||
| 6 | + | ||
| 7 | +import java.util.List; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * @Author: yan-zhao-wang | ||
| 11 | + * @DateTime: 2022-11-03 15:02 | ||
| 12 | + */ | ||
| 13 | +public interface EmailService { | ||
| 14 | + /** | ||
| 15 | + * 获取 分页 条件查询的结果集 | ||
| 16 | + * | ||
| 17 | + * @param emailDTO | ||
| 18 | + * @return | ||
| 19 | + */ | ||
| 20 | + PageInfo<ShyEmail> getPage(EmailDTO emailDTO); | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 根据主键id查询对象 | ||
| 24 | + * | ||
| 25 | + * @param id | ||
| 26 | + * @return | ||
| 27 | + */ | ||
| 28 | + ShyEmail get(Integer id); | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 根据条件查询对象 | ||
| 32 | + * | ||
| 33 | + * @param shyEmail | ||
| 34 | + * @return | ||
| 35 | + */ | ||
| 36 | + ShyEmail select(ShyEmail shyEmail); | ||
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * 修改状态 | ||
| 40 | + * | ||
| 41 | + * @param id | ||
| 42 | + * @param isEnable | ||
| 43 | + * @param userId | ||
| 44 | + * @return | ||
| 45 | + */ | ||
| 46 | + Integer updateState(Integer id, Boolean isEnable, String userId); | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 删除 | ||
| 50 | + * | ||
| 51 | + * @param id | ||
| 52 | + * @param userId | ||
| 53 | + * @return | ||
| 54 | + */ | ||
| 55 | + Integer deleted(Integer id, String userId); | ||
| 56 | + | ||
| 57 | + /** | ||
| 58 | + * 修改 | ||
| 59 | + * | ||
| 60 | + * @param id | ||
| 61 | + * @param email | ||
| 62 | + * @param remark | ||
| 63 | + * @param write | ||
| 64 | + * @param updater | ||
| 65 | + * @return | ||
| 66 | + */ | ||
| 67 | + boolean update(Integer id, String email, String remark, String write, String updater); | ||
| 68 | + | ||
| 69 | + /** | ||
| 70 | + * 通过邮件发送类型,获取需要发送邮件的list | ||
| 71 | + * | ||
| 72 | + * @param emailSendType | ||
| 73 | + * @return | ||
| 74 | + */ | ||
| 75 | + List<ShyEmail> getEmailSendList(Integer emailSendType); | ||
| 76 | +} |
src/main/java/com/cnlive/shenhe/service/ShyActivityService.java
0 → 100644
| 1 | +package com.cnlive.shenhe.service; | ||
| 2 | + | ||
| 3 | +import com.cnlive.shenhe.dto.ShyActivityDTO; | ||
| 4 | +import com.cnlive.shenhe.entity.ShyActivity; | ||
| 5 | +import com.github.pagehelper.PageInfo; | ||
| 6 | + | ||
| 7 | +import java.util.List; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * @Author: yan-zhao-wang | ||
| 11 | + * @DateTime: 2022-11-03 15:02 | ||
| 12 | + */ | ||
| 13 | +public interface ShyActivityService { | ||
| 14 | + /** | ||
| 15 | + * 添加活动 | ||
| 16 | + * | ||
| 17 | + * @param shyActivity | ||
| 18 | + * @return | ||
| 19 | + */ | ||
| 20 | + Boolean insertShyActivity(ShyActivity shyActivity); | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 根据主键删除活动 | ||
| 24 | + * | ||
| 25 | + * @param id | ||
| 26 | + * @return | ||
| 27 | + */ | ||
| 28 | + Boolean deleteShyActivity(Integer id); | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 修改活动 | ||
| 32 | + * | ||
| 33 | + * @param shyActivity | ||
| 34 | + * @return | ||
| 35 | + */ | ||
| 36 | + Boolean updateShyActivity(ShyActivity shyActivity); | ||
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * 查询活动 | ||
| 40 | + * | ||
| 41 | + * @param shyActivityDTO | ||
| 42 | + * @return | ||
| 43 | + */ | ||
| 44 | + PageInfo<ShyActivity> selectByExample(ShyActivityDTO shyActivityDTO); | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 根据条件查询活动 | ||
| 48 | + * | ||
| 49 | + * @param exemptFromTrial | ||
| 50 | + * @return | ||
| 51 | + */ | ||
| 52 | + List<Integer> selectByExample(Integer exemptFromTrial); | ||
| 53 | + | ||
| 54 | + /** | ||
| 55 | + * 查询所有的数据 | ||
| 56 | + * | ||
| 57 | + * @return | ||
| 58 | + */ | ||
| 59 | + List<ShyActivity> selectAll(); | ||
| 60 | + | ||
| 61 | + /** | ||
| 62 | + * 根据id查询单个对象 | ||
| 63 | + * | ||
| 64 | + * @param id | ||
| 65 | + * @return | ||
| 66 | + */ | ||
| 67 | + Boolean selectById(Integer id); | ||
| 68 | + | ||
| 69 | + /** | ||
| 70 | + * 根据source查询审核类型 | ||
| 71 | + * | ||
| 72 | + * @param id | ||
| 73 | + * @return | ||
| 74 | + */ | ||
| 75 | + Integer selectBySource(Integer id); | ||
| 76 | +} |
src/main/java/com/cnlive/shenhe/service/ShyLogService.java
0 → 100644
| 1 | +package com.cnlive.shenhe.service; | ||
| 2 | + | ||
| 3 | +import com.cnlive.shenhe.dto.ShyLogDTO; | ||
| 4 | +import com.cnlive.shenhe.entity.ShyLog; | ||
| 5 | +import com.github.pagehelper.PageInfo; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * @Author: yan-zhao-wang | ||
| 9 | + * @DateTime: 2022-11-03 15:03 | ||
| 10 | + */ | ||
| 11 | +public interface ShyLogService { | ||
| 12 | + /** | ||
| 13 | + * 查询所有的日志 | ||
| 14 | + * | ||
| 15 | + * @param shyLogDTO | ||
| 16 | + * @return | ||
| 17 | + */ | ||
| 18 | + PageInfo<ShyLog> selectByExample(ShyLogDTO shyLogDTO); | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 添加日志记录 | ||
| 22 | + * | ||
| 23 | + * @param shyLog | ||
| 24 | + * @return | ||
| 25 | + */ | ||
| 26 | + Boolean addShyLog(ShyLog shyLog); | ||
| 27 | +} |
src/main/java/com/cnlive/shenhe/service/serviceImpl/EmailServiceImpl.java
| @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; | @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; | ||
| 5 | import com.cnlive.shenhe.dto.EmailDTO; | 5 | import com.cnlive.shenhe.dto.EmailDTO; |
| 6 | import com.cnlive.shenhe.entity.ShyEmail; | 6 | import com.cnlive.shenhe.entity.ShyEmail; |
| 7 | import com.cnlive.shenhe.mapper.ShyEmailMapper; | 7 | import com.cnlive.shenhe.mapper.ShyEmailMapper; |
| 8 | +import com.cnlive.shenhe.service.EmailService; | ||
| 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; |
| @@ -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 EmailServiceImpl { | 28 | +public class EmailServiceImpl implements EmailService { |
| 28 | private static Logger logger = LoggerFactory.getLogger(EmailServiceImpl.class); | 29 | private static Logger logger = LoggerFactory.getLogger(EmailServiceImpl.class); |
| 29 | @Autowired | 30 | @Autowired |
| 30 | ShyEmailMapper shyEmailMapper; | 31 | ShyEmailMapper shyEmailMapper; |
| @@ -35,6 +36,7 @@ public class EmailServiceImpl { | @@ -35,6 +36,7 @@ public class EmailServiceImpl { | ||
| 35 | * @param emailDTO | 36 | * @param emailDTO |
| 36 | * @return | 37 | * @return |
| 37 | */ | 38 | */ |
| 39 | + @Override | ||
| 38 | public PageInfo<ShyEmail> getPage(EmailDTO emailDTO) { | 40 | public PageInfo<ShyEmail> getPage(EmailDTO emailDTO) { |
| 39 | logger.info("接受参数列表为:{}", JSON.toJSONString(emailDTO)); | 41 | logger.info("接受参数列表为:{}", JSON.toJSONString(emailDTO)); |
| 40 | Example example = new Example(ShyEmail.class); | 42 | Example example = new Example(ShyEmail.class); |
| @@ -63,6 +65,7 @@ public class EmailServiceImpl { | @@ -63,6 +65,7 @@ public class EmailServiceImpl { | ||
| 63 | * @param id | 65 | * @param id |
| 64 | * @return | 66 | * @return |
| 65 | */ | 67 | */ |
| 68 | + @Override | ||
| 66 | public ShyEmail get(Integer id) { | 69 | public ShyEmail get(Integer id) { |
| 67 | return shyEmailMapper.selectByPrimaryKey(id); | 70 | return shyEmailMapper.selectByPrimaryKey(id); |
| 68 | } | 71 | } |
| @@ -73,7 +76,7 @@ public class EmailServiceImpl { | @@ -73,7 +76,7 @@ public class EmailServiceImpl { | ||
| 73 | * @param shyEmail | 76 | * @param shyEmail |
| 74 | * @return | 77 | * @return |
| 75 | */ | 78 | */ |
| 76 | - | 79 | + @Override |
| 77 | public ShyEmail select(ShyEmail shyEmail) { | 80 | public ShyEmail select(ShyEmail shyEmail) { |
| 78 | return shyEmailMapper.selectOne(shyEmail); | 81 | return shyEmailMapper.selectOne(shyEmail); |
| 79 | } | 82 | } |
| @@ -86,6 +89,7 @@ public class EmailServiceImpl { | @@ -86,6 +89,7 @@ public class EmailServiceImpl { | ||
| 86 | * @param userId | 89 | * @param userId |
| 87 | * @return | 90 | * @return |
| 88 | */ | 91 | */ |
| 92 | + @Override | ||
| 89 | public Integer updateState(Integer id, Boolean isEnable, String userId) { | 93 | public Integer updateState(Integer id, Boolean isEnable, String userId) { |
| 90 | ShyEmail shyEmail = get(id); | 94 | ShyEmail shyEmail = get(id); |
| 91 | shyEmail.setIs_enable(isEnable); | 95 | shyEmail.setIs_enable(isEnable); |
| @@ -101,6 +105,7 @@ public class EmailServiceImpl { | @@ -101,6 +105,7 @@ public class EmailServiceImpl { | ||
| 101 | * @param userId | 105 | * @param userId |
| 102 | * @return | 106 | * @return |
| 103 | */ | 107 | */ |
| 108 | + @Override | ||
| 104 | public Integer deleted(Integer id, String userId) { | 109 | public Integer deleted(Integer id, String userId) { |
| 105 | ShyEmail shyEmail = get(id); | 110 | ShyEmail shyEmail = get(id); |
| 106 | shyEmail.setUpdater(userId); | 111 | shyEmail.setUpdater(userId); |
| @@ -119,6 +124,7 @@ public class EmailServiceImpl { | @@ -119,6 +124,7 @@ public class EmailServiceImpl { | ||
| 119 | * @param updater | 124 | * @param updater |
| 120 | * @return | 125 | * @return |
| 121 | */ | 126 | */ |
| 127 | + @Override | ||
| 122 | public boolean update(Integer id, String email, String remark, String write, String updater) { | 128 | public boolean update(Integer id, String email, String remark, String write, String updater) { |
| 123 | 129 | ||
| 124 | ShyEmail shyEmail = new ShyEmail(); | 130 | ShyEmail shyEmail = new ShyEmail(); |
| @@ -132,9 +138,7 @@ public class EmailServiceImpl { | @@ -132,9 +138,7 @@ public class EmailServiceImpl { | ||
| 132 | shyEmail.setUpdater(updater); | 138 | shyEmail.setUpdater(updater); |
| 133 | shyEmail.setUpdated_at(CommonUtils.getCurrentTime()); | 139 | shyEmail.setUpdated_at(CommonUtils.getCurrentTime()); |
| 134 | int re = shyEmailMapper.updateByPrimaryKeySelective(shyEmail); | 140 | int re = shyEmailMapper.updateByPrimaryKeySelective(shyEmail); |
| 135 | - if (re != 1) { | ||
| 136 | - return false; | ||
| 137 | - } | 141 | + return re == 1; |
| 138 | } | 142 | } |
| 139 | } else { | 143 | } else { |
| 140 | shyEmail.setEmail(email); | 144 | shyEmail.setEmail(email); |
| @@ -146,9 +150,7 @@ public class EmailServiceImpl { | @@ -146,9 +150,7 @@ public class EmailServiceImpl { | ||
| 146 | shyEmail.setCreated_at(CommonUtils.getCurrentTime()); | 150 | shyEmail.setCreated_at(CommonUtils.getCurrentTime()); |
| 147 | shyEmail.setUpdated_at(CommonUtils.getCurrentTime()); | 151 | shyEmail.setUpdated_at(CommonUtils.getCurrentTime()); |
| 148 | int re = shyEmailMapper.insertSelective(shyEmail); | 152 | int re = shyEmailMapper.insertSelective(shyEmail); |
| 149 | - if (re != 1) { | ||
| 150 | - return false; | ||
| 151 | - } | 153 | + return re == 1; |
| 152 | } | 154 | } |
| 153 | return true; | 155 | return true; |
| 154 | } | 156 | } |
| @@ -159,6 +161,7 @@ public class EmailServiceImpl { | @@ -159,6 +161,7 @@ public class EmailServiceImpl { | ||
| 159 | * @param emailSendType | 161 | * @param emailSendType |
| 160 | * @return | 162 | * @return |
| 161 | */ | 163 | */ |
| 164 | + @Override | ||
| 162 | public List<ShyEmail> getEmailSendList(Integer emailSendType) { | 165 | public List<ShyEmail> getEmailSendList(Integer emailSendType) { |
| 163 | ShyEmail shyEmail = new ShyEmail(); | 166 | ShyEmail shyEmail = new ShyEmail(); |
| 164 | shyEmail.setIs_delete(false); | 167 | shyEmail.setIs_delete(false); |
| @@ -175,7 +178,5 @@ public class EmailServiceImpl { | @@ -175,7 +178,5 @@ public class EmailServiceImpl { | ||
| 175 | } | 178 | } |
| 176 | } | 179 | } |
| 177 | return emailList; | 180 | return emailList; |
| 178 | - | ||
| 179 | } | 181 | } |
| 180 | - | ||
| 181 | } | 182 | } |
src/main/java/com/cnlive/shenhe/service/serviceImpl/ShyActivityImpl.java renamed to src/main/java/com/cnlive/shenhe/service/serviceImpl/ShyActivityServiceImpl.java
| @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; | @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; | ||
| 5 | import com.cnlive.shenhe.dto.ShyActivityDTO; | 5 | import com.cnlive.shenhe.dto.ShyActivityDTO; |
| 6 | import com.cnlive.shenhe.entity.ShyActivity; | 6 | import com.cnlive.shenhe.entity.ShyActivity; |
| 7 | import com.cnlive.shenhe.mapper.ShyActivityMapper; | 7 | import com.cnlive.shenhe.mapper.ShyActivityMapper; |
| 8 | +import com.cnlive.shenhe.service.ShyActivityService; | ||
| 8 | import com.cnlive.shenhe.utils.CommonConst; | 9 | import com.cnlive.shenhe.utils.CommonConst; |
| 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; |
| @@ -24,9 +25,9 @@ import java.util.List; | @@ -24,9 +25,9 @@ import java.util.List; | ||
| 24 | * @create 2022-03-08 10:43 | 25 | * @create 2022-03-08 10:43 |
| 25 | */ | 26 | */ |
| 26 | @Service | 27 | @Service |
| 27 | -public class ShyActivityImpl { | 28 | +public class ShyActivityServiceImpl implements ShyActivityService { |
| 28 | 29 | ||
| 29 | - private static Logger logger = LoggerFactory.getLogger(ShyActivityImpl.class); | 30 | + private static Logger logger = LoggerFactory.getLogger(ShyActivityServiceImpl.class); |
| 30 | 31 | ||
| 31 | @Autowired | 32 | @Autowired |
| 32 | private ShyActivityMapper shyActivityMapper; | 33 | private ShyActivityMapper shyActivityMapper; |
| @@ -37,6 +38,7 @@ public class ShyActivityImpl { | @@ -37,6 +38,7 @@ public class ShyActivityImpl { | ||
| 37 | * @param shyActivity | 38 | * @param shyActivity |
| 38 | * @return | 39 | * @return |
| 39 | */ | 40 | */ |
| 41 | + @Override | ||
| 40 | public Boolean insertShyActivity(ShyActivity shyActivity) { | 42 | public Boolean insertShyActivity(ShyActivity shyActivity) { |
| 41 | Date date = new Date(); | 43 | Date date = new Date(); |
| 42 | shyActivity.setCreate_time(date); | 44 | shyActivity.setCreate_time(date); |
| @@ -44,10 +46,7 @@ public class ShyActivityImpl { | @@ -44,10 +46,7 @@ public class ShyActivityImpl { | ||
| 44 | shyActivity.setExempt_from_trial(CommonConst.AUDIT_TYPE_USER); | 46 | shyActivity.setExempt_from_trial(CommonConst.AUDIT_TYPE_USER); |
| 45 | logger.info("添加对象为:{}", JSON.toJSON(shyActivity)); | 47 | logger.info("添加对象为:{}", JSON.toJSON(shyActivity)); |
| 46 | int result = shyActivityMapper.insertSelective(shyActivity); | 48 | int result = shyActivityMapper.insertSelective(shyActivity); |
| 47 | - if (result > 0) { | ||
| 48 | - return true; | ||
| 49 | - } | ||
| 50 | - return false; | 49 | + return result > 0; |
| 51 | } | 50 | } |
| 52 | 51 | ||
| 53 | /** | 52 | /** |
| @@ -56,12 +55,10 @@ public class ShyActivityImpl { | @@ -56,12 +55,10 @@ public class ShyActivityImpl { | ||
| 56 | * @param id | 55 | * @param id |
| 57 | * @return | 56 | * @return |
| 58 | */ | 57 | */ |
| 58 | + @Override | ||
| 59 | public Boolean deleteShyActivity(Integer id) { | 59 | public Boolean deleteShyActivity(Integer id) { |
| 60 | int result = shyActivityMapper.deleteByPrimaryKey(id); | 60 | int result = shyActivityMapper.deleteByPrimaryKey(id); |
| 61 | - if (result > 0) { | ||
| 62 | - return true; | ||
| 63 | - } | ||
| 64 | - return false; | 61 | + return result > 0; |
| 65 | } | 62 | } |
| 66 | 63 | ||
| 67 | /** | 64 | /** |
| @@ -70,16 +67,14 @@ public class ShyActivityImpl { | @@ -70,16 +67,14 @@ public class ShyActivityImpl { | ||
| 70 | * @param shyActivity | 67 | * @param shyActivity |
| 71 | * @return | 68 | * @return |
| 72 | */ | 69 | */ |
| 70 | + @Override | ||
| 73 | public Boolean updateShyActivity(ShyActivity shyActivity) { | 71 | public Boolean updateShyActivity(ShyActivity shyActivity) { |
| 74 | Date date = new Date(); | 72 | Date date = new Date(); |
| 75 | shyActivity.setCreate_time(date); | 73 | shyActivity.setCreate_time(date); |
| 76 | shyActivity.setUpdate_time(date); | 74 | shyActivity.setUpdate_time(date); |
| 77 | logger.info("修改对象为:{}", JSON.toJSON(shyActivity)); | 75 | logger.info("修改对象为:{}", JSON.toJSON(shyActivity)); |
| 78 | int result = shyActivityMapper.updateByPrimaryKeySelective(shyActivity); | 76 | int result = shyActivityMapper.updateByPrimaryKeySelective(shyActivity); |
| 79 | - if (result > 0) { | ||
| 80 | - return true; | ||
| 81 | - } | ||
| 82 | - return false; | 77 | + return result > 0; |
| 83 | } | 78 | } |
| 84 | 79 | ||
| 85 | /** | 80 | /** |
| @@ -88,6 +83,7 @@ public class ShyActivityImpl { | @@ -88,6 +83,7 @@ public class ShyActivityImpl { | ||
| 88 | * @param shyActivityDTO | 83 | * @param shyActivityDTO |
| 89 | * @return | 84 | * @return |
| 90 | */ | 85 | */ |
| 86 | + @Override | ||
| 91 | public PageInfo<ShyActivity> selectByExample(ShyActivityDTO shyActivityDTO) { | 87 | public PageInfo<ShyActivity> selectByExample(ShyActivityDTO shyActivityDTO) { |
| 92 | logger.info("参数接受对象为,ShyActivityDTO:{}", JSON.toJSONString(shyActivityDTO)); | 88 | logger.info("参数接受对象为,ShyActivityDTO:{}", JSON.toJSONString(shyActivityDTO)); |
| 93 | Example example = new Example(ShyActivity.class); | 89 | Example example = new Example(ShyActivity.class); |
| @@ -119,9 +115,9 @@ public class ShyActivityImpl { | @@ -119,9 +115,9 @@ public class ShyActivityImpl { | ||
| 119 | * @param exemptFromTrial | 115 | * @param exemptFromTrial |
| 120 | * @return | 116 | * @return |
| 121 | */ | 117 | */ |
| 118 | + @Override | ||
| 122 | public List<Integer> selectByExample(Integer exemptFromTrial) { | 119 | public List<Integer> selectByExample(Integer exemptFromTrial) { |
| 123 | - List<Integer> shyActivities = shyActivityMapper.selectAllByExempt_from_trial(exemptFromTrial); | ||
| 124 | - return shyActivities; | 120 | + return shyActivityMapper.selectAllByExempt_from_trial(exemptFromTrial); |
| 125 | } | 121 | } |
| 126 | 122 | ||
| 127 | 123 | ||
| @@ -130,9 +126,9 @@ public class ShyActivityImpl { | @@ -130,9 +126,9 @@ public class ShyActivityImpl { | ||
| 130 | * | 126 | * |
| 131 | * @return | 127 | * @return |
| 132 | */ | 128 | */ |
| 129 | + @Override | ||
| 133 | public List<ShyActivity> selectAll() { | 130 | public List<ShyActivity> selectAll() { |
| 134 | - List<ShyActivity> shyActivities = shyActivityMapper.selectAll(); | ||
| 135 | - return shyActivities; | 131 | + return shyActivityMapper.selectAll(); |
| 136 | } | 132 | } |
| 137 | 133 | ||
| 138 | /** | 134 | /** |
| @@ -141,12 +137,10 @@ public class ShyActivityImpl { | @@ -141,12 +137,10 @@ public class ShyActivityImpl { | ||
| 141 | * @param id | 137 | * @param id |
| 142 | * @return | 138 | * @return |
| 143 | */ | 139 | */ |
| 140 | + @Override | ||
| 144 | public Boolean selectById(Integer id) { | 141 | public Boolean selectById(Integer id) { |
| 145 | ShyActivity shyActivity = shyActivityMapper.selectById(id); | 142 | ShyActivity shyActivity = shyActivityMapper.selectById(id); |
| 146 | - if (shyActivity == null) { | ||
| 147 | - return true; | ||
| 148 | - } | ||
| 149 | - return false; | 143 | + return shyActivity == null; |
| 150 | } | 144 | } |
| 151 | 145 | ||
| 152 | 146 | ||
| @@ -156,8 +150,8 @@ public class ShyActivityImpl { | @@ -156,8 +150,8 @@ public class ShyActivityImpl { | ||
| 156 | * @param id | 150 | * @param id |
| 157 | * @return | 151 | * @return |
| 158 | */ | 152 | */ |
| 153 | + @Override | ||
| 159 | public Integer selectBySource(Integer id) { | 154 | public Integer selectBySource(Integer id) { |
| 160 | - Integer shtype = shyActivityMapper.selectBySource(id); | ||
| 161 | - return shtype; | 155 | + return shyActivityMapper.selectBySource(id); |
| 162 | } | 156 | } |
| 163 | } | 157 | } |
src/main/java/com/cnlive/shenhe/service/serviceImpl/ShyLogServiceImpl.java
| @@ -5,6 +5,7 @@ import com.cnlive.shenhe.dto.ShyLogDTO; | @@ -5,6 +5,7 @@ import com.cnlive.shenhe.dto.ShyLogDTO; | ||
| 5 | import com.cnlive.shenhe.entity.ShyActivity; | 5 | import com.cnlive.shenhe.entity.ShyActivity; |
| 6 | import com.cnlive.shenhe.entity.ShyLog; | 6 | import com.cnlive.shenhe.entity.ShyLog; |
| 7 | import com.cnlive.shenhe.mapper.ShyLogMapper; | 7 | import com.cnlive.shenhe.mapper.ShyLogMapper; |
| 8 | +import com.cnlive.shenhe.service.ShyLogService; | ||
| 8 | import com.github.pagehelper.PageHelper; | 9 | import com.github.pagehelper.PageHelper; |
| 9 | import com.github.pagehelper.PageInfo; | 10 | import com.github.pagehelper.PageInfo; |
| 10 | import org.slf4j.Logger; | 11 | import org.slf4j.Logger; |
| @@ -21,7 +22,7 @@ import java.util.List; | @@ -21,7 +22,7 @@ import java.util.List; | ||
| 21 | * @create 2022-05-16 11:09 | 22 | * @create 2022-05-16 11:09 |
| 22 | */ | 23 | */ |
| 23 | @Service | 24 | @Service |
| 24 | -public class ShyLogServiceImpl { | 25 | +public class ShyLogServiceImpl implements ShyLogService { |
| 25 | 26 | ||
| 26 | private static Logger logger = LoggerFactory.getLogger(ShyLogServiceImpl.class); | 27 | private static Logger logger = LoggerFactory.getLogger(ShyLogServiceImpl.class); |
| 27 | 28 | ||
| @@ -33,6 +34,7 @@ public class ShyLogServiceImpl { | @@ -33,6 +34,7 @@ public class ShyLogServiceImpl { | ||
| 33 | * | 34 | * |
| 34 | * @return | 35 | * @return |
| 35 | */ | 36 | */ |
| 37 | + @Override | ||
| 36 | public PageInfo<ShyLog> selectByExample(ShyLogDTO shyLogDTO) { | 38 | public PageInfo<ShyLog> selectByExample(ShyLogDTO shyLogDTO) { |
| 37 | logger.info("进入日志查询方法,参数接受对象为,ShyLogDTO:{}", JSON.toJSONString(shyLogDTO)); | 39 | logger.info("进入日志查询方法,参数接受对象为,ShyLogDTO:{}", JSON.toJSONString(shyLogDTO)); |
| 38 | Example example = new Example(ShyActivity.class); | 40 | Example example = new Example(ShyActivity.class); |
| @@ -56,12 +58,10 @@ public class ShyLogServiceImpl { | @@ -56,12 +58,10 @@ public class ShyLogServiceImpl { | ||
| 56 | * @param shyLog | 58 | * @param shyLog |
| 57 | * @return | 59 | * @return |
| 58 | */ | 60 | */ |
| 61 | + @Override | ||
| 59 | public Boolean addShyLog(ShyLog shyLog) { | 62 | public Boolean addShyLog(ShyLog shyLog) { |
| 60 | logger.info("进入日志添加方法 接受日志对象为,ShyLog:{}", JSON.toJSONString(shyLog)); | 63 | logger.info("进入日志添加方法 接受日志对象为,ShyLog:{}", JSON.toJSONString(shyLog)); |
| 61 | int result = shyLogMapper.insertSelective(shyLog); | 64 | int result = shyLogMapper.insertSelective(shyLog); |
| 62 | - if (result > 0) { | ||
| 63 | - return true; | ||
| 64 | - } | ||
| 65 | - return false; | 65 | + return result > 0; |
| 66 | } | 66 | } |
| 67 | } | 67 | } |
src/main/java/com/cnlive/shenhe/service/serviceImpl/VideosServiceImpl.java
| @@ -12,6 +12,7 @@ import com.cnlive.shenhe.entity.ShyVideos; | @@ -12,6 +12,7 @@ import com.cnlive.shenhe.entity.ShyVideos; | ||
| 12 | import com.cnlive.shenhe.entity.ShyYidun; | 12 | 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.utils.*; | 16 | import com.cnlive.shenhe.utils.*; |
| 16 | import com.github.pagehelper.PageHelper; | 17 | import com.github.pagehelper.PageHelper; |
| 17 | import com.github.pagehelper.PageInfo; | 18 | import com.github.pagehelper.PageInfo; |
| @@ -51,7 +52,7 @@ public class VideosServiceImpl { | @@ -51,7 +52,7 @@ public class VideosServiceImpl { | ||
| 51 | @Autowired | 52 | @Autowired |
| 52 | private YiDunServiceImpl yiDunServiceImpl; | 53 | private YiDunServiceImpl yiDunServiceImpl; |
| 53 | @Autowired | 54 | @Autowired |
| 54 | - private ShyActivityImpl shyActivityImpl; | 55 | + private ShyActivityService shyActivityService; |
| 55 | @Value("${qn_domain}") | 56 | @Value("${qn_domain}") |
| 56 | private String qn_domain; | 57 | private String qn_domain; |
| 57 | @Value("${ks_domain}") | 58 | @Value("${ks_domain}") |
| @@ -498,7 +499,7 @@ public class VideosServiceImpl { | @@ -498,7 +499,7 @@ public class VideosServiceImpl { | ||
| 498 | logger.info("====sites:{}", sites.toString()); | 499 | logger.info("====sites:{}", sites.toString()); |
| 499 | String source = shyVideo.getSource(); | 500 | String source = shyVideo.getSource(); |
| 500 | // 根据source 查询审核类型 source有传空的时候 默认给0 | 501 | // 根据source 查询审核类型 source有传空的时候 默认给0 |
| 501 | - Integer shType = shyActivityImpl.selectBySource(StringUtils.isEmpty(source) ? Integer.valueOf(0) : Integer.valueOf(source)); | 502 | + Integer shType = shyActivityService.selectBySource(StringUtils.isEmpty(source) ? Integer.valueOf(0) : Integer.valueOf(source)); |
| 502 | logger.info("审核类型为:{}", shType); | 503 | logger.info("审核类型为:{}", shType); |
| 503 | ShyUsersfree shyUserfree = null; | 504 | ShyUsersfree shyUserfree = null; |
| 504 | //如果用户id存在 | 505 | //如果用户id存在 |