Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = sqlx.ErrNotFound
Functions ¶
This section is empty.
Types ¶
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 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.
Click to show internal directories.
Click to hide internal directories.