refactor(*): 稳定期治理 - 收敛核心架构、错误语义并修复跨项目数据竞态

This commit is contained in:
ddCat committed 2026-09-09 22:02:10 +08:00
1 parent bacd502f5c
commit b5f3413ded
298 files changed
+12681 -26428

No files matched your search

@@ -7,7 +7,7 @@ import (
"infinite-canvas/backend/internal/model"
)
// ResourceForUser is the service-layer ownership check used by provider workers.
// ResourceForUser 是 Provider worker 读取资源时必须经过的 service 层归属校验。
func (s *Service) ResourceForUser(actor *model.User, id string) (*model.Resource, error) {
if actor == nil || actor.ID == "" {
return nil, errors.New("用户身份无效")
@@ -15,8 +15,8 @@ func (s *Service) ResourceForUser(actor *model.User, id string) (*model.Resource
return s.repo.ResourceForUser(actor.ID, id)
}
// providerResourceURL gives an upstream a short-lived URL after the resource
// ownership and ready-state checks have already been performed.
// providerResourceURL 只能接收已经完成用户归属和 ready 状态校验的资源,
// 并为上游签发短时地址;它不是绕过权限校验的通用资源 URL 生成器。
func (s *Service) providerResourceURL(resource *model.Resource, expiresAt time.Time) (string, error) {
return s.directResourceURL(resource, expiresAt)
}