models

package
v0.0.0-...-73db963 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	ID           uuid.UUID `json:"id" gorm:"primarykey"`
	UserID       int       `json:"user_id"`
	RefreshToken string    `gorm:"size:2048" json:"refresh_token"`
	PlatformID   int       `gorm:"not null" json:"platform_id"`
	IsBlocked    bool      `gorm:"not null;default:false" json:"is_blocked"`
	ExpiresAt    time.Time `gorm:"not null" json:"expires_at"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

func (*Token) TableName

func (t *Token) TableName() string

type User

type User struct {
	ID       int        `json:"id" gorm:"primarykey"`
	Name     string     `json:"name" gorm:"not null"`
	Email    string     `json:"email" gorm:"unique;not null"`
	Password string     `json:"password" gorm:"not null"`
	Status   UserStatus `json:"status"`

	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"`
}

func (*User) TableName

func (u *User) TableName() string

type UserStatus

type UserStatus string
const (
	UserStatusPending UserStatus = "pending"
	UserStatusActive  UserStatus = "active"
)

Jump to

Keyboard shortcuts

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