Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CartAddCmd ¶
增加购物车聚合根
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 ¶
购物车项查询聚合根
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 ¶
购买商品聚合根
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 加载依赖实体
Click to show internal directories.
Click to hide internal directories.