refactor(api): 删掉没有调用方的 QuotaAvailable,修正 passkey last_used_at 的过时注释

This commit is contained in:
Lemon-miaow committed 2026-09-27 14:20:20 +08:00
1 parent 4839d52f88
commit 56a4bbcf4c
5 files changed
+9 -45

No files matched your search

+5 -6
View File
@@ -335,15 +335,14 @@ func (f *fakeRepo) ServerByName(_ context.Context, n string) (*ServerRecord, err
}
return nil, ErrNotFound
}
func (f *fakeRepo) IsLinked(_ context.Context, u string) (bool, error) { return f.linked[u], nil }
func (f *fakeRepo) QuotaAvailable(_ context.Context, u string) (bool, error) { return f.quota[u], nil }
func (f *fakeRepo) IsLinked(_ context.Context, u string) (bool, error) { return f.linked[u], nil }
func (f *fakeRepo) QuotaCheck(_ context.Context, userID string, _ string, incoming ResourceSpec) (bool, error) {
f.quotaChecked = append(f.quotaChecked, incoming)
// For hermetic tests, QuotaCheck delegates to the same QuotaAvailable
// store — tests that care about per-dimension checks should use
// fakeQuotas with direct inspection.
return f.QuotaAvailable(context.TODO(), userID)
// For hermetic tests, QuotaCheck answers from the per-user quota flag —
// tests that care about per-dimension checks should use fakeQuotas with
// direct inspection.
return f.quota[userID], nil
}
func (f *fakeRepo) UpdateServerResources(ctx context.Context, name string, cpu, mem, stor int) error {