aggregate

package
v1.6.9 Latest Latest
Warning

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

Go to latest
Published: May 23, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CartAddCmd

type CartAddCmd struct {
	entity.User
	// contains filtered or unexported fields
}

添加购物车聚合根

func NewCartAddCmd

func NewCartAddCmd(userRepo repository.UserRepo, cartRepo repository.CartRepo, goodsRepo repository.GoodsRepo) *CartAddCmd

NewCartAddCmd 创建添加购物车聚合根,传入相关仓库的接口

func (*CartAddCmd) LoadEntity

func (cmd *CartAddCmd) LoadEntity(goodsId, userId int) error

LoadEntity 加载依赖实体

func (*CartAddCmd) Run

func (cmd *CartAddCmd) Run(goodsNum int) error

type CartItemQuery

type CartItemQuery struct {
	entity.User
	// contains filtered or unexported fields
}

购物车项查询聚合根

func NewCartItemQuery

func NewCartItemQuery(userRepo repository.UserRepo, cartRepo repository.CartRepo, goodsRepo repository.GoodsRepo) *CartItemQuery

CartItemQuery 购物车项查询聚合根,传入相关仓库的接口

func (*CartItemQuery) AllItemTotalPrice

func (query *CartItemQuery) AllItemTotalPrice() (totalPrice int)

AllItemTotalPrice 全部商品总价

func (*CartItemQuery) LoadEntity

func (query *CartItemQuery) LoadEntity(userId int) error

LoadEntity 加载依赖实体

func (*CartItemQuery) QueryAllItem

func (query *CartItemQuery) QueryAllItem() (e error)

QueryAllItem 查询购物车内全部商品

func (*CartItemQuery) VisitAllItem

func (query *CartItemQuery) VisitAllItem(f func(id, goodsId int, goodsName string, goodsNum, totalPrice int))

VisitAllItem 读取全部商品

type DeliveryCmd added in v1.6.5

type DeliveryCmd struct {
	entity.Order
	// contains filtered or unexported fields
}

订单发货聚合根

func NewDeliveryCmd added in v1.6.5

func NewDeliveryCmd(adminRepo repository.AdminRepo, orderRepo repository.OrderRepo, deliveryRepo repository.DeliveryRepo, tx transaction.Transaction) *DeliveryCmd

NewDeliveryCmd 订单发货聚合根,传入相关仓库的接口

func (*DeliveryCmd) LoadEntity added in v1.6.5

func (cmd *DeliveryCmd) LoadEntity(orderNo string, adminId int) error

LoadEntity 加载依赖实体

func (*DeliveryCmd) Run added in v1.6.5

func (cmd *DeliveryCmd) Run(trackingNumber string) error

Run .

type OrderPayCmd added in v1.6.1

type OrderPayCmd struct {
	entity.Order
	// contains filtered or unexported fields
}

支付订单聚合根

func NewOrderPayCmd added in v1.6.1

func NewOrderPayCmd(userRepo repository.UserRepo, orderRepo repository.OrderRepo, tx transaction.Transaction) *OrderPayCmd

NewOrderPayCmd 订单支付聚合根,传入相关仓库的接口

func (*OrderPayCmd) LoadEntity added in v1.6.1

func (cmd *OrderPayCmd) LoadEntity(orderNo string, userId int) error

LoadEntity 加载依赖实体

func (*OrderPayCmd) Pay added in v1.6.1

func (cmd *OrderPayCmd) Pay() error

Pay 支付.

type ShopCartGoodsCmd added in v1.6.1

type ShopCartGoodsCmd struct {
	entity.Order
	// contains filtered or unexported fields
}

购买商品聚合根

func NewShopCartGoodsCmd added in v1.6.1

func NewShopCartGoodsCmd(userRepo repository.UserRepo, orderRepo repository.OrderRepo, goodsRepo repository.GoodsRepo, cartRepo repository.CartRepo, tx transaction.Transaction) *ShopCartGoodsCmd

NewShopCartGoodsCmd 创建购物车购买商品聚合根,传入相关仓库的接口

func (*ShopCartGoodsCmd) LoadEntity added in v1.6.1

func (cmd *ShopCartGoodsCmd) LoadEntity(userId int) error

LoadEntity 加载依赖实体

func (*ShopCartGoodsCmd) Shop added in v1.6.1

func (cmd *ShopCartGoodsCmd) Shop() error

Shop 购买

type ShopGoodsCmd

type ShopGoodsCmd struct {
	entity.Order
	// contains filtered or unexported fields
}

购买商品聚合根

func NewShopGoodsCmd

func NewShopGoodsCmd(userRepo repository.UserRepo, orderRepo repository.OrderRepo, goodsRepo repository.GoodsRepo, tx transaction.Transaction) *ShopGoodsCmd

NewShopGoodsCmd 创建购买商品聚合根,传入相关仓库的接口

func (*ShopGoodsCmd) LoadEntity

func (cmd *ShopGoodsCmd) LoadEntity(goodsId, userId int) error

LoadEntity 加载依赖实体

func (*ShopGoodsCmd) Shop

func (cmd *ShopGoodsCmd) Shop(goodsNum int) error

Shop 购买

Jump to

Keyboard shortcuts

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