2026-03-12 09:28:19 +00:00
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
type User struct {
|
|
|
|
|
ID string `json:"id" gorm:"type:varchar(32);primaryKey"`
|
2026-03-19 09:35:11 +00:00
|
|
|
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"`
|
2026-03-12 09:28:19 +00:00
|
|
|
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"`
|
2026-03-19 09:35:11 +00:00
|
|
|
OrgID string `json:"orgId" gorm:"type:varchar(32);not null;index"`
|
2026-03-19 14:51:31 +00:00
|
|
|
CreatedAt int64 `json:"createdAt" gorm:"autoCreateTime;"`
|
|
|
|
|
UpdatedAt int64 `json:"updatedAt" gorm:"autoUpdateTime;"`
|
2026-03-12 09:28:19 +00:00
|
|
|
}
|