From c8dbfde642d17b489896d6efb14b5f402dcee6fe Mon Sep 17 00:00:00 2001
From: yangrunkang
Date: Mon, 17 Jan 2022 18:04:47 +0800
Subject: [PATCH] =?UTF-8?q?Add:=20=E8=B0=83=E6=95=B4=E9=A1=B5=E8=84=9A?=
=?UTF-8?q?=E5=AF=B9=E9=BD=90=E6=96=B9=E5=BC=8F=E4=B8=BA=E5=B7=A6=E5=AF=B9?=
=?UTF-8?q?=E9=BD=90&=20Mod:=20=E7=BC=96=E8=BE=91=E5=99=A8=E9=A2=84?=
=?UTF-8?q?=E8=A7=88=E5=9B=BE=E7=89=87=E6=9C=80=E5=A4=A7=E9=AB=98=E5=BA=A6?=
=?UTF-8?q?=E5=92=8C=E5=AE=BD=E5=BA=A6=E8=AE=BE=E5=AE=9A&=20Add:404?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD=E4=B8=8B?=
=?UTF-8?q?=E7=BA=BF=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 2 +-
.../manage/business/CommentManage.java | 159 ------------------
.../com/upupor/service/common/CcConstant.java | 1 -
.../web/page/MemberManageJumpController.java | 23 ---
.../main/resources/static/css/common/img.css | 8 +
.../resources/templates/editor/editor.html | 1 +
.../main/resources/templates/error/404.html | 2 +-
.../resources/templates/layout/footer.html | 2 +-
8 files changed, 12 insertions(+), 186 deletions(-)
delete mode 100644 upupor-service/src/main/java/com/upupor/service/business/manage/business/CommentManage.java
diff --git a/README.md b/README.md
index 12f04e49..d6c52f40 100755
--- a/README.md
+++ b/README.md
@@ -59,5 +59,5 @@ export GOOGLE_TAG_ID=Google分析Id
## 应用内环境变量
> 此为示例,请根据实际情况修改
```
-MYSQL_HOST=localhost;MYSQL_PORT=3306;MYSQL_USERNAME=root;MYSQL_PASSWORD=123456;MYSQL_DATABASE=open_base;REDIS_HOST=localhost;REDIS_PORT=6379;REDIS_PASSWORD=;ALLOW_UPLOAD_PIC_SUFFIX=jpg;ALLOW_UPLOAD_PIC_QUALITY=0.5;EMAIL_ON=0;EMAIL_SENDER_NICK_NAME=;EMAIL_SENDER_ACCOUNT=;EMAIL_ACCESS_KEY=;EMAIL_ACCESS_SECRET= ;WEBSITE=http://localhost:2020;AD_SWITCH=0;AD_SWITCH_RIGHT=0;ANALYZE_SWITCH=0;OSS_BUCKET_NAME=;OSS_FILE_HOST=;OSS_STATIC=http://localhost:2020;LUENCE_INDEX_DIC=;THYMELEAF_CACHE=false;LOG_PATH=/Users/yangrunkang/logs;UPUPOR_ENV=dev;GOOGLE_DATA_AD_CLIENT_ID=;GOOGLE_AD_RIGHT=;GOOGLE_AD_FEED=
+MYSQL_HOST=localhost;MYSQL_PORT=3306;MYSQL_USERNAME=root;MYSQL_PASSWORD=123456;MYSQL_DATABASE=open_base;REDIS_HOST=localhost;REDIS_PORT=6379;REDIS_PASSWORD=;ALLOW_UPLOAD_PIC_SUFFIX=jpg;ALLOW_UPLOAD_PIC_QUALITY=0.5;EMAIL_ON=0;EMAIL_SENDER_NICK_NAME=;EMAIL_SENDER_ACCOUNT=;EMAIL_ACCESS_KEY=;EMAIL_ACCESS_SECRET= ;WEBSITE=http://localhost:2020;AD_SWITCH=0;AD_SWITCH_RIGHT=0;ANALYZE_SWITCH=0;OSS_BUCKET_NAME=;OSS_FILE_HOST=;OSS_STATIC=http://localhost:2020;LUENCE_INDEX_DIC=;THYMELEAF_CACHE=false;LOG_PATH=/Users/yangrunkang/logs;UPUPOR_ENV=dev;GOOGLE_DATA_AD_CLIENT_ID=;GOOGLE_AD_RIGHT=;GOOGLE_AD_FEED=;GOOGLE_TAG_ID=
```
\ No newline at end of file
diff --git a/upupor-service/src/main/java/com/upupor/service/business/manage/business/CommentManage.java b/upupor-service/src/main/java/com/upupor/service/business/manage/business/CommentManage.java
deleted file mode 100644
index 809b6963..00000000
--- a/upupor-service/src/main/java/com/upupor/service/business/manage/business/CommentManage.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * MIT License
- *
- * Copyright (c) 2021-2022 yangrunkang
- *
- * Author: yangrunkang
- * Email: yangrunkang53@gmail.com
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package com.upupor.service.business.manage.business;
-
-import com.upupor.service.business.aggregation.service.ContentService;
-import com.upupor.service.business.aggregation.service.MemberService;
-import com.upupor.service.business.manage.AbstractManageInfoGet;
-import com.upupor.service.business.manage.ManageDto;
-import com.upupor.service.business.manage.service.CommentManageService;
-import com.upupor.service.business.aggregation.dao.entity.Comment;
-import com.upupor.service.business.aggregation.dao.entity.Content;
-import com.upupor.service.business.aggregation.dao.entity.Member;
-import com.upupor.service.dto.page.common.ListCommentDto;
-import com.upupor.service.outer.req.ListCommentReq;
-import com.upupor.service.types.ContentType;
-import org.springframework.stereotype.Component;
-import org.springframework.util.CollectionUtils;
-import org.springframework.util.StringUtils;
-
-import javax.annotation.Resource;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * @author cruise
- * @createTime 2021-12-24 18:03
- */
-@Component
-public class CommentManage extends AbstractManageInfoGet {
-
- @Resource
- private CommentManageService commentManageService;
-
- @Resource
- private MemberService memberService;
-
- @Resource
- private ContentService contentService;
-
- @Override
- protected void specifyDtoHandle(ManageDto manageDto) {
- Integer pageNum = manageDto.getPageNum();
- Integer pageSize = manageDto.getPageSize();
- String userId = manageDto.getUserId();
-
-
- ListCommentReq listCommentReq = new ListCommentReq();
- listCommentReq.setUserId(userId);
- listCommentReq.setPageSize(pageSize);
- listCommentReq.setPageNum(pageNum);
- // 获取全部状态评论
- listCommentReq.setStatus(null);
- ListCommentDto listCommentDto = commentManageService.listComment(listCommentReq);
- // 处理评论的用户文章
- getCommentContentTitle(listCommentDto);
- // 处理留言板的评论
- getCommentProfileMessage(listCommentDto);
- // 处理评论中的内容,如果有则不显示评论内容
- hiddenSomeComment(listCommentDto);
-
- getMemberIndexDto().setListCommentDto(listCommentDto);
-
- }
-
-
- private void hiddenSomeComment(ListCommentDto listCommentDto) {
- List commentList = listCommentDto.getCommentList();
- if (CollectionUtils.isEmpty(commentList)) {
- return;
- }
- commentList.forEach(comment -> {
- String commentContent = comment.getCommentContent();
- if (!StringUtils.isEmpty(commentContent)) {
- if (commentContent.contains("language-css")
- ||
- commentContent.contains("* 评论内容含有代码块或者图片,暂不予显示,请转至原文查看
");
- }
- }
- });
- }
-
- private void getCommentProfileMessage(ListCommentDto listCommentDto) {
- List commentList = listCommentDto.getCommentList();
- if (CollectionUtils.isEmpty(commentList)) {
- return;
- }
- List targetIdList = commentList.stream()
- .filter(c -> ContentType.MESSAGE.equals(c.getCommentSource()))
- .map(Comment::getTargetId).distinct().collect(Collectors.toList());
- if (CollectionUtils.isEmpty(targetIdList)) {
- return;
- }
- List memberList = memberService.listByUserIdList(targetIdList);
- if (CollectionUtils.isEmpty(memberList)) {
- return;
- }
- memberList.forEach(member -> {
- commentList.forEach(comment -> {
- if (comment.getTargetId().equals(member.getUserId())) {
- comment.setMember(member);
- }
- });
- });
- }
-
-
- private void getCommentContentTitle(ListCommentDto listCommentDto) {
- List commentList = listCommentDto.getCommentList();
- if (CollectionUtils.isEmpty(commentList)) {
- return;
- }
-
- List targetIdList = commentList.stream().map(Comment::getTargetId).distinct().collect(Collectors.toList());
- if (CollectionUtils.isEmpty(targetIdList)) {
- return;
- }
-
- List contentList = contentService.listByContentIdList(targetIdList);
- if (CollectionUtils.isEmpty(contentList)) {
- return;
- }
-
- commentList.forEach(comment -> contentList.forEach(content -> {
- if (comment.getTargetId().equals(content.getContentId())) {
- comment.setContent(content);
- }
- }));
-
- }
-}
\ No newline at end of file
diff --git a/upupor-service/src/main/java/com/upupor/service/common/CcConstant.java b/upupor-service/src/main/java/com/upupor/service/common/CcConstant.java
index f2c1a37b..0177fb70 100644
--- a/upupor-service/src/main/java/com/upupor/service/common/CcConstant.java
+++ b/upupor-service/src/main/java/com/upupor/service/common/CcConstant.java
@@ -155,7 +155,6 @@ public final class CcConstant {
public static final String USER_MANAGE_EDIT_USER_INFO = "user/manage/edit-user-info";
public static final String USER_MANAGE_BG_STYLE_SETTINGS = "user/manage/bg-style-settings";
public static final String USER_MANAGE_UPLOAD_PROFILE_PHOTO = "user/manage/upload-profile-photo";
- public static final String USER_MANAGE_COMMENT = "user/manage/comment";
public static final String USER_MANAGE_ATTENTION = "user/manage/attention";
public static final String USER_MANAGE_FAN = "user/manage/fans";
public static final String USER_MANAGE_INTEGRAL = "user/manage/integral";
diff --git a/upupor-web/src/main/java/com/upupor/web/page/MemberManageJumpController.java b/upupor-web/src/main/java/com/upupor/web/page/MemberManageJumpController.java
index eb339849..e119e30c 100644
--- a/upupor-web/src/main/java/com/upupor/web/page/MemberManageJumpController.java
+++ b/upupor-web/src/main/java/com/upupor/web/page/MemberManageJumpController.java
@@ -74,7 +74,6 @@ public class MemberManageJumpController {
private final MessageManage messageManage;
private final ProfilePhotoManage profilePhotoManage;
private final RadioManage radioManage;
- private final CommentManage commentManage;
private final MemberManage memberManage;
@ApiOperation("个人中心-内容管理")
@@ -179,28 +178,6 @@ public ModelAndView userManageCollect(Integer pageNum, Integer pageSize) {
return modelAndView;
}
- @ApiOperation("个人中心-评论")
- @GetMapping("/user/manage/comment")
- public ModelAndView userManageComment(Integer pageNum, Integer pageSize) {
- if (Objects.isNull(pageNum)) {
- pageNum = Page.NUM;
- }
- if (Objects.isNull(pageSize)) {
- pageSize = Page.SIZE;
- }
- ManageDto build = ManageDto.builder()
- .pageSize(pageSize)
- .pageNum(pageNum)
- .userId(ServletUtils.getUserId())
- .build();
- ModelAndView modelAndView = new ModelAndView();
- modelAndView.setViewName(USER_MANAGE_COMMENT);
- modelAndView.addObject(commentManage.getData(build));
- modelAndView.addObject(SeoKey.TITLE, "评论");
- modelAndView.addObject(SeoKey.DESCRIPTION, "评论");
- return modelAndView;
- }
-
@ApiOperation("个人中心-完善用户信息")
@GetMapping("/user/manage/edit-user-info")
diff --git a/upupor-web/src/main/resources/static/css/common/img.css b/upupor-web/src/main/resources/static/css/common/img.css
index cfea3a8c..8d102d0b 100644
--- a/upupor-web/src/main/resources/static/css/common/img.css
+++ b/upupor-web/src/main/resources/static/css/common/img.css
@@ -49,3 +49,11 @@ article figure img{
max-height: 100%;
margin: 0 auto;
}
+
+
+.cherry .cherry-previewer img {
+ width: auto;
+ height: auto;
+ max-width: 100%;
+ max-height: 100%;
+}
\ No newline at end of file
diff --git a/upupor-web/src/main/resources/templates/editor/editor.html b/upupor-web/src/main/resources/templates/editor/editor.html
index 2809c1b7..157c3c3d 100644
--- a/upupor-web/src/main/resources/templates/editor/editor.html
+++ b/upupor-web/src/main/resources/templates/editor/editor.html
@@ -30,6 +30,7 @@
th:replace="index">
+
diff --git a/upupor-web/src/main/resources/templates/error/404.html b/upupor-web/src/main/resources/templates/error/404.html
index 3703ffc9..c99e5293 100644
--- a/upupor-web/src/main/resources/templates/error/404.html
+++ b/upupor-web/src/main/resources/templates/error/404.html
@@ -44,7 +44,7 @@ 404提示
diff --git a/upupor-web/src/main/resources/templates/layout/footer.html b/upupor-web/src/main/resources/templates/layout/footer.html
index 35fa64b9..45453d16 100644
--- a/upupor-web/src/main/resources/templates/layout/footer.html
+++ b/upupor-web/src/main/resources/templates/layout/footer.html
@@ -72,7 +72,7 @@