Commit 7a5eb59dd52e2ea369cd8d213792c0655b44cf4c
1 parent
3907ed53
评论审核查看朋友圈内容
Showing
5 changed files
with
40 additions
and
11 deletions
src/main/java/com/cnlive/shenhe/controller/CommentsController.java
| @@ -5,10 +5,12 @@ import com.cnlive.shenhe.bean.ErrorEnum; | @@ -5,10 +5,12 @@ 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.bean.SessionUser; | 6 | import com.cnlive.shenhe.bean.SessionUser; |
| 7 | import com.cnlive.shenhe.entity.ShyComments; | 7 | import com.cnlive.shenhe.entity.ShyComments; |
| 8 | +import com.cnlive.shenhe.entity.ShyContent; | ||
| 8 | import com.cnlive.shenhe.entity.ShySites; | 9 | import com.cnlive.shenhe.entity.ShySites; |
| 9 | import com.cnlive.shenhe.entity.ShyUsers; | 10 | import com.cnlive.shenhe.entity.ShyUsers; |
| 10 | import com.cnlive.shenhe.entity.ShyVideos; | 11 | import com.cnlive.shenhe.entity.ShyVideos; |
| 11 | import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; | 12 | import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; |
| 13 | +import com.cnlive.shenhe.serviceImpl.ContentServiceImpl; | ||
| 12 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; | 14 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; |
| 13 | import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; | 15 | import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; |
| 14 | import com.cnlive.shenhe.utils.AuditPass; | 16 | import com.cnlive.shenhe.utils.AuditPass; |
| @@ -41,6 +43,8 @@ public class CommentsController { | @@ -41,6 +43,8 @@ public class CommentsController { | ||
| 41 | 43 | ||
| 42 | @Autowired | 44 | @Autowired |
| 43 | SitesServiceImpl sitesService; | 45 | SitesServiceImpl sitesService; |
| 46 | + @Autowired | ||
| 47 | + ContentServiceImpl contentService; | ||
| 44 | 48 | ||
| 45 | /** | 49 | /** |
| 46 | * 评论列表页 | 50 | * 评论列表页 |
| @@ -112,6 +116,20 @@ public class CommentsController { | @@ -112,6 +116,20 @@ public class CommentsController { | ||
| 112 | }else{ | 116 | }else{ |
| 113 | comment.setSpid_desc("sp无法显示"); | 117 | comment.setSpid_desc("sp无法显示"); |
| 114 | } | 118 | } |
| 119 | + | ||
| 120 | + //获取朋友圈的评论内容 | ||
| 121 | + if(comment.getProgram_id().split("_").length==1 | ||
| 122 | + && comment.getProgram_id().split(":").length==3){ | ||
| 123 | + ShyContent shyContent=new ShyContent(); | ||
| 124 | + shyContent.setSp_id(comment.getSpid()); | ||
| 125 | + shyContent.setContent_id(comment.getProgram_id()); | ||
| 126 | + shyContent =contentService.getShyContent(shyContent); | ||
| 127 | + if(CommonUtils.isNotNull(shyContent)&& shyContent.getId()!=null){ | ||
| 128 | + String title=CommonUtils.isEmpty(shyContent.getTitle())?"朋友圈发布无标题内容":shyContent.getTitle(); | ||
| 129 | + comment.setComment_title(title); | ||
| 130 | + comment.setComment_original_url(shyContent.getContent_url()); | ||
| 131 | + } | ||
| 132 | + } | ||
| 115 | } | 133 | } |
| 116 | } | 134 | } |
| 117 | model.addAttribute("commentPage", commentPage); | 135 | model.addAttribute("commentPage", commentPage); |
src/main/java/com/cnlive/shenhe/serviceImpl/ContentServiceImpl.java
| @@ -52,9 +52,12 @@ public class ContentServiceImpl { | @@ -52,9 +52,12 @@ public class ContentServiceImpl { | ||
| 52 | @Autowired | 52 | @Autowired |
| 53 | VideosServiceImpl videosService; | 53 | VideosServiceImpl videosService; |
| 54 | 54 | ||
| 55 | - public List<ShySites> getBusiness(ShySites shySites) { | ||
| 56 | - List<ShySites> sitesList = shySitesMapper.select(shySites); | ||
| 57 | - return sitesList; | 55 | + public ShyContent getShyContent(ShyContent shyContent) { |
| 56 | + List<ShyContent> shyContentList = shyContentMapper.select(shyContent); | ||
| 57 | + if(CommonUtils.isNotNull(shyContentList)&­ContentList.size()>0){ | ||
| 58 | + return shyContentList.get(0); | ||
| 59 | + } | ||
| 60 | + return new ShyContent(); | ||
| 58 | } | 61 | } |
| 59 | 62 | ||
| 60 | //************************************** | 63 | //************************************** |
src/main/resources/templates/page/comment.html
| @@ -266,7 +266,7 @@ | @@ -266,7 +266,7 @@ | ||
| 266 | th:href="@{'/comments/details/'+${comment.id}}">>哈哈哈</a> | 266 | th:href="@{'/comments/details/'+${comment.id}}">>哈哈哈</a> |
| 267 | </td> | 267 | </td> |
| 268 | <td style="text-align: center; width: 15%;" | 268 | <td style="text-align: center; width: 15%;" |
| 269 | - th:text="${comment.comment_title}"> | 269 | + th:text="${comment.comment_title}" th:href="@{${comment.comment_original_url}}"> |
| 270 | </td> | 270 | </td> |
| 271 | <td style="text-align: center; width: 6%;" th:text="${comment.updater}"> | 271 | <td style="text-align: center; width: 6%;" th:text="${comment.updater}"> |
| 272 | 发布 | 272 | 发布 |
src/main/resources/templates/page/content.html
| @@ -223,11 +223,18 @@ | @@ -223,11 +223,18 @@ | ||
| 223 | <td style="text-align: center; width: 6%;" th:text="${content.sp_desc}"></td> | 223 | <td style="text-align: center; width: 6%;" th:text="${content.sp_desc}"></td> |
| 224 | <td style="text-align: center; width: 20%;" > | 224 | <td style="text-align: center; width: 20%;" > |
| 225 | <a class="detail" th:href="@{'/content/details/'+${content.id}}"> | 225 | <a class="detail" th:href="@{'/content/details/'+${content.id}}"> |
| 226 | - <span th:text="${content.title}">邓建国正面PK冯小刚</span> | 226 | + <span th:if="${content.title == '' and content.content_tag=='moment'}"> |
| 227 | +<!-- <span th:text="${content.source}"></span> --> | ||
| 228 | + 朋友圈发布无标题内容 | ||
| 229 | + </span> | ||
| 230 | + <span th:if="${content.title != ''}"> | ||
| 231 | + <span th:text="${content.title}"></span> | ||
| 232 | + </span> | ||
| 227 | </a> | 233 | </a> |
| 228 | </td> | 234 | </td> |
| 229 | - <td style="text-align: center; width: 3%;" | ||
| 230 | - th:text="${content.content_tag}">图文 | 235 | + <td style="text-align: center; width: 6%;"> |
| 236 | + <span th:if="${content.content_tag=='content'}">图文发布</span> | ||
| 237 | + <span th:if="${content.content_tag=='moment'}">朋友圈</span> | ||
| 231 | </td> | 238 | </td> |
| 232 | <td style="text-align: center; width: 3%;"> | 239 | <td style="text-align: center; width: 3%;"> |
| 233 | <span class="btn btn-sm btn-warning" th:if="${content.content_status==0}">待发布</span> | 240 | <span class="btn btn-sm btn-warning" th:if="${content.content_status==0}">待发布</span> |
src/main/resources/templates/page/contentDetail.html
| @@ -96,7 +96,7 @@ | @@ -96,7 +96,7 @@ | ||
| 96 | </div> | 96 | </div> |
| 97 | <div class="form-group"> | 97 | <div class="form-group"> |
| 98 | <label for="comment_user_avatar" | 98 | <label for="comment_user_avatar" |
| 99 | - class="control-label col-sm-2">标题图片:</label> | 99 | + class="control-label col-sm-2">标题图片(头像):</label> |
| 100 | <div class="col-sm-10"> | 100 | <div class="col-sm-10"> |
| 101 | <h5><img width="160px" th:src="@{${content.title_image}}" | 101 | <h5><img width="160px" th:src="@{${content.title_image}}" |
| 102 | alt="标题图片"></h5> | 102 | alt="标题图片"></h5> |
| @@ -107,7 +107,8 @@ | @@ -107,7 +107,8 @@ | ||
| 107 | <div class="form-group"> | 107 | <div class="form-group"> |
| 108 | <label for="comment_user_name" class="control-label col-sm-2">图文标签:</label> | 108 | <label for="comment_user_name" class="control-label col-sm-2">图文标签:</label> |
| 109 | <div class="col-sm-10"> | 109 | <div class="col-sm-10"> |
| 110 | - <h5 th:text="${content.content_tag}">鱼</h5> | 110 | + <h5 th:if="${content.content_tag=='content'}">图文发布</h5> |
| 111 | + <h5 th:if="${content.content_tag=='moment'}">朋友圈</h5> | ||
| 111 | </div> | 112 | </div> |
| 112 | </div> | 113 | </div> |
| 113 | 114 | ||
| @@ -132,14 +133,14 @@ | @@ -132,14 +133,14 @@ | ||
| 132 | 133 | ||
| 133 | <div class="form-group"> | 134 | <div class="form-group"> |
| 134 | <label for="comment_user_ip" | 135 | <label for="comment_user_ip" |
| 135 | - class="control-label col-sm-2">来源:</label> | 136 | + class="control-label col-sm-2">来源(昵称):</label> |
| 136 | <div class="col-sm-10"> | 137 | <div class="col-sm-10"> |
| 137 | <h5 th:text="${content.source}">114.242.177.100</h5> | 138 | <h5 th:text="${content.source}">114.242.177.100</h5> |
| 138 | </div> | 139 | </div> |
| 139 | </div> | 140 | </div> |
| 140 | 141 | ||
| 141 | <div class="form-group"> | 142 | <div class="form-group"> |
| 142 | - <label for="app_id" class="control-label col-sm-2">作者:</label> | 143 | + <label for="app_id" class="control-label col-sm-2">作者(sid):</label> |
| 143 | <div class="col-sm-10"> | 144 | <div class="col-sm-10"> |
| 144 | <h5 th:text="${content.author}">769_jetj7bq525</h5> | 145 | <h5 th:text="${content.author}">769_jetj7bq525</h5> |
| 145 | </div> | 146 | </div> |