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

@ -17,19 +17,21 @@ type CreateCommentReq struct {
TargetType string `json:"target_type" binding:"required"` // 目标类型,如 "post", "page"
Content string `json:"content" binding:"required"` // 评论内容
ReplyID uint `json:"reply_id"` // 回复的评论ID
IsPrivate bool `json:"is_private" binding:"required"` // 是否私密
IsPrivate bool `json:"is_private"` // 是否私密评论默认false
}
type UpdateCommentReq struct {
CommentID uint `json:"comment_id" binding:"required"` // 评论ID
Content string `json:"content" binding:"required"` // 评论内容
IsPrivate bool `json:"is_private"` // 是否私密
}
type GetCommentListReq struct {
TargetID uint `json:"target_id" binding:"required"`
TargetID uint `json:"target_id" binding:"required"`
TargetType string `json:"target_type" binding:"required"`
OrderBy string `json:"order_by"` // 排序方式
Page uint64 `json:"page"` // 页码
Size uint64 `json:"size"`
Desc bool `json:"desc"`
}
OrderBy string `json:"order_by"` // 排序方式
Page uint64 `json:"page"` // 页码
Size uint64 `json:"size"`
Desc bool `json:"desc"`
Depth int `json:"depth"` // 评论的层级深度
}