diff --git a/README.md b/README.md index c37bbf51..92371146 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,11 @@

- [![GitHub stars](https://img.shields.io/github/stars/Veal98/Echo?logo=github)](https://github.com/Veal98/Echo/stargazers) [![GitHub forks](https://img.shields.io/github/forks/Veal98/Echo?logo=github)](https://github.com/Veal98/Echo/network) -[![GitHub forks](https://img.shields.io/badge/version-1.0-brightgreen)]() +[![star](https://gitee.com/veal98/Echo/badge/star.svg?theme=dark)](https://gitee.com/veal98/Echo/stargazers) +[![fork](https://gitee.com/veal98/Echo/badge/fork.svg?theme=dark)](https://gitee.com/veal98/Echo/members) +[![version](https://img.shields.io/badge/version-1.0-brightgreen)]()
@@ -235,8 +236,8 @@ Echo 是一套前后端不分离的开源社区系统,基于目前主流 Java 以下是我个人发现的本项目存在的问题,但是暂时没有头绪无法解决,集思广益,欢迎各位小伙伴提 PR 解决: - [ ] 注册模块无法正常跳转到操作提示界面(本地运行没有问题) -- [ ] 评论功能的前端显示部分存在 Bug -- [ ] 查询我的评论(未完善) +- [x] 评论功能的前端显示部分存在 Bug +- [x] 查询我的评论(未完善) 以下是我觉得本项目还可以添加的功能,同样欢迎各位小伙伴提 issue 指出还可以增加哪些功能,或者直接提 PR 实现该功能: @@ -537,13 +538,20 @@ double score = Math.log10(Math.max(w, 1)) - [必读:Echo 项目的 README](https://mp.weixin.qq.com/s/iiukwRNW1-my1q6UjYl4iw) - [Echo 项目结构分析](https://mp.weixin.qq.com/s/dZqSB0EN5-rmGQeG3Lx2jA) -- Echo 数据库表分析 +- Echo 的数据库表是如何设计的 +- Echo 技术选型分析 ### 部署篇 - [Echo 在 Windows 环境下的部署](https://mp.weixin.qq.com/s/ZgYGqLB5_rfCXNrW9jqgtQ) - [Echo 在 Linux 服务器上的部署](https://mp.weixin.qq.com/s/q9X5sJv7mtPaSApZB0PxPA) +### 架构篇 + +### 技术要点篇 + +### 常见面试题 + ## 📞 联系我 有什么问题也可以添加我的微信,记得备注来意:格式 (学校或公司 - 姓名或昵称 - 来意) diff --git a/docs/README.md b/docs/README.md index d1fd64f3..40539a7b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -524,13 +524,20 @@ double score = Math.log10(Math.max(w, 1)) - [必读:Echo 项目的 README](https://mp.weixin.qq.com/s/iiukwRNW1-my1q6UjYl4iw) - [Echo 项目结构分析](https://mp.weixin.qq.com/s/dZqSB0EN5-rmGQeG3Lx2jA) -- Echo 数据库表分析 +- Echo 的数据库表是如何设计的 +- Echo 技术选型分析 ### 部署篇 - [Echo 在 Windows 环境下的部署](https://mp.weixin.qq.com/s/ZgYGqLB5_rfCXNrW9jqgtQ) - [Echo 在 Linux 服务器上的部署](https://mp.weixin.qq.com/s/q9X5sJv7mtPaSApZB0PxPA) +### 架构篇 + +### 技术要点篇 + +### 常见面试题 + ## 📞 联系我 有什么问题也可以添加我的微信,记得备注来意:格式 (学校或公司 - 姓名或昵称 - 来意) diff --git a/src/main/java/com/greate/community/controller/DiscussPostController.java b/src/main/java/com/greate/community/controller/DiscussPostController.java index e00d3da0..190a3fab 100644 --- a/src/main/java/com/greate/community/controller/DiscussPostController.java +++ b/src/main/java/com/greate/community/controller/DiscussPostController.java @@ -138,7 +138,7 @@ public class DiscussPostController implements CommunityConstant { Map replyVo = new HashMap<>(); replyVo.put("reply", reply); // 回复 replyVo.put("user", userService.findUserById(reply.getUserId())); // 发布该回复的作者 - User target = reply.getTargetId() == 0 ? null : userService.findUserById(reply.getUserId()); + User target = reply.getTargetId() == 0 ? null : userService.findUserById(reply.getTargetId()); replyVo.put("target", target); // 该回复的目标用户 likeCount = likeService.findEntityLikeCount(ENTITY_TYPE_COMMENT, reply.getId()); replyVo.put("likeCount", likeCount); // 该回复的点赞数量 diff --git a/src/main/java/com/greate/community/controller/UserController.java b/src/main/java/com/greate/community/controller/UserController.java index 3ae3f2b0..a936661e 100644 --- a/src/main/java/com/greate/community/controller/UserController.java +++ b/src/main/java/com/greate/community/controller/UserController.java @@ -248,9 +248,18 @@ public class UserController implements CommunityConstant { for (Comment comment : list) { Map map = new HashMap<>(); map.put("comment", comment); - - // 待做 - + // 显示评论/回复对应的文章信息 + if (comment.getEntityType() == ENTITY_TYPE_POST) { + // 如果是对帖子的评论,则直接查询 target_id 即可 + DiscussPost post = discussPostService.findDiscussPostById(comment.getEntityId()); + map.put("post", post); + } + else if (comment.getEntityType() == ENTITY_TYPE_COMMENT) { + // 如过是对评论的回复,则先根据该回复的 target_id 查询评论的 id, 再根据该评论的 target_id 查询帖子的 id + Comment targetComment = commentService.findCommentById(comment.getEntityId()); + DiscussPost post = discussPostService.findDiscussPostById(targetComment.getEntityId()); + map.put("post", post); + } comments.add(map); } diff --git a/src/main/java/com/greate/community/event/EventConsumer.java b/src/main/java/com/greate/community/event/EventConsumer.java index ee761ebd..325fcf48 100644 --- a/src/main/java/com/greate/community/event/EventConsumer.java +++ b/src/main/java/com/greate/community/event/EventConsumer.java @@ -42,12 +42,6 @@ public class EventConsumer implements CommunityConstant { @Value("${qiniu.key.secret}") private String secretKey; - @Value("${qiniu.bucket.share.name}") - private String shareBucketName; - - @Value("${qiniu.bucket.share.url}") - private String shareBucketUrl; - /** * 消费评论、点赞、关注事件 * @param record diff --git a/src/main/resources/application-develop.properties b/src/main/resources/application-develop.properties index aecf1156..3f3cfd93 100644 --- a/src/main/resources/application-develop.properties +++ b/src/main/resources/application-develop.properties @@ -15,6 +15,7 @@ spring.datasource.url = jdbc:mysql://127.0.0.1:3306/greatecommunity?characterEnc spring.datasource.username = root spring.datasource.password = root # Mysql 5.0+ 汾ʹ com.mysql.jdbc.Driver +# 8.0+ İ汾ij com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name = com.mysql.jdbc.Driver # Mybatis diff --git a/src/main/resources/templates/site/discuss-detail.html b/src/main/resources/templates/site/discuss-detail.html index e0252c41..844b1553 100644 --- a/src/main/resources/templates/site/discuss-detail.html +++ b/src/main/resources/templates/site/discuss-detail.html @@ -79,6 +79,7 @@
+
diff --git a/src/main/resources/templates/site/my-post.html b/src/main/resources/templates/site/my-post.html index 57650901..c8f0b4d2 100644 --- a/src/main/resources/templates/site/my-post.html +++ b/src/main/resources/templates/site/my-post.html @@ -28,11 +28,11 @@
  • -
    文章内容
    -
    - 赞 - 发布于 + + 赞 + 评论 + 发布于 +
  • diff --git a/src/main/resources/templates/site/my-reply.html b/src/main/resources/templates/site/my-reply.html index fdb22c7c..660ab52c 100644 --- a/src/main/resources/templates/site/my-reply.html +++ b/src/main/resources/templates/site/my-reply.html @@ -28,7 +28,7 @@