objects

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGoods

func CreateGoods(rep freedom.GORMRepository, entity *Goods) (rowsAffected int64, e error)

CreateGoods .

func CreateOrder

func CreateOrder(rep freedom.GORMRepository, entity *Order) (rowsAffected int64, e error)

CreateOrder .

func FindByWhereToUpdateGoodss

func FindByWhereToUpdateGoodss(rep freedom.GORMRepository, query string, args []interface{}, values map[string]interface{}, builders ...freedom.QueryBuilder) (affected int64, e error)

FindByWhereToUpdateGoodss .

func FindByWhereToUpdateOrders

func FindByWhereToUpdateOrders(rep freedom.GORMRepository, query string, args []interface{}, values map[string]interface{}, builders ...freedom.QueryBuilder) (affected int64, e error)

FindByWhereToUpdateOrders .

func FindToUpdateGoodss

func FindToUpdateGoodss(rep freedom.GORMRepository, query Goods, values map[string]interface{}, builders ...freedom.QueryBuilder) (affected int64, e error)

FindToUpdateGoodss .

func FindToUpdateOrders

func FindToUpdateOrders(rep freedom.GORMRepository, query Order, values map[string]interface{}, builders ...freedom.QueryBuilder) (affected int64, e error)

FindToUpdateOrders .

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 FindGoods

func FindGoods(rep freedom.GORMRepository, query Goods, builders ...freedom.QueryBuilder) (result Goods, e error)

FindGoods .

func FindGoodsByPrimary

func FindGoodsByPrimary(rep freedom.GORMRepository, primary interface{}) (result Goods, e error)

FindGoodsByPrimary .

func FindGoodsByWhere

func FindGoodsByWhere(rep freedom.GORMRepository, query string, args []interface{}, builders ...freedom.QueryBuilder) (result Goods, e error)

FindGoodsByWhere .

func FindGoodss

func FindGoodss(rep freedom.GORMRepository, query Goods, builders ...freedom.QueryBuilder) (results []Goods, e error)

FindGoodss .

func FindGoodssByPrimarys

func FindGoodssByPrimarys(rep freedom.GORMRepository, primarys ...interface{}) (results []Goods, e error)

FindGoodssByPrimarys .

func FindGoodssByWhere

func FindGoodssByWhere(rep freedom.GORMRepository, query string, args []interface{}, builders ...freedom.QueryBuilder) (results []Goods, e error)

FindGoodssByWhere .

func (*Goods) SetCreated added in v1.3.3

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

SetCreated .

func (*Goods) SetID added in v1.3.3

func (obj *Goods) SetID(iD int)

SetID .

func (*Goods) SetName added in v1.3.3

func (obj *Goods) SetName(name string)

SetName .

func (*Goods) SetPrice added in v1.3.3

func (obj *Goods) SetPrice(price int)

SetPrice .

func (*Goods) SetStock added in v1.3.3

func (obj *Goods) SetStock(stock int)

SetStock .

func (*Goods) SetUpdated added in v1.3.3

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

SetUpdated .

func (*Goods) TableName

func (obj *Goods) TableName() string

func (*Goods) Updates added in v1.3.3

func (obj *Goods) Updates(rep freedom.GORMRepository) (affected int64, e error)

Updates .

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 FindOrder

func FindOrder(rep freedom.GORMRepository, query Order, builders ...freedom.QueryBuilder) (result Order, e error)

FindOrder .

func FindOrderByPrimary

func FindOrderByPrimary(rep freedom.GORMRepository, primary interface{}) (result Order, e error)

FindOrderByPrimary .

func FindOrderByWhere

func FindOrderByWhere(rep freedom.GORMRepository, query string, args []interface{}, builders ...freedom.QueryBuilder) (result Order, e error)

FindOrderByWhere .

func FindOrders

func FindOrders(rep freedom.GORMRepository, query Order, builders ...freedom.QueryBuilder) (results []Order, e error)

FindOrders .

func FindOrdersByPrimarys

func FindOrdersByPrimarys(rep freedom.GORMRepository, primarys ...interface{}) (results []Order, e error)

FindOrdersByPrimarys .

func FindOrdersByWhere

func FindOrdersByWhere(rep freedom.GORMRepository, query string, args []interface{}, builders ...freedom.QueryBuilder) (results []Order, e error)

FindOrdersByWhere .

func (*Order) SetCreated added in v1.3.3

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

SetCreated .

func (*Order) SetGoodsID added in v1.3.3

func (obj *Order) SetGoodsID(goodsID int)

SetGoodsID .

func (*Order) SetID added in v1.3.3

func (obj *Order) SetID(iD int)

SetID .

func (*Order) SetNum added in v1.3.3

func (obj *Order) SetNum(num int)

SetNum .

func (*Order) SetUpdated added in v1.3.3

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

SetUpdated .

func (*Order) SetUserID added in v1.3.3

func (obj *Order) SetUserID(userID int)

SetUserID .

func (*Order) TableName

func (obj *Order) TableName() string

func (*Order) Updates added in v1.3.3

func (obj *Order) Updates(rep freedom.GORMRepository) (affected int64, e error)

Updates .

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