ware

package
v0.0.0-...-eb64f0e Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Service *serviceProvider
)

Functions

This section is empty.

Types

type BriefInfo

type BriefInfo struct {
	ID        uint32  `json:"id"`
	Name      string  `json:"name"`
	TotalSale uint32  `json:"total_sale"`
	Inventory uint32  `json:"inventory"`
	Status    int8    `json:"status"`
	Price     float32 `json:"price"`
	SalePrice float32 `json:"sale_price"`
	Avatar    string  `json:"avatar"`
}

BriefInfo represents the wares display

type Ware

type Ware struct {
	ID               uint32    `gorm:"column:id;primary_key;AUTO_INCREMENT" json:"id"`
	Name             string    `gorm:"column:name;type:varchar(50);not null" json:"name" validate:"required,alphanumunicode,max=20"`
	Desc             string    `gorm:"column:desc;type:varchar(100);not null" json:"desc" validate:"alphanumunicode,max=50"`
	ParentCategoryID uint32    `gorm:"column:parentcategoryid;not null" json:"parent_category_id"`
	CategoryID       uint32    `gorm:"column:categoryid;not null" json:"category_id"`
	TotalSale        uint32    `gorm:"column:totalsale;not null" json:"total_sale"`
	Inventory        uint32    `gorm:"column:inventory;not null" json:"inventory"`
	Status           int8      `gorm:"column:status;not null;type:TINYINT;default:1" json:"status"` // -1, hide or delete;1, common wares;2, promotion;3, new wares;4, recommend wares
	Price            float32   `gorm:"column:price;not null;type:float" json:"price"`
	SalePrice        float32   `gorm:"column:saleprice;not null;type:float" json:"sale_price"` // promotion price
	Avatar           string    `gorm:"column:avatar;not null;type:varchar(128)" json:"avatar"`
	Image            string    `gorm:"column:image;type:varchar(128)" json:"image"`
	DetailPic        string    `gorm:"column:detailpic;type:varchar(128)" json:"detail_pic"`
	CreatedAt        time.Time `gorm:"column:createdat" json:"createdAt"`
}

Ware represents the ware information

Jump to

Keyboard shortcuts

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