aggregate

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 License: Apache-2.0 Imports: 6 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 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