32 lines
704 B
Go
32 lines
704 B
Go
package system
|
|
|
|
import (
|
|
"sundynix-go/global"
|
|
)
|
|
|
|
type Login interface {
|
|
GetAccount() string
|
|
GetUserId() string
|
|
GetUserInfo() any
|
|
}
|
|
type User struct {
|
|
global.BaseModel
|
|
TenantId string `gorm:"size:20;" json:"tenantId" form:"tenantId"`
|
|
ClientId string `gorm:"size:20;" json:"clientId"`
|
|
Account string `gorm:"size:11;unique;" json:"account" form:"account"`
|
|
Password string `gorm:"size:100;" json:"-" form:"password"`
|
|
Phone string `gorm:"size:11;" json:"phone" form:"phone"`
|
|
Roles []Role `gorm:"many2many:user_role;" json:"roles"`
|
|
}
|
|
|
|
func (u *User) GetAccount() string {
|
|
return u.Account
|
|
}
|
|
func (u *User) GetUserId() string {
|
|
return u.Id
|
|
}
|
|
|
|
func (u *User) GetUserInfo() any {
|
|
return *u
|
|
}
|