13 lines
624 B
Go
13 lines
624 B
Go
package model
|
|
|
|
type User struct {
|
|
ID string `json:"id" gorm:"type:varchar(32);primaryKey"`
|
|
Avatar string `json:"avatar" gorm:"type:varchar(255);not null;default:''"`
|
|
UserName string `json:"userName" gorm:"type:varchar(20);not null"`
|
|
Mobile string `json:"mobile" gorm:"type:varchar(11);not null;uniqueIndex"`
|
|
PasswordHash string `json:"-" gorm:"type:varchar(128);default:''"`
|
|
RoleID string `json:"roleId" gorm:"type:varchar(32);index"`
|
|
Role Role `json:"role" gorm:"foreignKey:RoleID;references:ID"`
|
|
OrgID string `json:"orgId" gorm:"type:varchar(32);not null;index"`
|
|
}
|