aggregate

package
v1.8.9 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: Apache-2.0 Imports: 9 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
}

CartAddCmd 添加购物车聚合根

func (*CartAddCmd) Run

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

Run .

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

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

CartItemQuery 购物车项查询聚合根

func (*CartItemQuery) AllItemTotalPrice

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

AllItemTotalPrice 全部商品总价

func (*CartItemQuery) MarshalJSON added in v1.8.7

func (query *CartItemQuery) MarshalJSON() ([]byte, error)

MarshalJSON .

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

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

CartShopCmd 购买商品聚合根

func (*CartShopCmd) Shop added in v1.7.11

func (cmd *CartShopCmd) Shop() error

Shop 购买

type DeliveryCmd

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

DeliveryCmd 订单发货聚合根

func (*DeliveryCmd) Run

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

Run .

type GoodsShopCmd added in v1.7.11

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

GoodsShopCmd 购买商品聚合根

func (*GoodsShopCmd) Shop added in v1.7.11

func (cmd *GoodsShopCmd) Shop() error

Shop 购买

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

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

OrderPayCmd 支付订单聚合根

func (*OrderPayCmd) Pay

func (cmd *OrderPayCmd) Pay() error

Pay 支付.

type ShopCmd added in v1.7.11

type ShopCmd interface {
	Shop() error
}

ShopCmd .

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 创建抽象聚合根

type ShopType added in v1.7.11

type ShopType interface {
	//返回购买的类型 单独商品 或购物车
	GetType() int
	//如果是直接购买类型 返回商品id和数量
	GetDirectGoods() (int, int)
}

ShopType .

Jump to

Keyboard shortcuts

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