model

package
v0.0.0-...-2304a10 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: Apache-2.0 Imports: 9 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(data *Product) (sql.Result, error)
	FindOne(id int64) (*Product, error)
	Update(data *Product) error
	Delete(id int64) error
	FindAll(page, size int64, search string) ([]*Product, 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