Commit c7f10d56920e2efdad09cef050c45c5176b004bc

Authored by 王言钊
1 parent d0c12710

开发邮箱、点播活动管理、日志service接口

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