model

package
v0.0.0-...-d152970 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const TableNameBook = "book"
View Source
const TableNameUser = "user"

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	ID        uint64                `gorm:"column:id;primaryKey;autoIncrement:true;comment:id" json:"id"`
	UID       string                `gorm:"column:uid;not null;comment:uid" json:"uid"`
	Title     string                `gorm:"column:title;not null;comment:title" json:"title"`
	Author    string                `gorm:"column:author;not null;comment:author" json:"author"`
	Pages     int                   `gorm:"column:pages;not null;comment:page num of book" json:"pages"`
	Extra     string                `gorm:"column:extra;not null;comment:extra info of book" json:"extra"`
	CreatedAt *time.Time            `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP;autoCreateTime;comment:created time" json:"created_at"`
	UpdatedAt *time.Time            `gorm:"column:updated_at;not null;default:CURRENT_TIMESTAMP;autoUpdateTime;comment:updated time" json:"updated_at"`
	DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;not null;comment:deleted time;softDelete:milli" json:"deleted_at"`
}

Book mapped from table <book>

func (*Book) TableName

func (*Book) TableName() string

TableName Book's table name

type User

type User struct {
	ID        uint64                `gorm:"column:id;primaryKey;autoIncrement:true;comment:id" json:"id"`
	UID       string                `gorm:"column:uid;not null;comment:uid" json:"uid"`
	Email     string                `gorm:"column:email;not null;comment:email" json:"email"`
	Password  string                `gorm:"column:password;not null;comment:password" json:"password"`
	Nickname  string                `gorm:"column:nickname;not null;comment:nickname" json:"nickname"`
	CreatedAt *time.Time            `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP;autoCreateTime;comment:created time" json:"created_at"`
	UpdatedAt *time.Time            `gorm:"column:updated_at;not null;default:CURRENT_TIMESTAMP;autoUpdateTime;comment:updated time" json:"updated_at"`
	DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;not null;comment:deleted time;softDelete:milli" json:"deleted_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