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

@@ -11,7 +11,7 @@ import (
"feedsystem_video_go/internal/middleware/rabbitmq"
rediscache "feedsystem_video_go/internal/middleware/redis"
httputil "feedsystem_video_go/internal/http"
"feedsystem_video_go/internal/apierror"
"gorm.io/gorm"
)
@@ -77,7 +77,7 @@ func (vs *VideoService) Delete(ctx context.Context, id uint, authorID uint) erro
return errors.New("video not found")
}
if video.AuthorID != authorID {
return httputil.ErrUnauthorized
return apierror.ErrUnauthorized
}
if err := vs.repo.DeleteVideo(ctx, id); err != nil {
return err