fix(P2): 修复 import cycle — 将 apierror 移出 internal/http 避免循环依赖

This commit is contained in:
Sisyphus
2026-04-25 16:18:57 +08:00
parent 4094a13846
commit 15f86f08ae
9 changed files with 61 additions and 61 deletions

View File

@@ -5,7 +5,7 @@ import (
"errors"
"feedsystem_video_go/internal/middleware/rabbitmq"
rediscache "feedsystem_video_go/internal/middleware/redis"
httputil "feedsystem_video_go/internal/http"
"feedsystem_video_go/internal/apierror"
"strings"
"gorm.io/gorm"
@@ -95,7 +95,7 @@ func (s *CommentService) Delete(ctx context.Context, commentID uint, accountID u
return errors.New("comment not found")
}
if comment.AuthorID != accountID {
return httputil.ErrUnauthorized
return apierror.ErrUnauthorized
}
if s.commentMQ != nil {
if err := s.commentMQ.Delete(ctx, commentID); err == nil {