Documentation ¶
Index ¶
- func GetWithGreaterCreateTime(time int64) func(db *gorm.DB) *gorm.DB
- func GetWithId(id int64) func(db *gorm.DB) *gorm.DB
- func GetWithLessThanCreateTime(time int64) func(db *gorm.DB) *gorm.DB
- func GetWithOnSale(state ProductState) func(db *gorm.DB) *gorm.DB
- type Product
- type ProductSku
- type ProductState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetWithOnSale ¶
func GetWithOnSale(state ProductState) func(db *gorm.DB) *gorm.DB
Types ¶
type Product ¶
type Product struct { Id int64 `gorm:"column:id" json:"id"` Title string `gorm:"column:title" json:"title"` Description string `gorm:"column:description" json:"description"` Image string `gorm:"column:image" json:"image"` OnSale uint32 `gorm:"column:on_sale" json:"onSale"` SoldCount uint32 `gorm:"column:sold_count" json:"soldCount"` Price uint32 `gorm:"column:price" json:"price"` CreatedAt int64 `gorm:"column:created_at;autoCreatedAt" json:"createdAt"` UpdatedAt int64 `gorm:"column:updated_at;autoUpdatedAt" json:"updatedAt"` Skus []ProductSku `gorm:"foreignKey:product_id"` }
type ProductSku ¶
type ProductSku struct { Id uint64 `gorm:"column:id" json:"id"` Title string `gorm:"column:title" json:"title"` Price uint32 `gorm:"column:price" json:"price"` Stock uint32 `gorm:"column:stock" json:"stock"` ProductId uint64 `gorm:"column:product_id" json:"productId"` CreatedAt int64 `gorm:"column:created_at;autoCreatedAt" json:"createdAt"` UpdatedAt int64 `gorm:"column:updated_at;autoUpdatedAt" json:"updatedAt"` }
func (ProductSku) TableName ¶
func (ProductSku) TableName() string
type ProductState ¶
type ProductState uint32
const ( ProductInSale ProductState = iota + 1 ProductNotSale )
Click to show internal directories.
Click to hide internal directories.