- first edition of auth2
This commit is contained in:
32
business/auth2/auth_info.go
Normal file
32
business/auth2/auth_info.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package auth2
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
)
|
||||
|
||||
const (
|
||||
TokenTypeNone = 0
|
||||
TokenTypeNormal = 1
|
||||
TokenTypeOnlyAuth = 2
|
||||
)
|
||||
|
||||
type AuthInfo struct {
|
||||
IUser
|
||||
AuthBindInfo *model.AuthBind
|
||||
|
||||
LoginTime time.Time
|
||||
ExpiresIn int64
|
||||
Token string
|
||||
TokenType int // TOKEN类型,
|
||||
UserData interface{}
|
||||
}
|
||||
|
||||
func (a *AuthInfo) GetAuthID() string {
|
||||
return a.AuthBindInfo.AuthID
|
||||
}
|
||||
|
||||
func (a *AuthInfo) GetAuthType() string {
|
||||
return a.AuthBindInfo.Type
|
||||
}
|
||||
Reference in New Issue
Block a user