feat: 添加评论功能,包括评论输入、评论列表和评论项组件,支持层级深度和私密评论

This commit is contained in:
2025-07-31 08:03:19 +08:00
parent 92c2a58e80
commit 94aa4f1b1f
23 changed files with 303 additions and 53 deletions

View File

@ -10,7 +10,7 @@ type Comment struct {
TargetType string `gorm:"index"` // 目标类型,如 "post", "page"
ReplyID uint `gorm:"index"` // 回复的评论ID
Content string `gorm:"type:text"` // 评论内容
Depth int `gorm:"default:0"` // 评论的层级深度
Depth int `gorm:"default:0"` // 评论的层级深度,从0开始计数
IsPrivate bool `gorm:"default:false"` // 是否为私密评论,私密评论只有评论者和被评论对象所有者可见
LikeCount uint64
CommentCount uint64