feat(moderation): add manual content review system with three-tier AI moderation
All checks were successful
Build Backend / build (push) Successful in 2m43s
Build Backend / build-docker (push) Successful in 1m22s

Add admin comment moderation endpoints (single and batch) and introduce a three-tier moderation system (pass/review/block) for content flagged by AI. Content with unclear violations is now held for manual review instead of being auto-rejected. Deleted the legacy audit_service.go in favor of the unified hook-based moderation system.
This commit is contained in:
lafay
2026-04-11 04:23:24 +08:00
parent 6af6aaa9d0
commit 1bb82e1e2b
17 changed files with 432 additions and 732 deletions

View File

@@ -1014,6 +1014,9 @@ type AdminCommentListResponse struct {
Content string `json:"content"`
Images []CommentImageResponse `json:"images"`
Status string `json:"status"`
RejectReason string `json:"reject_reason,omitempty"`
ReviewedAt string `json:"reviewed_at,omitempty"`
ReviewedBy string `json:"reviewed_by,omitempty"`
LikesCount int `json:"likes_count"`
RepliesCount int `json:"replies_count"`
CreatedAt string `json:"created_at"`
@@ -1038,13 +1041,16 @@ type AdminCommentDetailResponse struct {
Content string `json:"content"`
Images []CommentImageResponse `json:"images"`
Status string `json:"status"`
RejectReason string `json:"reject_reason,omitempty"`
ReviewedAt string `json:"reviewed_at,omitempty"`
ReviewedBy string `json:"reviewed_by,omitempty"`
LikesCount int `json:"likes_count"`
RepliesCount int `json:"replies_count"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Author *UserResponse `json:"author"`
Post *AdminCommentPostInfo `json:"post"`
ReplyToUser *UserResponse `json:"reply_to_user,omitempty"` // 被回复的用户信息
ReplyToUser *UserResponse `json:"reply_to_user,omitempty"`
}
// AdminBatchDeleteCommentsRequest 批量删除评论请求
@@ -1052,6 +1058,18 @@ type AdminBatchDeleteCommentsRequest struct {
IDs []string `json:"ids" binding:"required,min=1,max=100,dive,required"`
}
// AdminModerateCommentRequest 审核评论请求
type AdminModerateCommentRequest struct {
Status string `json:"status" binding:"required,oneof=published rejected"`
Reason string `json:"reason"`
}
// AdminBatchModerateCommentsRequest 批量审核评论请求
type AdminBatchModerateCommentsRequest struct {
IDs []string `json:"ids" binding:"required,min=1,max=100,dive,required"`
Status string `json:"status" binding:"required,oneof=published rejected"`
}
// ==================== Admin Group DTOs ====================
// AdminGroupListResponse 管理端群组列表响应