Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CartAddCmd ¶
CartAddCmd 添加购物车聚合根
type CartFactory ¶ added in v1.7.11
type CartFactory struct { UserRepo dependency.UserRepo //依赖倒置用户资源库 CartRepo dependency.CartRepo //依赖倒置购物车资源库 GoodsRepo dependency.GoodsRepo //依赖倒置商品资源库 OrderRepo dependency.OrderRepo //依赖倒置订单资源库 }
CartFactory 购物车聚合根工厂
func (*CartFactory) NewCartAddCmd ¶ added in v1.7.11
func (factory *CartFactory) NewCartAddCmd(goodsID, userID int) (*CartAddCmd, error)
NewCartAddCmd 创建添加聚合根
func (*CartFactory) NewCartItemQuery ¶ added in v1.7.11
func (factory *CartFactory) NewCartItemQuery(userID int) (*CartItemQuery, error)
NewCartItemQuery 创建查询聚合根
type CartItemQuery ¶
CartItemQuery 购物车项查询聚合根
func (*CartItemQuery) AllItemTotalPrice ¶
func (query *CartItemQuery) AllItemTotalPrice() (totalPrice int)
AllItemTotalPrice 全部商品总价
func (*CartItemQuery) VisitAllItem ¶
func (query *CartItemQuery) VisitAllItem(f func(id, goodsId int, goodsName string, goodsNum, totalPrice int))
VisitAllItem 读取全部商品
type CartShopCmd ¶ added in v1.7.11
CartShopCmd 购买商品聚合根
type DeliveryCmd ¶
DeliveryCmd 订单发货聚合根
type GoodsShopCmd ¶ added in v1.7.11
GoodsShopCmd 购买商品聚合根
type OrderFactory ¶ added in v1.7.11
type OrderFactory struct { UserRepo dependency.UserRepo //依赖倒置用户资源库 OrderRepo dependency.OrderRepo //依赖倒置订单资源库 AdminRepo dependency.AdminRepo //依赖倒置管理员资源库 DeliveryRepo dependency.DeliveryRepo //依赖倒置物流资源库 TX *domainevent.EventTransaction //依赖倒置事务组件 Worker freedom.Worker //运行时,一个请求绑定一个运行时 }
OrderFactory 订单聚合根工厂
func (*OrderFactory) NewOrderDeliveryCmd ¶ added in v1.7.11
func (factory *OrderFactory) NewOrderDeliveryCmd(orderNo string, adminID int) (*DeliveryCmd, error)
NewOrderDeliveryCmd 创建订单发货聚合根
func (*OrderFactory) NewOrderPayCmd ¶ added in v1.7.11
func (factory *OrderFactory) NewOrderPayCmd(orderNo string, userID int) (*OrderPayCmd, error)
NewOrderPayCmd 创建订单支付聚合根
type OrderPayCmd ¶
OrderPayCmd 支付订单聚合根
type ShopFactory ¶ added in v1.7.11
type ShopFactory struct { UserRepo dependency.UserRepo //依赖倒置用户资源库 CartRepo dependency.CartRepo //依赖倒置购物车资源库 GoodsRepo dependency.GoodsRepo //依赖倒置商品资源库 OrderRepo dependency.OrderRepo //依赖倒置订单资源库 TX *domainevent.EventTransaction //依赖倒置事务组件 }
ShopFactory 购买聚合根抽象工厂
func (*ShopFactory) NewCartShopType ¶ added in v1.7.11
func (factory *ShopFactory) NewCartShopType() ShopType
NewCartShopType 创建购物车购买类型
func (*ShopFactory) NewGoodsShopType ¶ added in v1.7.11
func (factory *ShopFactory) NewGoodsShopType(goodsID, goodsNum int) ShopType
NewGoodsShopType 创建商品购买类型
func (*ShopFactory) NewShopCmd ¶ added in v1.7.11
func (factory *ShopFactory) NewShopCmd(userID int, stype ShopType) (ShopCmd, error)
NewShopCmd 创建抽象聚合根
Click to show internal directories.
Click to hide internal directories.