updates
This commit is contained in:
25
server/internal/models/user.go
Executable file
25
server/internal/models/user.go
Executable file
@@ -0,0 +1,25 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type PlatformRole string
|
||||
|
||||
const (
|
||||
PlatformRoleUser PlatformRole = "USER"
|
||||
PlatformRoleAdmin PlatformRole = "ADMIN"
|
||||
)
|
||||
|
||||
func (User) TableName() string {
|
||||
return "users"
|
||||
}
|
||||
|
||||
type User struct {
|
||||
ID []byte `gorm:"primaryKey;type:bytea" json:"id" db:"id"`
|
||||
CreatedAt time.Time `json:"createdAt" db:"created_at"`
|
||||
UpdatedAt time.Time `json:"updatedAt" db:"updated_at"`
|
||||
FirstName string `json:"firstName" db:"first_name"`
|
||||
LastName string `json:"lastName" db:"last_name"`
|
||||
Email string `gorm:"uniqueIndex;not null" json:"email" db:"email"`
|
||||
Password string `gorm:"not null" json:"password" db:"password"`
|
||||
PlatformRole PlatformRole `gorm:"not null" json:"platformRole" db:"platform_role"`
|
||||
}
|
||||
Reference in New Issue
Block a user