model

package
v0.0.0-...-a029906 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const TableNameUser = "user"

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID        int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Name      string    `gorm:"column:name;not null" json:"name"`
	Email     string    `gorm:"column:email;not null" json:"email"`
	Password  string    `gorm:"column:password;not null" json:"password"`
	Phone     *string   `gorm:"column:phone;default:NULL" json:"phone"`
	Avatar    *string   `gorm:"column:avatar;default:NULL" json:"avatar"`
	Bio       *string   `gorm:"column:bio;default:NULL" json:"bio"`
	Location  *string   `gorm:"column:location;default:NULL" json:"location"`
	Website   *string   `gorm:"column:website;default:NULL" json:"website"`
	Role      string    `gorm:"column:role;not null;default:user" json:"role"`
	CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null;default:CURRENT_TIMESTAMP" json:"updated_at"`
}

User mapped from table <user>

func (*User) TableName

func (*User) TableName() string

TableName User's table name

Jump to

Keyboard shortcuts

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