feat(app): wire workspace module + integration test for ws closed loop

This commit is contained in:
2026-05-02 09:39:27 +08:00
parent 78e74c9734
commit 7429a817bc
9 changed files with 584 additions and 1 deletions
+13
View File
@@ -93,6 +93,19 @@ func (s *projectService) Get(ctx context.Context, c Caller, slug string) (*Proje
return p, nil
}
// GetByID 与 Get 等价但按 uuid 寻址,用于 workspace.ProjectAccess.ResolveByID。
// 鉴权矩阵与 Get 相同:private 仅 owner+admin,internal 任意登录用户。
func (s *projectService) GetByID(ctx context.Context, c Caller, id uuid.UUID) (*Project, error) {
p, err := s.repo.GetProjectByID(ctx, id)
if err != nil {
return nil, err
}
if err := assertReadable(p, c); err != nil {
return nil, err
}
return p, nil
}
func (s *projectService) List(ctx context.Context, c Caller, includeArchived bool) ([]*Project, error) {
all, err := s.repo.ListProjects(ctx, includeArchived)
if err != nil {