model

package
v0.0.0-...-9365a73 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: BSD-2-Clause 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 Category

type Category struct {
	Id         int64     `db:"id"`          // 分类id
	Parentid   int64     `db:"parentid"`    // 父类别id当id=0时说明是根节点,一级类别
	Name       string    `db:"name"`        // 类别名称
	Status     int64     `db:"status"`      // 类别状态1-正常,2-已废弃
	CreateTime time.Time `db:"create_time"` // 创建时间
	UpdateTime time.Time `db:"update_time"` // 更新时间
}

type CategoryModel

type CategoryModel interface {
	// contains filtered or unexported methods
}

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

func NewCategoryModel

func NewCategoryModel(conn sqlx.SqlConn, c cache.CacheConf) CategoryModel

NewCategoryModel returns a model for the database table.

type Product

type Product struct {
	Id         int64          `db:"id"`          // 商品id
	Cateid     int64          `db:"cateid"`      // 类别Id
	Name       string         `db:"name"`        // 商品名称
	Subtitle   string         `db:"subtitle"`    // 商品副标题
	Images     sql.NullString `db:"images"`      // 图片地址,json格式,扩展用
	Detail     sql.NullString `db:"detail"`      // 商品详情
	Price      float64        `db:"price"`       // 价格,单位-元保留两位小数
	Stock      int64          `db:"stock"`       // 库存数量
	Status     int64          `db:"status"`      // 商品状态.1-在售 2-下架 3-删除
	CreateTime time.Time      `db:"create_time"` // 创建时间
	UpdateTime time.Time      `db:"update_time"` // 更新时间
}

type ProductModel

type ProductModel interface {
	CategoryProducts(ctx context.Context, ctime string, cateid, limit int64) ([]*Product, error)
	UpdateProductStock(ctx context.Context, pid, num int64) 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.

type ProductOperation

type ProductOperation struct {
	Id         int64     `db:"id"`          // 商品运营id
	ProductId  int64     `db:"product_id"`  // 商品id
	Status     int64     `db:"status"`      // 运营商品状态 0-下线 1-上线
	CreateTime time.Time `db:"create_time"` // 创建时间
	UpdateTime time.Time `db:"update_time"` // 更新时间
}

type ProductOperationModel

type ProductOperationModel interface {
	// contains filtered or unexported methods
}

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

func NewProductOperationModel

func NewProductOperationModel(conn sqlx.SqlConn, c cache.CacheConf) ProductOperationModel

NewProductOperationModel 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