objects

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Goods

type Goods struct {
	ID      int       `gorm:"primary_key" column:"id"`
	Name    string    `gorm:"column:name"`  // 商品名称
	Price   int       `gorm:"column:price"` // 价格
	Stock   int       `gorm:"column:stock"` // 库存
	Created time.Time `gorm:"column:created"`
	Updated time.Time `gorm:"column:updated"`
	// contains filtered or unexported fields
}

Goods .

func (*Goods) Save

func (obj *Goods) Save() map[string]interface{}

Save .

func (*Goods) SetCreated

func (obj *Goods) SetCreated(created time.Time)

SetCreated .

func (*Goods) SetID

func (obj *Goods) SetID(iD int)

SetID .

func (*Goods) SetName

func (obj *Goods) SetName(name string)

SetName .

func (*Goods) SetPrice

func (obj *Goods) SetPrice(price int)

SetPrice .

func (*Goods) SetStock

func (obj *Goods) SetStock(stock int)

SetStock .

func (*Goods) SetUpdated

func (obj *Goods) SetUpdated(updated time.Time)

SetUpdated .

func (*Goods) TableName

func (obj *Goods) TableName() string

type GoodsRep

type GoodsRep struct {
	ID    int    `json:"id"`
	Name  string `json:"name"`  // 商品名称
	Price int    `json:"price"` // 价格
	Stock int    `json:"stock"` // 库存
}

type Order

type Order struct {
	ID      int       `gorm:"primary_key" column:"id"`
	UserID  int       `gorm:"column:user_id"`  // 用户id
	GoodsID int       `gorm:"column:goods_id"` // 商品id
	Num     int       `gorm:"column:num"`      // 数量
	Created time.Time `gorm:"column:created"`
	Updated time.Time `gorm:"column:updated"`
	// contains filtered or unexported fields
}

Order .

func (*Order) Save

func (obj *Order) Save() map[string]interface{}

Save .

func (*Order) SetCreated

func (obj *Order) SetCreated(created time.Time)

SetCreated .

func (*Order) SetGoodsID

func (obj *Order) SetGoodsID(goodsID int)

SetGoodsID .

func (*Order) SetID

func (obj *Order) SetID(iD int)

SetID .

func (*Order) SetNum

func (obj *Order) SetNum(num int)

SetNum .

func (*Order) SetUpdated

func (obj *Order) SetUpdated(updated time.Time)

SetUpdated .

func (*Order) SetUserID

func (obj *Order) SetUserID(userID int)

SetUserID .

func (*Order) TableName

func (obj *Order) TableName() string

type OrderRep

type OrderRep struct {
	ID        int    `json:"id"`        //订单ID
	GoodsID   int    `json:"goodsId"`   // 商品ID
	GoodsName string `json:"goodsName"` // 商品名称
	Num       int    `json:"num"`       // 数量
	DateTime  string `json:"datetime"`  // 购买时间
}

Jump to

Keyboard shortcuts

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