feat: add checkId getId api and SecondAuth api

This commit is contained in:
weloe
2023-08-15 00:44:10 +08:00
parent a9aa15db0c
commit 62208f09d8
7 changed files with 121 additions and 1 deletions

View File

@@ -37,8 +37,10 @@ type IEnforcer interface {
IsLoginByToken(token string) (bool, error)
IsLoginById(id string) (bool, error)
CheckLogin(ctx ctx.Context) error
CheckLoginByToken(token string) error
GetLoginId(ctx ctx.Context) (string, error)
GetLoginIdByToken(token string) (string, error)
GetIdByToken(token string) string
GetLoginCount(id string) int
@@ -52,6 +54,12 @@ type IEnforcer interface {
GetBannedLevel(id string, service string) (int64, error)
GetBannedTime(id string, service string) int64
// Second auth api
OpenSafe(token string, service string, time int64) error
IsSafe(token string, service string) bool
GetSafeTime(token string, service string) int64
CloseSafe(token string, service string) error
GetRequestToken(ctx ctx.Context) string
AddTokenGenerateFun(tokenStyle string, f model.GenerateFunc) error