model

package
v0.0.0-...-0872ad6 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 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"` // 产品状态
	CreateTime time.Time `db:"create_time"`
	UpdateTime time.Time `db:"update_time"`
}

type ProductModel

type ProductModel interface {
	Insert(ctx context.Context, data *Product) (sql.Result, error)
	FindOne(ctx context.Context, id int64) (*Product, error)
	Update(ctx context.Context, data *Product) error
	Delete(ctx context.Context, id int64) error
}

func NewProductModel

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

Jump to

Keyboard shortcuts

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