mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-20 05:50:53 +08:00
feat(posts): 优化帖子评论统计性能
- 在 Post 模型中添加 commentCount 和 lastReplyAt 字段 - 在 CommentService 中实现更新帖子评论统计的方法 - 在 PostMapper 中使用 Post 模型中的评论统计字段 - 新增数据库迁移脚本,添加评论统计字段和索引 - 更新相关测试用例
This commit is contained in:
@@ -72,4 +72,10 @@ public class Post {
|
||||
|
||||
@Column(nullable = true)
|
||||
private Boolean rssExcluded = true;
|
||||
|
||||
@Column(nullable = false)
|
||||
private long commentCount = 0;
|
||||
|
||||
@Column(nullable = true)
|
||||
private LocalDateTime lastReplyAt;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user