Documentation ¶
Index ¶
- type CartService
- type GoodsService
- func (g *GoodsService) AddStock(goodsID, num int) (e error)
- func (g *GoodsService) Get(goodsID int) (entity json.Marshaler, e error)
- func (g *GoodsService) Items(page, pagesize int, tag string) (items []vo.GoodsItemRes, e error)
- func (g *GoodsService) MarkedTag(goodsID int, tag string) (e error)
- func (g *GoodsService) New(name string, price int) (e error)
- func (g *GoodsService) Shop(goodsID, goodsNum, userID int) (e error)
- func (g *GoodsService) ShopEvent(event *event.ShopGoods) (e error)
- type OrderService
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CartService ¶ added in v1.9.3
type CartService struct { Worker freedom.Worker //运行时,一个请求绑定一个运行时 CartRepo dependency.CartRepo //依赖倒置购物车资源库 CartFactory *aggregate.CartFactory //依赖注入购物车聚合根工厂 ShopFactory *aggregate.ShopFactory //依赖注入购买聚合根工厂 }
CartService 领域服务.
func (*CartService) Add ¶ added in v1.9.3
func (c *CartService) Add(userID, goodsID, goodsNum int) (e error)
Add 购物车增加商品
func (*CartService) DeleteAll ¶ added in v1.9.3
func (c *CartService) DeleteAll(userID int) (e error)
DeleteAll 清空购物车
func (*CartService) Items ¶ added in v1.9.3
func (c *CartService) Items(userID int) (json.Marshaler, error)
Items 购物车全部商品项
func (*CartService) Shop ¶ added in v1.9.3
func (c *CartService) Shop(userID int) (e error)
Shop 购物车全部购买
type GoodsService ¶ added in v1.9.3
type GoodsService struct { Worker freedom.Worker //运行时,一个请求绑定一个运行时 GoodsRepo dependency.GoodsRepo //依赖倒置商品资源库 ShopFactory *aggregate.ShopFactory //依赖注入购买聚合根工厂 TX *domainevent.EventTransaction //依赖倒置事务组件 }
GoodsService 商品领域服务.
func (*GoodsService) AddStock ¶ added in v1.9.3
func (g *GoodsService) AddStock(goodsID, num int) (e error)
AddStock 增加商品库存
func (*GoodsService) Get ¶ added in v1.9.3
func (g *GoodsService) Get(goodsID int) (entity json.Marshaler, e error)
Get 获取商品
func (*GoodsService) Items ¶ added in v1.9.3
func (g *GoodsService) Items(page, pagesize int, tag string) (items []vo.GoodsItemRes, e error)
Items 分页商品列表
func (*GoodsService) MarkedTag ¶ added in v1.9.3
func (g *GoodsService) MarkedTag(goodsID int, tag string) (e error)
MarkedTag 商品打tag
func (*GoodsService) New ¶ added in v1.9.3
func (g *GoodsService) New(name string, price int) (e error)
New 创建商品
func (*GoodsService) Shop ¶ added in v1.9.3
func (g *GoodsService) Shop(goodsID, goodsNum, userID int) (e error)
Shop 购买商品
type OrderService ¶ added in v1.9.3
type OrderService struct { Worker freedom.Worker //运行时,一个请求绑定一个运行时 OrderRepo dependency.OrderRepo //依赖倒置订单资源库 OrderFactory *aggregate.OrderFactory //依赖注入订单工厂 }
OrderService 订单领域服务.
func (*OrderService) Delivery ¶ added in v1.9.3
func (o *OrderService) Delivery(req vo.DeliveryReq) (e error)
Delivery 管理员发货服务
func (*OrderService) Items ¶ added in v1.9.3
func (o *OrderService) Items(userID int, page, pageSize int) (result []vo.OrderItemRes, totalPage int, e error)
Items 订单列表.
type UserService ¶ added in v1.9.3
type UserService struct { Worker freedom.Worker //运行时,一个请求绑定一个运行时 UserRepo dependency.UserRepo //依赖倒置用户资源库 Transaction *domainevent.EventTransaction //依赖注入事务组件 }
UserService 用户领域服务.
func (*UserService) ChangePassword ¶ added in v1.9.3
func (user *UserService) ChangePassword(userID int, newPassword, oldPassword string) (e error)
ChangePassword 修改密码
func (*UserService) Get ¶ added in v1.9.3
func (user *UserService) Get(userID int) (result vo.UserInfoRes, e error)
Get .
func (*UserService) Register ¶ added in v1.9.3
func (user *UserService) Register(req vo.RegisterUserReq) (result vo.UserInfoRes, e error)
Register .
Click to show internal directories.
Click to hide internal directories.