refactor: token cache logic

This commit is contained in:
CalciumIon
2024-12-30 17:10:48 +08:00
parent ca8b7ed1c3
commit bb5e032dd2
15 changed files with 417 additions and 196 deletions

View File

@@ -9,10 +9,15 @@ var (
UserId2StatusCacheSeconds = common.SyncFrequency
)
// Cache keys
const (
// Cache keys
UserGroupKeyFmt = "user_group:%d"
UserQuotaKeyFmt = "user_quota:%d"
UserEnabledKeyFmt = "user_enabled:%d"
UserUsernameKeyFmt = "user_name:%d"
)
const (
TokenFiledRemainQuota = "RemainQuota"
TokenFieldGroup = "Group"
)