Documentation ¶
Index ¶
- func CreateGoods(rep freedom.GORMRepository, entity *Goods) (rowsAffected int64, e error)
- func CreateOrder(rep freedom.GORMRepository, entity *Order) (rowsAffected int64, e error)
- func FindByWhereToUpdateGoodss(rep freedom.GORMRepository, query string, args []interface{}, ...) (affected int64, e error)
- func FindByWhereToUpdateOrders(rep freedom.GORMRepository, query string, args []interface{}, ...) (affected int64, e error)
- func FindToUpdateGoodss(rep freedom.GORMRepository, query Goods, values map[string]interface{}, ...) (affected int64, e error)
- func FindToUpdateOrders(rep freedom.GORMRepository, query Order, values map[string]interface{}, ...) (affected int64, e error)
- type Goods
- func FindGoods(rep freedom.GORMRepository, query Goods, builders ...freedom.QueryBuilder) (result Goods, e error)
- func FindGoodsByPrimary(rep freedom.GORMRepository, primary interface{}) (result Goods, e error)
- func FindGoodsByWhere(rep freedom.GORMRepository, query string, args []interface{}, ...) (result Goods, e error)
- func FindGoodss(rep freedom.GORMRepository, query Goods, builders ...freedom.QueryBuilder) (results []Goods, e error)
- func FindGoodssByPrimarys(rep freedom.GORMRepository, primarys ...interface{}) (results []Goods, e error)
- func FindGoodssByWhere(rep freedom.GORMRepository, query string, args []interface{}, ...) (results []Goods, e error)
- func (obj *Goods) SetCreated(created time.Time)
- func (obj *Goods) SetID(iD int)
- func (obj *Goods) SetName(name string)
- func (obj *Goods) SetPrice(price int)
- func (obj *Goods) SetStock(stock int)
- func (obj *Goods) SetUpdated(updated time.Time)
- func (obj *Goods) TableName() string
- func (obj *Goods) Updates(rep freedom.GORMRepository) (affected int64, e error)
- type GoodsRep
- type Order
- func FindOrder(rep freedom.GORMRepository, query Order, builders ...freedom.QueryBuilder) (result Order, e error)
- func FindOrderByPrimary(rep freedom.GORMRepository, primary interface{}) (result Order, e error)
- func FindOrderByWhere(rep freedom.GORMRepository, query string, args []interface{}, ...) (result Order, e error)
- func FindOrders(rep freedom.GORMRepository, query Order, builders ...freedom.QueryBuilder) (results []Order, e error)
- func FindOrdersByPrimarys(rep freedom.GORMRepository, primarys ...interface{}) (results []Order, e error)
- func FindOrdersByWhere(rep freedom.GORMRepository, query string, args []interface{}, ...) (results []Order, e error)
- func (obj *Order) SetCreated(created time.Time)
- func (obj *Order) SetGoodsID(goodsID int)
- func (obj *Order) SetID(iD int)
- func (obj *Order) SetNum(num int)
- func (obj *Order) SetUpdated(updated time.Time)
- func (obj *Order) SetUserID(userID int)
- func (obj *Order) TableName() string
- func (obj *Order) Updates(rep freedom.GORMRepository) (affected int64, e error)
- type OrderRep
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
SetCreated .
func (*Goods) SetUpdated ¶ added in v1.3.3
SetUpdated .
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
SetCreated .
func (*Order) SetUpdated ¶ added in v1.3.3
SetUpdated .
Click to show internal directories.
Click to hide internal directories.