model

package
v0.0.0-...-ec24a78 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = sqlx.ErrNotFound

Functions

This section is empty.

Types

type Product

type Product struct {
	Id         int64     `db:"id"`
	Name       string    `db:"name"`   // 产品名称
	Desc       string    `db:"desc"`   // 产品描述
	Stock      int64     `db:"stock"`  // 产品库存
	Amount     int64     `db:"amount"` // 产品金额
	Status     int64     `db:"status"` // 产品状态 -1已删除
	CreateTime time.Time `db:"create_time"`
	UpdateTime time.Time `db:"update_time"`
}

type ProductModel

type ProductModel interface {
	TxAdjustStock(ctx context.Context, tx *sql.Tx, id int64, delta int) (sql.Result, error)
	// contains filtered or unexported methods
}

ProductModel is an interface to be customized, add more methods here, and implement the added methods in customProductModel.

func NewProductModel

func NewProductModel(conn sqlx.SqlConn, c cache.CacheConf) ProductModel

NewProductModel returns a model for the database table.

Jump to

Keyboard shortcuts

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