- jxcontext.New

This commit is contained in:
gazebo
2019-03-05 11:18:30 +08:00
parent 9179ad127d
commit a8e92dd92e
5 changed files with 58 additions and 12 deletions

View File

@@ -12,8 +12,49 @@ const (
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 {
IUser
UserBasic
AuthBindInfo *model.AuthBind
LoginTime time.Time