product

package
v0.0.0-...-31a4987 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Order

type Order struct {
	By []string // 排序
}

type Pagination

type Pagination struct {
	Size    int `json:"size"`    // 每页多少条
	Current int `json:"current"` // 当前多少页
}

type Product

type Product struct {
	ID          uint64              `json:"id" gorm:"primaryKey"`
	Title       string              `json:"title" gorm:"index;comment:标题"`             // 产品标题
	SubTitle    string              `json:"sub_title" gorm:"comment:副标题"`              // 产品简介
	Thumbnail   string              `json:"thumbnail" gorm:"comment:缩略图"`              // 标题缩略图
	Pictures    datatypes.JSON      `json:"pictures" gorm:"type:JSON;comment:产品图片"`    // 产品图片
	CatalogueID int                 `json:"catalogue_id" gorm:"comment:分类ID"`          // 分类id
	Description string              `json:"description" gorm:"comment:产品描述"`           // 产品详细描述
	Sort        uint8               `json:"sort" gorm:"comment:产品排序"`                  // 顺序
	Status      uint                `json:"status" gorm:"index;comment:产品状态0正常1下架2售罄"` // 状态 0 开启 1 下架 2 售罄
	CreatedAt   time.Time           `json:"created_at" gorm:"comment:创建时间"`
	Catalogue   catalogue.Catalogue `json:"catalogue"`
}

func (*Product) Create

func (p *Product) Create() error

func (*Product) Update

func (p *Product) Update() error

type ProductListResponse

type ProductListResponse struct {
	Pagination
	Result []Product `json:"result"`
}

func List

type ProductSearchQuery

type ProductSearchQuery struct {
	Pagination
	Order
	Title        string
	Price_gt     int
	Price_lt     int
	Catalogue_ID uint64
}

Jump to

Keyboard shortcuts

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