主流程

This commit is contained in:
2026-06-10 17:53:09 +08:00
parent c6f239f424
commit b20435c027
66 changed files with 2779 additions and 1181 deletions
+5 -5
View File
@@ -335,14 +335,14 @@ func (s *sessionService) Get(ctx context.Context, c Caller, id uuid.UUID) (*Sess
return sess, nil
}
func (s *sessionService) List(ctx context.Context, c Caller, all bool) ([]*Session, error) {
if all && !c.IsAdmin {
func (s *sessionService) List(ctx context.Context, c Caller, f SessionListFilter) ([]*Session, error) {
if f.All && !c.IsAdmin {
return nil, errs.New(errs.CodeForbidden, "admin only")
}
if all {
return s.repo.ListAllSessions(ctx)
if f.All {
return s.repo.ListAllSessions(ctx, f.RequirementID)
}
return s.repo.ListSessionsByUser(ctx, c.UserID)
return s.repo.ListSessionsByUser(ctx, c.UserID, f.RequirementID)
}
func (s *sessionService) Terminate(ctx context.Context, c Caller, id uuid.UUID) error {