26 lines
631 B
Go
26 lines
631 B
Go
package model
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type (
|
|
User struct {
|
|
gorm.Model `json:"meta"`
|
|
ID uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid();primarykey"`
|
|
APIUser
|
|
Position Position `gorm:"-:migration"`
|
|
Avatar string `json:"avatar"`
|
|
}
|
|
)
|
|
|
|
type APIUser struct {
|
|
UserName string `json:"user_name" gorm:"unique;index"`
|
|
Password string `json:"password,omitempty"`
|
|
FirstName string `json:"first_name"`
|
|
LastName string `json:"last_name"`
|
|
Role string `json:"role" gorm:"default:employee"`
|
|
PositionID uuid.UUID `json:"position_id,omitempty"`
|
|
}
|