refactor(comment): unify status transitions with atomic count maintenance
Consolidate comment status changes through transitionStatus() to ensure posts.comments_count and comments.replies_count are atomically maintained within the same transaction, preventing inconsistencies between displayed and stored counts. - Remove separate ApplyPublishedStats() calls, now handled in UpdateModerationStatus - Add cache invalidation for admin moderation operations - Update report auto-hide to use unified status transition
This commit is contained in:
@@ -350,8 +350,8 @@ func ProvideAdminPostService(postRepo repository.PostRepository, cacheBackend ca
|
||||
}
|
||||
|
||||
// ProvideAdminCommentService 提供管理端评论服务
|
||||
func ProvideAdminCommentService(commentRepo repository.CommentRepository, postRepo repository.PostRepository) service.AdminCommentService {
|
||||
return service.NewAdminCommentService(commentRepo, postRepo)
|
||||
func ProvideAdminCommentService(commentRepo repository.CommentRepository, postRepo repository.PostRepository, cacheBackend cache.Cache) service.AdminCommentService {
|
||||
return service.NewAdminCommentService(commentRepo, postRepo, cacheBackend)
|
||||
}
|
||||
|
||||
// ProvideAdminGroupService 提供管理端群组服务
|
||||
|
||||
Reference in New Issue
Block a user