heritage-api/model/user-model.go

10 lines
397 B
Go

package model
type User struct {
ID string `json:"id" gorm:"type:varchar(32);primaryKey"`
UserName string `json:"userName" gorm:"type:varchar(20);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"`
}