package auth2 import ( "time" "git.rosy.net.cn/jx-callback/business/model" ) const ( TokenTypeNone = 0 TokenTypeNormal = 1 TokenTypeOnlyAuth = 2 ) type UserBasic struct { UserID string UserID2 string Mobile string Email string Name string } func (u *UserBasic) GetID() string { return u.UserID } func (u *UserBasic) GetID2() string { return u.UserID2 } func (u *UserBasic) GetMobile() string { return u.Mobile } func (u *UserBasic) GetEmail() string { return u.Email } func (u *UserBasic) GetName() string { return u.Name } func (u *UserBasic) UpdateByIUser(user IUser) { if user != nil { u.UserID = user.GetID() u.UserID2 = user.GetID2() u.Mobile = user.GetMobile() u.Email = user.GetEmail() u.Name = user.GetName() } } func (u *UserBasic) IsUserEmpty() bool { return u.UserID == "" } type AuthInfo struct { UserBasic 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 }