补齐论坛核心能力:讨论锁定、发帖本地草稿、标签精确筛选,以及私信与通知分流。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -194,6 +194,11 @@ func (s *CommentService) Create(in CommentCreateInput) (*model.Comment, error) {
|
||||
return nil, errors.New("账号已被禁言")
|
||||
}
|
||||
|
||||
// 讨论锁定:管理员亦不可强评(避免结贴后仍被顶楼)
|
||||
if post.CommentsLocked {
|
||||
return nil, ErrPostCommentsLocked
|
||||
}
|
||||
|
||||
// 未公开帖仅作者/管理员可评论
|
||||
if post.Status != model.ContentStatusPublished && post.Status != "" {
|
||||
if user.Role != model.RoleAdmin && post.UserID != in.UserID {
|
||||
|
||||
Reference in New Issue
Block a user