fix:create auth token can add expire time (#2352)

* fix:create auth token can add expire time

* refactor:move expire time calculate into cache from controller
This commit is contained in:
icey-yu
2024-06-24 16:11:19 +08:00
committed by GitHub
parent 877abfe7ce
commit d6606152ee
4 changed files with 45 additions and 9 deletions
+3 -1
View File
@@ -5,7 +5,9 @@ import (
)
type TokenModel interface {
AddTokenFlag(ctx context.Context, userID string, platformID int, token string, flag int) error
SetTokenFlag(ctx context.Context, userID string, platformID int, token string, flag int) error
// SetTokenFlagEx set token and flag with expire time
SetTokenFlagEx(ctx context.Context, userID string, platformID int, token string, flag int) error
GetTokensWithoutError(ctx context.Context, userID string, platformID int) (map[string]int, error)
SetTokenMapByUidPid(ctx context.Context, userID string, platformID int, m map[string]int) error
DeleteTokenByUidPid(ctx context.Context, userID string, platformID int, fields []string) error