14 lines
451 B
Go
14 lines
451 B
Go
package models
|
|
|
|
import "gorm.io/gorm"
|
|
|
|
type User struct {
|
|
gorm.Model `json:"-"`
|
|
Username string `gorm:"unique;not null" binding:"required"`
|
|
Password string `gorm:"not null" json:"-" binding:"required,min=8"`
|
|
Role string `gorm:"default:'customer'" json:"role"`
|
|
FirstName string `json:"first_name" binding:"required"`
|
|
LastName string `gorm:"index" json:"last_name" binding:"required"`
|
|
Phone string `gorm:"index" json:"phone"`
|
|
}
|