models

package
v0.0.0-...-477ec14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	ID   string `json:"id"`
	Role string `json:"role"`
	jwt.RegisteredClaims
}

type DBModel

type DBModel struct {
	ID        uuid.UUID       `gorm:"primaryKey;type:uuid" json:"id"`
	CreatedAt time.Time       `json:"created_at"`
	UpdatedAt *time.Time      `json:"updated_at"`
	DeletedAt *gorm.DeletedAt `json:"deleted_at"`
}

func (*DBModel) BeforeCreate

func (d *DBModel) BeforeCreate(tx *gorm.DB) (err error)

type User

type User struct {
	DBModel
	FirstName   string  `gorm:"size:255" json:"first_name"`
	LastName    string  `gorm:"size:255" json:"last_name"`
	Email       string  `gorm:"unique" json:"email"`
	Password    string  `json:"password"`
	PhoneNumber *string `gorm:"uniqueIndex;null" json:"phone_number"`
	Role        string  `gorm:"default:user" json:"role"`
	Disabled    bool    `json:"disabled"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL