fix(P2): 修复 import cycle — 将 apierror 移出 internal/http 避免循环依赖
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user