model

package
v0.0.0-...-6cb28ed Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const TableNameOrderTable = "order_table"
View Source
const TableNameProduct = "product"
View Source
const TableNameUser = "user"

Variables

This section is empty.

Functions

This section is empty.

Types

type OrderTable

type OrderTable struct {
	OrderID     int64 `gorm:"column:order_id;type:int;primaryKey;autoIncrement:true;comment:订单ID" json:"order_id"` // 订单ID
	UserID      int64 `gorm:"column:user_id;type:int;not null;comment:用户ID" json:"user_id"`                        // 用户ID
	ProductID   int64 `gorm:"column:product_id;type:int;not null;comment:商品ID" json:"product_id"`                  // 商品ID
	OrderTime   int64 `gorm:"column:order_time;type:int;not null;comment:下单时间" json:"order_time"`                  // 下单时间
	OrderStatus int64 `gorm:"column:order_status;type:int;not null;comment:订单状态" json:"order_status"`              // 订单状态
	OrderAmount int64 `gorm:"column:order_amount;type:int;not null;comment:下单数量" json:"order_amount"`              // 下单数量
}

OrderTable mapped from table <order_table>

func (*OrderTable) TableName

func (*OrderTable) TableName() string

TableName OrderTable's table name

type Product

type Product struct {
	ProductID     int64  `gorm:"column:product_id;type:int;primaryKey;autoIncrement:true;comment:商品ID" json:"product_id"` // 商品ID
	ProductName   string `gorm:"column:product_name;type:varchar(100);not null;comment:商品名称" json:"product_name"`         // 商品名称
	StockQuantity int64  `gorm:"column:stock_quantity;type:int;not null;comment:库存量" json:"stock_quantity"`               // 库存量
	Version       int64  `gorm:"column:version;type:int;not null;comment:版本号" json:"version"`                             // 版本号
}

Product mapped from table <product>

func (*Product) TableName

func (*Product) TableName() string

TableName Product's table name

type User

type User struct {
	UserID   int64  `gorm:"column:user_id;type:int;primaryKey;autoIncrement:true;comment:用户ID" json:"user_id"` // 用户ID
	UserName string `gorm:"column:user_name;type:varchar(50);not null;comment:用户名" json:"user_name"`           // 用户名
	Password string `gorm:"column:password;type:varchar(100);not null;comment:密码" json:"password"`             // 密码
	Email    string `gorm:"column:email;type:varchar(100);not null;comment:邮箱" json:"email"`                   // 邮箱
}

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