models

package
v0.0.0-...-0686fb6 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID        uint      `gorm:"primaryKey" json:"id"`
	Username  string    `gorm:"index;unique;type:varchar(255)" validate:"required" json:"username"`
	Password  string    `gorm:"type:varchar(255)" validate:"required" json:"-"`
	Email     string    `gorm:"index;unique;type:varchar(255)" validate:"required,email" json:"email"`
	CreatedAt time.Time `gorm:"autoCreateTime;<-:create" json:"createdAt"`
	UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updatedAt"`

	Token string `gorm:"-" json:"token,omitempty"`
}

func (*User) BeforeCreate

func (u *User) BeforeCreate(tx *gorm.DB) (err error)

func (*User) BeforeUpdate

func (u *User) BeforeUpdate(tx *gorm.DB) (err error)

func (User) TableName

func (User) TableName() string

Jump to

Keyboard shortcuts

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