heritage-api/model/user-model.go

15 lines
750 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"`
CreatedAt int64 `json:"createdAt" gorm:"autoCreateTime;"`
UpdatedAt int64 `json:"updatedAt" gorm:"autoUpdateTime;"`
}