Commit 072289096c0fac178dd9deb0cacec4fd25ef36fb

Authored by 王言钊
1 parent a29d6253

开发评论、图文service接口

src/main/java/com/cnlive/shenhe/api/CommentsControllerApi.java
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject; @@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject;
4 import com.cnlive.shenhe.bean.ErrorEnum; 4 import com.cnlive.shenhe.bean.ErrorEnum;
5 import com.cnlive.shenhe.bean.ResponseBean; 5 import com.cnlive.shenhe.bean.ResponseBean;
6 import com.cnlive.shenhe.entity.ShyComments; 6 import com.cnlive.shenhe.entity.ShyComments;
7 -import com.cnlive.shenhe.service.serviceImpl.CommentsServiceImpl; 7 +import com.cnlive.shenhe.service.CommentsService;
8 import com.cnlive.shenhe.utils.CommonConst; 8 import com.cnlive.shenhe.utils.CommonConst;
9 import com.cnlive.shenhe.utils.CommonUtils; 9 import com.cnlive.shenhe.utils.CommonUtils;
10 import org.slf4j.Logger; 10 import org.slf4j.Logger;
@@ -26,7 +26,7 @@ import java.util.List; @@ -26,7 +26,7 @@ import java.util.List;
26 public class CommentsControllerApi { 26 public class CommentsControllerApi {
27 private static Logger logger = LoggerFactory.getLogger(CommentsControllerApi.class); 27 private static Logger logger = LoggerFactory.getLogger(CommentsControllerApi.class);
28 @Autowired 28 @Autowired
29 - CommentsServiceImpl commentsService; 29 + CommentsService commentsService;
30 30
31 /** 31 /**
32 * @Auther: chenhao 32 * @Auther: chenhao
@@ -47,7 +47,7 @@ public class CommentsControllerApi { @@ -47,7 +47,7 @@ public class CommentsControllerApi {
47 //判断是否存在 47 //判断是否存在
48 ShyComments shyComments = new ShyComments(); 48 ShyComments shyComments = new ShyComments();
49 shyComments.setActivity_id(json.getString("activityId")); 49 shyComments.setActivity_id(json.getString("activityId"));
50 - List<ShyComments> commentsList = commentsService.findshyComments(shyComments); 50 + List<ShyComments> commentsList = commentsService.findShyComments(shyComments);
51 Integer spId = null; 51 Integer spId = null;
52 try { 52 try {
53 spId = json.getInteger("spId"); 53 spId = json.getInteger("spId");
@@ -99,7 +99,7 @@ public class CommentsControllerApi { @@ -99,7 +99,7 @@ public class CommentsControllerApi {
99 if (shyComments.getId() == null) { 99 if (shyComments.getId() == null) {
100 return commentsService.impotComments(shyComments); 100 return commentsService.impotComments(shyComments);
101 } else { 101 } else {
102 - return commentsService.updateshyComments1(shyComments); 102 + return commentsService.updateShyComments1(shyComments);
103 } 103 }
104 } 104 }
105 } 105 }
src/main/java/com/cnlive/shenhe/api/ContentControllerApi.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.ShyContent; 7 import com.cnlive.shenhe.entity.ShyContent;
8 -import com.cnlive.shenhe.service.serviceImpl.ContentServiceImpl; 8 +import com.cnlive.shenhe.service.ContentService;
9 import com.cnlive.shenhe.utils.CommonConst; 9 import com.cnlive.shenhe.utils.CommonConst;
10 import com.cnlive.shenhe.utils.CommonUtils; 10 import com.cnlive.shenhe.utils.CommonUtils;
11 import org.slf4j.Logger; 11 import org.slf4j.Logger;
@@ -32,7 +32,7 @@ public class ContentControllerApi { @@ -32,7 +32,7 @@ public class ContentControllerApi {
32 private static Logger logger = LoggerFactory.getLogger(ContentControllerApi.class); 32 private static Logger logger = LoggerFactory.getLogger(ContentControllerApi.class);
33 33
34 @Autowired 34 @Autowired
35 - ContentServiceImpl contentService; 35 + ContentService contentService;
36 36
37 /** 37 /**
38 * @author liwei 38 * @author liwei
@@ -56,7 +56,7 @@ public class ContentControllerApi { @@ -56,7 +56,7 @@ public class ContentControllerApi {
56 shyContent.setContent_tag(newContentTag); 56 shyContent.setContent_tag(newContentTag);
57 //获取审核类型 57 //获取审核类型
58 Integer shenheType = contentService.getShenheType(json.getInteger("spId"), newContentTag); 58 Integer shenheType = contentService.getShenheType(json.getInteger("spId"), newContentTag);
59 - List<ShyContent> contentList = contentService.findshyContent(shyContent); 59 + List<ShyContent> contentList = contentService.findShyContent(shyContent);
60 if (contentList.size() > 0) { 60 if (contentList.size() > 0) {
61 ShyContent shyContent1 = contentList.get(0); 61 ShyContent shyContent1 = contentList.get(0);
62 // 图文存在则更新 62 // 图文存在则更新
@@ -119,7 +119,7 @@ public class ContentControllerApi { @@ -119,7 +119,7 @@ public class ContentControllerApi {
119 return contentService.impotContent(shyContent); 119 return contentService.impotContent(shyContent);
120 } else { 120 } else {
121 // id不存在就修改 121 // id不存在就修改
122 - return contentService.updateshyContent(shyContent); 122 + return contentService.updateShyContent(shyContent);
123 } 123 }
124 } 124 }
125 125
@@ -142,7 +142,7 @@ public class ContentControllerApi { @@ -142,7 +142,7 @@ public class ContentControllerApi {
142 shyContent.setContent_id(momentId); 142 shyContent.setContent_id(momentId);
143 //朋友圈标签 143 //朋友圈标签
144 shyContent.setContent_tag("moment"); 144 shyContent.setContent_tag("moment");
145 - List<ShyContent> contentList = contentService.findshyContent(shyContent); 145 + List<ShyContent> contentList = contentService.findShyContent(shyContent);
146 //获取审核类型 146 //获取审核类型
147 Integer shenheType = contentService.getShenheType(json.getInteger("spId"), "moment"); 147 Integer shenheType = contentService.getShenheType(json.getInteger("spId"), "moment");
148 //获取生活圈内容的类型 1:图片 2:视频 3:分享 148 //获取生活圈内容的类型 1:图片 2:视频 3:分享
@@ -223,7 +223,7 @@ public class ContentControllerApi { @@ -223,7 +223,7 @@ public class ContentControllerApi {
223 return contentService.impotContent(shyContent); 223 return contentService.impotContent(shyContent);
224 } else { 224 } else {
225 // id存在就修改 225 // id存在就修改
226 - return contentService.updateshyContent(shyContent); 226 + return contentService.updateShyContent(shyContent);
227 } 227 }
228 } 228 }
229 } 229 }
src/main/java/com/cnlive/shenhe/controller/CommentsController.java
@@ -10,8 +10,8 @@ import com.cnlive.shenhe.entity.ShyComments; @@ -10,8 +10,8 @@ import com.cnlive.shenhe.entity.ShyComments;
10 import com.cnlive.shenhe.entity.ShyContent; 10 import com.cnlive.shenhe.entity.ShyContent;
11 import com.cnlive.shenhe.entity.ShySites; 11 import com.cnlive.shenhe.entity.ShySites;
12 import com.cnlive.shenhe.entity.ShyUsers; 12 import com.cnlive.shenhe.entity.ShyUsers;
13 -import com.cnlive.shenhe.service.serviceImpl.CommentsServiceImpl;  
14 -import com.cnlive.shenhe.service.serviceImpl.ContentServiceImpl; 13 +import com.cnlive.shenhe.service.CommentsService;
  14 +import com.cnlive.shenhe.service.ContentService;
15 import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; 15 import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl;
16 import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; 16 import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl;
17 import com.cnlive.shenhe.utils.AuditPass; 17 import com.cnlive.shenhe.utils.AuditPass;
@@ -43,7 +43,7 @@ public class CommentsController extends BaseController { @@ -43,7 +43,7 @@ public class CommentsController extends BaseController {
43 @Autowired 43 @Autowired
44 AuditPass pass; 44 AuditPass pass;
45 @Autowired 45 @Autowired
46 - CommentsServiceImpl commentsService; 46 + CommentsService commentsService;
47 47
48 @Autowired 48 @Autowired
49 UsersServiceImpl usersService; 49 UsersServiceImpl usersService;
@@ -51,7 +51,7 @@ public class CommentsController extends BaseController { @@ -51,7 +51,7 @@ public class CommentsController extends BaseController {
51 @Autowired 51 @Autowired
52 SitesServiceImpl sitesService; 52 SitesServiceImpl sitesService;
53 @Autowired 53 @Autowired
54 - ContentServiceImpl contentService; 54 + ContentService contentService;
55 55
56 /** 56 /**
57 * 评论列表页 57 * 评论列表页
src/main/java/com/cnlive/shenhe/controller/ContentController.java
@@ -8,7 +8,7 @@ import com.cnlive.shenhe.dto.ContentDTO; @@ -8,7 +8,7 @@ import com.cnlive.shenhe.dto.ContentDTO;
8 import com.cnlive.shenhe.entity.ShyContent; 8 import com.cnlive.shenhe.entity.ShyContent;
9 import com.cnlive.shenhe.entity.ShySites; 9 import com.cnlive.shenhe.entity.ShySites;
10 import com.cnlive.shenhe.entity.ShyUsers; 10 import com.cnlive.shenhe.entity.ShyUsers;
11 -import com.cnlive.shenhe.service.serviceImpl.ContentServiceImpl; 11 +import com.cnlive.shenhe.service.ContentService;
12 import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl; 12 import com.cnlive.shenhe.service.serviceImpl.SitesServiceImpl;
13 import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl; 13 import com.cnlive.shenhe.service.serviceImpl.UsersServiceImpl;
14 import com.cnlive.shenhe.utils.CommonConst; 14 import com.cnlive.shenhe.utils.CommonConst;
@@ -40,7 +40,7 @@ import java.util.List; @@ -40,7 +40,7 @@ import java.util.List;
40 public class ContentController extends BaseController { 40 public class ContentController extends BaseController {
41 private static Logger logger = LoggerFactory.getLogger(ContentController.class); 41 private static Logger logger = LoggerFactory.getLogger(ContentController.class);
42 @Autowired 42 @Autowired
43 - ContentServiceImpl contentService; 43 + ContentService contentService;
44 @Autowired 44 @Autowired
45 SitesServiceImpl sitesService; 45 SitesServiceImpl sitesService;
46 46
src/main/java/com/cnlive/shenhe/job/CommentsJob.java
1 package com.cnlive.shenhe.job; 1 package com.cnlive.shenhe.job;
2 2
3 import com.cnlive.shenhe.entity.ShyComments; 3 import com.cnlive.shenhe.entity.ShyComments;
4 -import com.cnlive.shenhe.service.serviceImpl.CommentsServiceImpl; 4 +import com.cnlive.shenhe.service.CommentsService;
5 import com.cnlive.shenhe.utils.CommonConst; 5 import com.cnlive.shenhe.utils.CommonConst;
6 import org.slf4j.Logger; 6 import org.slf4j.Logger;
7 import org.slf4j.LoggerFactory; 7 import org.slf4j.LoggerFactory;
@@ -19,7 +19,7 @@ public class CommentsJob { @@ -19,7 +19,7 @@ public class CommentsJob {
19 19
20 private static Logger logger = LoggerFactory.getLogger(CommentsJob.class); 20 private static Logger logger = LoggerFactory.getLogger(CommentsJob.class);
21 @Autowired 21 @Autowired
22 - CommentsServiceImpl commentsService; 22 + CommentsService commentsService;
23 23
24 @Scheduled(fixedRate = 60 * 1000) 24 @Scheduled(fixedRate = 60 * 1000)
25 public void updateComments() { 25 public void updateComments() {
@@ -28,7 +28,7 @@ public class CommentsJob { @@ -28,7 +28,7 @@ public class CommentsJob {
28 // 审核类型为免审 28 // 审核类型为免审
29 shyComments.setShenhe_type(CommonConst.AUDIT_TYPE_FREE); 29 shyComments.setShenhe_type(CommonConst.AUDIT_TYPE_FREE);
30 shyComments.setState(CommonConst.AUDIT_INTT); 30 shyComments.setState(CommonConst.AUDIT_INTT);
31 - List<ShyComments> commentsList = commentsService.findshyComments(shyComments); 31 + List<ShyComments> commentsList = commentsService.findShyComments(shyComments);
32 if (commentsList.size() > 0) { 32 if (commentsList.size() > 0) {
33 for (ShyComments comments : commentsList) { 33 for (ShyComments comments : commentsList) {
34 commentsService.updateState(comments.getId().toString(), CommonConst.AUDIT_SUCCESS, "", "白名单", "白名单通过"); 34 commentsService.updateState(comments.getId().toString(), CommonConst.AUDIT_SUCCESS, "", "白名单", "白名单通过");
@@ -48,14 +48,14 @@ public class CommentsJob { @@ -48,14 +48,14 @@ public class CommentsJob {
48 shyComments.setState(CommonConst.AUDIT_INTT); 48 shyComments.setState(CommonConst.AUDIT_INTT);
49 //已领取 49 //已领取
50 shyComments.setReceive(CommonConst.RECEIVE_AFTER); 50 shyComments.setReceive(CommonConst.RECEIVE_AFTER);
51 - List<ShyComments> commentsList = commentsService.findshyComments(shyComments); 51 + List<ShyComments> commentsList = commentsService.findShyComments(shyComments);
52 if (commentsList.size() > 0) { 52 if (commentsList.size() > 0) {
53 for (ShyComments comments : commentsList) { 53 for (ShyComments comments : commentsList) {
54 logger.info("自动退领的comments_id:" + comments.getId()); 54 logger.info("自动退领的comments_id:" + comments.getId());
55 //未领取 55 //未领取
56 comments.setReceive(CommonConst.RECEIVE_BEFORE); 56 comments.setReceive(CommonConst.RECEIVE_BEFORE);
57 comments.setReceive_user_id(null); 57 comments.setReceive_user_id(null);
58 - commentsService.updateshyComments1(comments); 58 + commentsService.updateShyComments1(comments);
59 } 59 }
60 } 60 }
61 } 61 }
src/main/java/com/cnlive/shenhe/job/ContentJob.java
1 package com.cnlive.shenhe.job; 1 package com.cnlive.shenhe.job;
2 2
3 import com.cnlive.shenhe.entity.ShyContent; 3 import com.cnlive.shenhe.entity.ShyContent;
4 -import com.cnlive.shenhe.service.serviceImpl.ContentServiceImpl; 4 +import com.cnlive.shenhe.service.ContentService;
5 import com.cnlive.shenhe.utils.CommonConst; 5 import com.cnlive.shenhe.utils.CommonConst;
6 import org.slf4j.Logger; 6 import org.slf4j.Logger;
7 import org.slf4j.LoggerFactory; 7 import org.slf4j.LoggerFactory;
@@ -22,7 +22,7 @@ public class ContentJob { @@ -22,7 +22,7 @@ public class ContentJob {
22 private static Logger logger = LoggerFactory.getLogger(ContentJob.class); 22 private static Logger logger = LoggerFactory.getLogger(ContentJob.class);
23 23
24 @Autowired 24 @Autowired
25 - ContentServiceImpl contentService; 25 + ContentService contentService;
26 26
27 /** 27 /**
28 * 白名单sp图文通过 28 * 白名单sp图文通过
@@ -34,7 +34,7 @@ public class ContentJob { @@ -34,7 +34,7 @@ public class ContentJob {
34 shyContent.setShenhe_type(CommonConst.AUDIT_TYPE_FREE); 34 shyContent.setShenhe_type(CommonConst.AUDIT_TYPE_FREE);
35 // 领取状态为未领取 35 // 领取状态为未领取
36 shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE); 36 shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE);
37 - List<ShyContent> shyContentList = contentService.findshyContent(shyContent); 37 + List<ShyContent> shyContentList = contentService.findShyContent(shyContent);
38 if (shyContentList.size() > 0) { 38 if (shyContentList.size() > 0) {
39 for (ShyContent content : shyContentList) { 39 for (ShyContent content : shyContentList) {
40 logger.info("当前白名单通过的content_id:" + content.getId()); 40 logger.info("当前白名单通过的content_id:" + content.getId());
@@ -73,14 +73,14 @@ public class ContentJob { @@ -73,14 +73,14 @@ public class ContentJob {
73 ShyContent shyContent = new ShyContent(); 73 ShyContent shyContent = new ShyContent();
74 //领取状态为,已领 74 //领取状态为,已领
75 shyContent.setReceive_status(CommonConst.RECEIVE_AFTER); 75 shyContent.setReceive_status(CommonConst.RECEIVE_AFTER);
76 - List<ShyContent> shyContentList = contentService.findshyContent(shyContent); 76 + List<ShyContent> shyContentList = contentService.findShyContent(shyContent);
77 if (shyContentList.size() > 0) { 77 if (shyContentList.size() > 0) {
78 for (ShyContent shyContent2 : shyContentList) { 78 for (ShyContent shyContent2 : shyContentList) {
79 logger.info("自动退领的content_id:" + shyContent2.getId()); 79 logger.info("自动退领的content_id:" + shyContent2.getId());
80 //未领取 80 //未领取
81 shyContent2.setReceive_status(CommonConst.RECEIVE_BEFORE); 81 shyContent2.setReceive_status(CommonConst.RECEIVE_BEFORE);
82 shyContent2.setAuditor_id(null); 82 shyContent2.setAuditor_id(null);
83 - contentService.updateshyContent(shyContent2); 83 + contentService.updateShyContent(shyContent2);
84 } 84 }
85 } 85 }
86 } 86 }
src/main/java/com/cnlive/shenhe/job/YiDunUrlResultJob.java
@@ -6,7 +6,7 @@ import com.cnlive.shenhe.entity.ShyContent; @@ -6,7 +6,7 @@ import com.cnlive.shenhe.entity.ShyContent;
6 import com.cnlive.shenhe.entity.ShyYidun; 6 import com.cnlive.shenhe.entity.ShyYidun;
7 import com.cnlive.shenhe.enums.ImageLabels; 7 import com.cnlive.shenhe.enums.ImageLabels;
8 import com.cnlive.shenhe.enums.TextLabels; 8 import com.cnlive.shenhe.enums.TextLabels;
9 -import com.cnlive.shenhe.service.serviceImpl.ContentServiceImpl; 9 +import com.cnlive.shenhe.service.ContentService;
10 import com.cnlive.shenhe.service.serviceImpl.YiDunServiceImpl; 10 import com.cnlive.shenhe.service.serviceImpl.YiDunServiceImpl;
11 import com.cnlive.shenhe.utils.CommonConst; 11 import com.cnlive.shenhe.utils.CommonConst;
12 import com.cnlive.shenhe.utils.HttpClientUtils; 12 import com.cnlive.shenhe.utils.HttpClientUtils;
@@ -49,7 +49,7 @@ public class YiDunUrlResultJob { @@ -49,7 +49,7 @@ public class YiDunUrlResultJob {
49 @Autowired 49 @Autowired
50 YiDunServiceImpl yiDunServiceImpl; 50 YiDunServiceImpl yiDunServiceImpl;
51 @Autowired 51 @Autowired
52 - ContentServiceImpl contentServiceImpl; 52 + ContentService contentServiceImpl;
53 53
54 54
55 /** 55 /**
@@ -190,7 +190,7 @@ public class YiDunUrlResultJob { @@ -190,7 +190,7 @@ public class YiDunUrlResultJob {
190 //拒绝原因 190 //拒绝原因
191 shyContent.setShenhe_msg("易盾网站识别其它问题需排查"); 191 shyContent.setShenhe_msg("易盾网站识别其它问题需排查");
192 newYiDunMsg.setDesc_msg("易盾网站识别其它问题需排查"); 192 newYiDunMsg.setDesc_msg("易盾网站识别其它问题需排查");
193 - contentServiceImpl.updateshyContent(shyContent); 193 + contentServiceImpl.updateShyContent(shyContent);
194 } 194 }
195 yiDunServiceImpl.updateYiDunMsg(newYiDunMsg); 195 yiDunServiceImpl.updateYiDunMsg(newYiDunMsg);
196 } 196 }
src/main/java/com/cnlive/shenhe/service/CommentsService.java 0 → 100644
  1 +package com.cnlive.shenhe.service;
  2 +
  3 +import com.cnlive.shenhe.dto.CommentsDTO;
  4 +import com.cnlive.shenhe.entity.ShyComments;
  5 +import com.github.pagehelper.PageInfo;
  6 +
  7 +import java.util.List;
  8 +
  9 +/**
  10 + * @Author: yan-zhao-wang
  11 + * @DateTime: 2022-11-01 13:10
  12 + */
  13 +public interface CommentsService {
  14 + /**
  15 + * 根据评论对象获取评论集合
  16 + *
  17 + * @param shyComments
  18 + * @return
  19 + */
  20 + List<ShyComments> findShyComments(ShyComments shyComments);
  21 +
  22 + /**
  23 + * 修改评论 返回布尔类型
  24 + *
  25 + * @param shyComments
  26 + * @return
  27 + */
  28 + boolean updateShyComments1(ShyComments shyComments);
  29 +
  30 + /**
  31 + * 导入评论 返回布尔类型
  32 + *
  33 + * @param shyComments
  34 + * @return
  35 + */
  36 + boolean impotComments(ShyComments shyComments);
  37 +
  38 + /**
  39 + * 评论分页、条件查询
  40 + *
  41 + * @param commentsDTO
  42 + * @return
  43 + */
  44 + PageInfo<ShyComments> getPage(CommentsDTO commentsDTO);
  45 +
  46 + /**
  47 + * 导出Excel表格
  48 + *
  49 + * @param commentsDTO
  50 + * @return
  51 + */
  52 + PageInfo<ShyComments> getPageExcel(CommentsDTO commentsDTO);
  53 +
  54 + /**
  55 + * 获取评论详情
  56 + *
  57 + * @param id
  58 + * @return
  59 + */
  60 + ShyComments getDetailsComment(Integer id);
  61 +
  62 + /**
  63 + * 修改状态 回调 返回布尔类型
  64 + *
  65 + * @param ids
  66 + * @param state
  67 + * @param userId
  68 + * @param updater
  69 + * @param msg
  70 + * @return
  71 + */
  72 + boolean updateState(String ids, Integer state, String userId, String updater, String msg);
  73 +
  74 + /**
  75 + * 认领
  76 + *
  77 + * @param ids
  78 + * @param num
  79 + * @param userId
  80 + * @param spid
  81 + * @return
  82 + */
  83 + Integer receive(String ids, Integer num, String userId, Integer spid);
  84 +
  85 + /**
  86 + * 退领
  87 + *
  88 + * @param ids
  89 + * @param userId
  90 + * @return
  91 + */
  92 + Integer retReceive(String ids, String userId);
  93 +
  94 + /**
  95 + * 根据主键id查询评论对象
  96 + *
  97 + * @param id
  98 + * @return
  99 + */
  100 + ShyComments selectByPrimaryKey(Integer id);
  101 +
  102 + /**
  103 + * 根据主键id修改对象
  104 + *
  105 + * @param comments
  106 + * @return
  107 + */
  108 + int updateByPrimaryKeySelective(ShyComments comments);
  109 +
  110 + /**
  111 + * 获取审核类型
  112 + *
  113 + * @param shyComments
  114 + */
  115 + void getShenheType(ShyComments shyComments);
  116 +}
src/main/java/com/cnlive/shenhe/service/ContentService.java 0 → 100644
  1 +package com.cnlive.shenhe.service;
  2 +
  3 +import com.cnlive.shenhe.dto.ContentDTO;
  4 +import com.cnlive.shenhe.entity.ShyContent;
  5 +import com.github.pagehelper.PageInfo;
  6 +
  7 +import java.util.List;
  8 +
  9 +/**
  10 + * @Author: yan-zhao-wang
  11 + * @DateTime: 2022-11-01 13:11
  12 + */
  13 +public interface ContentService {
  14 + /**
  15 + * 获取图文对象
  16 + *
  17 + * @param shyContent
  18 + * @return
  19 + */
  20 + ShyContent getShyContent(ShyContent shyContent);
  21 +
  22 + /**
  23 + * 获取图文集合
  24 + *
  25 + * @param shyContent
  26 + * @return
  27 + */
  28 + List<ShyContent> findShyContent(ShyContent shyContent);
  29 +
  30 + /**
  31 + * 根据条件 查询图文集合
  32 + *
  33 + * @return
  34 + */
  35 + List<ShyContent> findShyContentWithWebPage();
  36 +
  37 + /**
  38 + * 修改图文 返回布尔类型
  39 + *
  40 + * @param shyContent
  41 + * @return
  42 + */
  43 + boolean updateShyContent(ShyContent shyContent);
  44 +
  45 + /**
  46 + * 导入图文 返回布尔类型
  47 + *
  48 + * @param shyContent
  49 + * @return
  50 + */
  51 + boolean impotContent(ShyContent shyContent);
  52 +
  53 + /**
  54 + * 分页、条件查询 返回集合
  55 + *
  56 + * @param contentDTO
  57 + * @return
  58 + */
  59 + PageInfo<ShyContent> getPage(ContentDTO contentDTO);
  60 +
  61 + /**
  62 + * 根据条件导出数据excel
  63 + *
  64 + * @param contentDTO
  65 + * @return
  66 + */
  67 + List<ShyContent> findByCondition(ContentDTO contentDTO);
  68 +
  69 + /**
  70 + * 根据id获取图文详情
  71 + *
  72 + * @param id
  73 + * @return
  74 + */
  75 + ShyContent getDetailsContent(Integer id);
  76 +
  77 + /**
  78 + * 回调
  79 + *
  80 + * @param contentId
  81 + * @param msg
  82 + * @param state
  83 + * @param userId
  84 + * @param updater
  85 + * @return
  86 + */
  87 + boolean callback(String contentId, String msg, Integer state, String userId, String updater);
  88 +
  89 + /**
  90 + * 认领
  91 + *
  92 + * @param ids
  93 + * @param num
  94 + * @param userId
  95 + * @param spid
  96 + * @return
  97 + */
  98 + Integer receive(String ids, Integer num, String userId, Integer spid);
  99 +
  100 + /**
  101 + * 退领
  102 + *
  103 + * @param ids
  104 + * @param userId
  105 + * @return
  106 + */
  107 + Integer retReceive(String ids, String userId);
  108 +
  109 + /**
  110 + * 根据主键查询图文对象
  111 + *
  112 + * @param id
  113 + * @return
  114 + */
  115 + ShyContent selectByPrimaryKey(Integer id);
  116 +
  117 + /**
  118 + * 根据主键修改图文
  119 + *
  120 + * @param content
  121 + * @return
  122 + */
  123 + int updateByPrimaryKeySelective(ShyContent content);
  124 +
  125 + /**
  126 + * 获取审核类型
  127 + *
  128 + * @param spId
  129 + * @param ContentTag
  130 + * @return
  131 + */
  132 + Integer getShenheType(Integer spId, String ContentTag);
  133 +
  134 + /**
  135 + * 易盾网站过滤
  136 + * 送审类型:1:文本 2:图片 3.网页 4:点播音频
  137 + *
  138 + * @param shyContent
  139 + */
  140 + void contentFilter(ShyContent shyContent);
  141 +}
src/main/java/com/cnlive/shenhe/service/serviceImpl/CommentsServiceImpl.java
@@ -6,6 +6,7 @@ import com.cnlive.shenhe.entity.ShyComments; @@ -6,6 +6,7 @@ import com.cnlive.shenhe.entity.ShyComments;
6 import com.cnlive.shenhe.entity.ShyUsers; 6 import com.cnlive.shenhe.entity.ShyUsers;
7 import com.cnlive.shenhe.mapper.ShyCommentsMapper; 7 import com.cnlive.shenhe.mapper.ShyCommentsMapper;
8 import com.cnlive.shenhe.mapper.ShyUsersMapper; 8 import com.cnlive.shenhe.mapper.ShyUsersMapper;
  9 +import com.cnlive.shenhe.service.CommentsService;
9 import com.cnlive.shenhe.utils.AuditPass; 10 import com.cnlive.shenhe.utils.AuditPass;
10 import com.cnlive.shenhe.utils.CommonConst; 11 import com.cnlive.shenhe.utils.CommonConst;
11 import com.cnlive.shenhe.utils.CommonUtils; 12 import com.cnlive.shenhe.utils.CommonUtils;
@@ -26,7 +27,7 @@ import java.util.List; @@ -26,7 +27,7 @@ import java.util.List;
26 * @Description: 27 * @Description:
27 */ 28 */
28 @Service 29 @Service
29 -public class CommentsServiceImpl { 30 +public class CommentsServiceImpl implements CommentsService {
30 31
31 private static Logger logger = LoggerFactory.getLogger(CommentsServiceImpl.class); 32 private static Logger logger = LoggerFactory.getLogger(CommentsServiceImpl.class);
32 @Autowired 33 @Autowired
@@ -45,7 +46,8 @@ public class CommentsServiceImpl { @@ -45,7 +46,8 @@ public class CommentsServiceImpl {
45 * @param shyComments 46 * @param shyComments
46 * @return 47 * @return
47 */ 48 */
48 - public List<ShyComments> findshyComments(ShyComments shyComments) { 49 + @Override
  50 + public List<ShyComments> findShyComments(ShyComments shyComments) {
49 List<ShyComments> commentsList = shyCommentsMapper.selectByRowBounds(shyComments, new RowBounds(0, 100)); 51 List<ShyComments> commentsList = shyCommentsMapper.selectByRowBounds(shyComments, new RowBounds(0, 100));
50 return commentsList; 52 return commentsList;
51 } 53 }
@@ -56,7 +58,8 @@ public class CommentsServiceImpl { @@ -56,7 +58,8 @@ public class CommentsServiceImpl {
56 * @param shyComments 58 * @param shyComments
57 * @return 59 * @return
58 */ 60 */
59 - public boolean updateshyComments1(ShyComments shyComments) { 61 + @Override
  62 + public boolean updateShyComments1(ShyComments shyComments) {
60 int result = shyCommentsMapper.updateByPrimaryKey(shyComments); 63 int result = shyCommentsMapper.updateByPrimaryKey(shyComments);
61 if (result == 0) { 64 if (result == 0) {
62 return false; 65 return false;
@@ -70,6 +73,7 @@ public class CommentsServiceImpl { @@ -70,6 +73,7 @@ public class CommentsServiceImpl {
70 * @param shyComments 73 * @param shyComments
71 * @return 74 * @return
72 */ 75 */
  76 + @Override
73 public boolean impotComments(ShyComments shyComments) { 77 public boolean impotComments(ShyComments shyComments) {
74 int result = shyCommentsMapper.insertSelective(shyComments); 78 int result = shyCommentsMapper.insertSelective(shyComments);
75 if (result == 0) { 79 if (result == 0) {
@@ -84,6 +88,7 @@ public class CommentsServiceImpl { @@ -84,6 +88,7 @@ public class CommentsServiceImpl {
84 * @param commentsDTO 88 * @param commentsDTO
85 * @return 89 * @return
86 */ 90 */
  91 + @Override
87 public PageInfo<ShyComments> getPage(CommentsDTO commentsDTO) { 92 public PageInfo<ShyComments> getPage(CommentsDTO commentsDTO) {
88 logger.info("接受参数对象为,CommentsDTO:{}", JSONObject.toJSON(commentsDTO)); 93 logger.info("接受参数对象为,CommentsDTO:{}", JSONObject.toJSON(commentsDTO));
89 Example example = new Example(ShyComments.class); 94 Example example = new Example(ShyComments.class);
@@ -145,6 +150,7 @@ public class CommentsServiceImpl { @@ -145,6 +150,7 @@ public class CommentsServiceImpl {
145 * @param commentsDTO 150 * @param commentsDTO
146 * @return 151 * @return
147 */ 152 */
  153 + @Override
148 public PageInfo<ShyComments> getPageExcel(CommentsDTO commentsDTO) { 154 public PageInfo<ShyComments> getPageExcel(CommentsDTO commentsDTO) {
149 Example example = new Example(ShyComments.class); 155 Example example = new Example(ShyComments.class);
150 Example.Criteria criteria = example.createCriteria(); 156 Example.Criteria criteria = example.createCriteria();
@@ -202,6 +208,7 @@ public class CommentsServiceImpl { @@ -202,6 +208,7 @@ public class CommentsServiceImpl {
202 * @param id 208 * @param id
203 * @return 209 * @return
204 */ 210 */
  211 + @Override
205 public ShyComments getDetailsComment(Integer id) { 212 public ShyComments getDetailsComment(Integer id) {
206 ShyComments comment = shyCommentsMapper.selectByPrimaryKey(id); 213 ShyComments comment = shyCommentsMapper.selectByPrimaryKey(id);
207 if (!comment.getState().equals(CommonConst.AUDIT_INTT)) { 214 if (!comment.getState().equals(CommonConst.AUDIT_INTT)) {
@@ -230,6 +237,7 @@ public class CommentsServiceImpl { @@ -230,6 +237,7 @@ public class CommentsServiceImpl {
230 * @param msg 237 * @param msg
231 * @return 238 * @return
232 */ 239 */
  240 + @Override
233 public boolean updateState(String ids, Integer state, String userId, String updater, String msg) { 241 public boolean updateState(String ids, Integer state, String userId, String updater, String msg) {
234 boolean success = true; 242 boolean success = true;
235 String[] commentIds = ids.split(","); 243 String[] commentIds = ids.split(",");
@@ -289,6 +297,7 @@ public class CommentsServiceImpl { @@ -289,6 +297,7 @@ public class CommentsServiceImpl {
289 * @param spid 297 * @param spid
290 * @return 298 * @return
291 */ 299 */
  300 + @Override
292 public Integer receive(String ids, Integer num, String userId, Integer spid) { 301 public Integer receive(String ids, Integer num, String userId, Integer spid) {
293 Integer n = 0; 302 Integer n = 0;
294 if (CommonUtils.isNotEmpty(ids)) { 303 if (CommonUtils.isNotEmpty(ids)) {
@@ -330,6 +339,7 @@ public class CommentsServiceImpl { @@ -330,6 +339,7 @@ public class CommentsServiceImpl {
330 * @param userId 339 * @param userId
331 * @return 340 * @return
332 */ 341 */
  342 + @Override
333 public Integer retReceive(String ids, String userId) { 343 public Integer retReceive(String ids, String userId) {
334 Integer n = 0; 344 Integer n = 0;
335 String[] cids = ids.split(","); 345 String[] cids = ids.split(",");
@@ -353,6 +363,7 @@ public class CommentsServiceImpl { @@ -353,6 +363,7 @@ public class CommentsServiceImpl {
353 * @param id 363 * @param id
354 * @return 364 * @return
355 */ 365 */
  366 + @Override
356 public ShyComments selectByPrimaryKey(Integer id) { 367 public ShyComments selectByPrimaryKey(Integer id) {
357 ShyComments shyComments = shyCommentsMapper.selectByPrimaryKey(id); 368 ShyComments shyComments = shyCommentsMapper.selectByPrimaryKey(id);
358 return shyComments; 369 return shyComments;
@@ -364,6 +375,7 @@ public class CommentsServiceImpl { @@ -364,6 +375,7 @@ public class CommentsServiceImpl {
364 * @param comments 375 * @param comments
365 * @return 376 * @return
366 */ 377 */
  378 + @Override
367 public int updateByPrimaryKeySelective(ShyComments comments) { 379 public int updateByPrimaryKeySelective(ShyComments comments) {
368 return shyCommentsMapper.updateByPrimaryKeySelective(comments); 380 return shyCommentsMapper.updateByPrimaryKeySelective(comments);
369 } 381 }
@@ -373,6 +385,7 @@ public class CommentsServiceImpl { @@ -373,6 +385,7 @@ public class CommentsServiceImpl {
373 * 385 *
374 * @param shyComments 386 * @param shyComments
375 */ 387 */
  388 + @Override
376 public void getShenheType(ShyComments shyComments) { 389 public void getShenheType(ShyComments shyComments) {
377 //获取评论免审sp 390 //获取评论免审sp
378 List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_COMMENT); 391 List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_COMMENT);
src/main/java/com/cnlive/shenhe/service/serviceImpl/ContentServiceImpl.java
@@ -6,6 +6,7 @@ import com.cnlive.shenhe.dto.ContentDTO; @@ -6,6 +6,7 @@ import com.cnlive.shenhe.dto.ContentDTO;
6 import com.cnlive.shenhe.entity.*; 6 import com.cnlive.shenhe.entity.*;
7 import com.cnlive.shenhe.mapper.ShyContentMapper; 7 import com.cnlive.shenhe.mapper.ShyContentMapper;
8 import com.cnlive.shenhe.mapper.ShyUsersMapper; 8 import com.cnlive.shenhe.mapper.ShyUsersMapper;
  9 +import com.cnlive.shenhe.service.ContentService;
9 import com.cnlive.shenhe.utils.*; 10 import com.cnlive.shenhe.utils.*;
10 import com.github.pagehelper.PageHelper; 11 import com.github.pagehelper.PageHelper;
11 import com.github.pagehelper.PageInfo; 12 import com.github.pagehelper.PageInfo;
@@ -26,7 +27,7 @@ import java.util.List; @@ -26,7 +27,7 @@ import java.util.List;
26 * @Description: 27 * @Description:
27 */ 28 */
28 @Service 29 @Service
29 -public class ContentServiceImpl { 30 +public class ContentServiceImpl implements ContentService {
30 31
31 private static Logger logger = LoggerFactory.getLogger(ContentServiceImpl.class); 32 private static Logger logger = LoggerFactory.getLogger(ContentServiceImpl.class);
32 @Autowired 33 @Autowired
@@ -49,6 +50,7 @@ public class ContentServiceImpl { @@ -49,6 +50,7 @@ public class ContentServiceImpl {
49 * @param shyContent 50 * @param shyContent
50 * @return 51 * @return
51 */ 52 */
  53 + @Override
52 public ShyContent getShyContent(ShyContent shyContent) { 54 public ShyContent getShyContent(ShyContent shyContent) {
53 List<ShyContent> shyContentList = shyContentMapper.select(shyContent); 55 List<ShyContent> shyContentList = shyContentMapper.select(shyContent);
54 if (CommonUtils.isNotNull(shyContentList) && shyContentList.size() > 0) { 56 if (CommonUtils.isNotNull(shyContentList) && shyContentList.size() > 0) {
@@ -63,7 +65,8 @@ public class ContentServiceImpl { @@ -63,7 +65,8 @@ public class ContentServiceImpl {
63 * @param shyContent 65 * @param shyContent
64 * @return 66 * @return
65 */ 67 */
66 - public List<ShyContent> findshyContent(ShyContent shyContent) { 68 + @Override
  69 + public List<ShyContent> findShyContent(ShyContent shyContent) {
67 return shyContentMapper.selectByRowBounds(shyContent, new RowBounds(0, 100)); 70 return shyContentMapper.selectByRowBounds(shyContent, new RowBounds(0, 100));
68 } 71 }
69 72
@@ -72,6 +75,7 @@ public class ContentServiceImpl { @@ -72,6 +75,7 @@ public class ContentServiceImpl {
72 * 75 *
73 * @return 76 * @return
74 */ 77 */
  78 + @Override
75 public List<ShyContent> findShyContentWithWebPage() { 79 public List<ShyContent> findShyContentWithWebPage() {
76 List checkParamList = new ArrayList(); 80 List checkParamList = new ArrayList();
77 checkParamList.add("content"); 81 checkParamList.add("content");
@@ -92,7 +96,8 @@ public class ContentServiceImpl { @@ -92,7 +96,8 @@ public class ContentServiceImpl {
92 * @param shyContent 96 * @param shyContent
93 * @return 97 * @return
94 */ 98 */
95 - public boolean updateshyContent(ShyContent shyContent) { 99 + @Override
  100 + public boolean updateShyContent(ShyContent shyContent) {
96 int result = shyContentMapper.updateByPrimaryKeySelective(shyContent); 101 int result = shyContentMapper.updateByPrimaryKeySelective(shyContent);
97 if (result == 0) { 102 if (result == 0) {
98 return false; 103 return false;
@@ -106,6 +111,7 @@ public class ContentServiceImpl { @@ -106,6 +111,7 @@ public class ContentServiceImpl {
106 * @param shyContent 111 * @param shyContent
107 * @return 112 * @return
108 */ 113 */
  114 + @Override
109 public boolean impotContent(ShyContent shyContent) { 115 public boolean impotContent(ShyContent shyContent) {
110 int result = shyContentMapper.insertSelective(shyContent); 116 int result = shyContentMapper.insertSelective(shyContent);
111 if (result == 0) { 117 if (result == 0) {
@@ -120,6 +126,7 @@ public class ContentServiceImpl { @@ -120,6 +126,7 @@ public class ContentServiceImpl {
120 * @param contentDTO 126 * @param contentDTO
121 * @return 127 * @return
122 */ 128 */
  129 + @Override
123 public PageInfo<ShyContent> getPage(ContentDTO contentDTO) { 130 public PageInfo<ShyContent> getPage(ContentDTO contentDTO) {
124 Example example = new Example(ShyContent.class); 131 Example example = new Example(ShyContent.class);
125 Example.Criteria criteria = example.createCriteria(); 132 Example.Criteria criteria = example.createCriteria();
@@ -172,6 +179,7 @@ public class ContentServiceImpl { @@ -172,6 +179,7 @@ public class ContentServiceImpl {
172 * 179 *
173 * @return 180 * @return
174 */ 181 */
  182 + @Override
175 public List<ShyContent> findByCondition(ContentDTO contentDTO) { 183 public List<ShyContent> findByCondition(ContentDTO contentDTO) {
176 184
177 Example example = new Example(ShyContent.class); 185 Example example = new Example(ShyContent.class);
@@ -213,6 +221,7 @@ public class ContentServiceImpl { @@ -213,6 +221,7 @@ public class ContentServiceImpl {
213 * @param id 221 * @param id
214 * @return 222 * @return
215 */ 223 */
  224 + @Override
216 public ShyContent getDetailsContent(Integer id) { 225 public ShyContent getDetailsContent(Integer id) {
217 ShyContent content = shyContentMapper.selectByPrimaryKey(id); 226 ShyContent content = shyContentMapper.selectByPrimaryKey(id);
218 if (content.getReceive_status().equals(CommonConst.RECEIVE_AUDIT)) { 227 if (content.getReceive_status().equals(CommonConst.RECEIVE_AUDIT)) {
@@ -245,6 +254,7 @@ public class ContentServiceImpl { @@ -245,6 +254,7 @@ public class ContentServiceImpl {
245 * @param updater 254 * @param updater
246 * @return 255 * @return
247 */ 256 */
  257 + @Override
248 public boolean callback(String contentId, String msg, Integer state, String userId, String updater) { 258 public boolean callback(String contentId, String msg, Integer state, String userId, String updater) {
249 boolean success = true; 259 boolean success = true;
250 ShyContent content = shyContentMapper.selectByPrimaryKey(Integer.parseInt(contentId)); 260 ShyContent content = shyContentMapper.selectByPrimaryKey(Integer.parseInt(contentId));
@@ -326,6 +336,7 @@ public class ContentServiceImpl { @@ -326,6 +336,7 @@ public class ContentServiceImpl {
326 * @param spid 336 * @param spid
327 * @return 337 * @return
328 */ 338 */
  339 + @Override
329 public Integer receive(String ids, Integer num, String userId, Integer spid) { 340 public Integer receive(String ids, Integer num, String userId, Integer spid) {
330 Integer n = 0; 341 Integer n = 0;
331 if (CommonUtils.isNotEmpty(ids)) { 342 if (CommonUtils.isNotEmpty(ids)) {
@@ -369,6 +380,7 @@ public class ContentServiceImpl { @@ -369,6 +380,7 @@ public class ContentServiceImpl {
369 * @param userId 380 * @param userId
370 * @return 381 * @return
371 */ 382 */
  383 + @Override
372 public Integer retReceive(String ids, String userId) { 384 public Integer retReceive(String ids, String userId) {
373 Integer n = 0; 385 Integer n = 0;
374 String[] cids = ids.split(","); 386 String[] cids = ids.split(",");
@@ -393,6 +405,7 @@ public class ContentServiceImpl { @@ -393,6 +405,7 @@ public class ContentServiceImpl {
393 * @param id 405 * @param id
394 * @return 406 * @return
395 */ 407 */
  408 + @Override
396 public ShyContent selectByPrimaryKey(Integer id) { 409 public ShyContent selectByPrimaryKey(Integer id) {
397 ShyContent shyContent = shyContentMapper.selectByPrimaryKey(id); 410 ShyContent shyContent = shyContentMapper.selectByPrimaryKey(id);
398 return shyContent; 411 return shyContent;
@@ -404,6 +417,7 @@ public class ContentServiceImpl { @@ -404,6 +417,7 @@ public class ContentServiceImpl {
404 * @param content 417 * @param content
405 * @return 418 * @return
406 */ 419 */
  420 + @Override
407 public int updateByPrimaryKeySelective(ShyContent content) { 421 public int updateByPrimaryKeySelective(ShyContent content) {
408 return shyContentMapper.updateByPrimaryKeySelective(content); 422 return shyContentMapper.updateByPrimaryKeySelective(content);
409 } 423 }
@@ -413,6 +427,7 @@ public class ContentServiceImpl { @@ -413,6 +427,7 @@ public class ContentServiceImpl {
413 * 427 *
414 * @param spId 428 * @param spId
415 */ 429 */
  430 + @Override
416 public Integer getShenheType(Integer spId, String ContentTag) { 431 public Integer getShenheType(Integer spId, String ContentTag) {
417 //获取图文免审sp 432 //获取图文免审sp
418 List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_CONTENT); 433 List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_CONTENT);
@@ -439,6 +454,7 @@ public class ContentServiceImpl { @@ -439,6 +454,7 @@ public class ContentServiceImpl {
439 * @param shyContent 454 * @param shyContent
440 * @return 455 * @return
441 */ 456 */
  457 + @Override
442 public void contentFilter(ShyContent shyContent) { 458 public void contentFilter(ShyContent shyContent) {
443 logger.info("contentFilter接收的ShyContent对象:{}", shyContent.toString()); 459 logger.info("contentFilter接收的ShyContent对象:{}", shyContent.toString());
444 try { 460 try {