domain

package
v1.8.6 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cart

type Cart struct {
	Worker      freedom.Worker         //运行时,一个请求绑定一个运行时
	CartRepo    dependency.CartRepo    //依赖倒置购物车资源库
	CartFactory *aggregate.CartFactory //依赖注入购物车聚合根工厂
	ShopFactory *aggregate.ShopFactory //依赖注入购买聚合根工厂
}

Cart 领域服务.

func (*Cart) Add

func (c *Cart) Add(userID, goodsID, goodsNum int) (e error)

Add 购物车增加商品

func (*Cart) DeleteAll

func (c *Cart) DeleteAll(userID int) (e error)

DeleteAll 清空购物车

func (*Cart) Items

func (c *Cart) Items(userID int) (items dto.CartItemRes, e error)

Items 购物车全部商品项

func (*Cart) Shop

func (c *Cart) Shop(userID int) (e error)

Shop 购物车全部购买

type Goods

type Goods struct {
	Worker      freedom.Worker                //运行时,一个请求绑定一个运行时
	GoodsRepo   dependency.GoodsRepo          //依赖倒置商品资源库
	ShopFactory *aggregate.ShopFactory        //依赖注入购买聚合根工厂
	TX          *domainevent.EventTransaction //依赖倒置事务组件
}

Goods 商品领域服务.

func (*Goods) AddStock

func (g *Goods) AddStock(goodsID, num int) (e error)

AddStock 增加商品库存

func (*Goods) Items

func (g *Goods) Items(page, pagesize int, tag string) (items []dto.GoodsItemRes, e error)

Items 分页商品列表

func (*Goods) MarkedTag

func (g *Goods) MarkedTag(goodsID int, tag string) (e error)

MarkedTag 商品打tag

func (*Goods) New

func (g *Goods) New(name string, price int) (e error)

New 创建商品

func (*Goods) Shop

func (g *Goods) Shop(goodsID, goodsNum, userID int) (e error)

Shop 购买商品

func (*Goods) ShopEvent added in v1.8.6

func (g *Goods) ShopEvent(event *event.ShopGoods) (e error)

ShopEvent 购买事件 这里只是增加了该商品的库存

type Order

type Order struct {
	Worker       freedom.Worker          //运行时,一个请求绑定一个运行时
	OrderRepo    dependency.OrderRepo    //依赖倒置订单资源库
	OrderFactory *aggregate.OrderFactory //依赖注入订单工厂
}

Order 订单领域服务.

func (*Order) Delivery

func (o *Order) Delivery(req dto.DeliveryReq) (e error)

Delivery 管理员发货服务

func (*Order) Items

func (o *Order) Items(userID int, page, pageSize int) (result []dto.OrderItemRes, totalPage int, e error)

Items 订单列表.

func (*Order) Pay

func (o *Order) Pay(orderNo string, userID int) (e error)

Pay 订单支付 .

type User

type User struct {
	Worker      freedom.Worker                //运行时,一个请求绑定一个运行时
	UserRepo    dependency.UserRepo           //依赖倒置用户资源库
	Transaction *domainevent.EventTransaction //依赖注入事务组件
}

User 用户领域服务.

func (*User) ChangePassword

func (user *User) ChangePassword(userID int, newPassword, oldPassword string) (e error)

ChangePassword 修改密码

func (*User) Get

func (user *User) Get(userID int) (result dto.UserInfoRes, e error)

Get .

func (*User) Register

func (user *User) Register(req dto.RegisterUserReq) (result dto.UserInfoRes, e error)

Register .

Directories

Path Synopsis
Package po generated by 'freedom new-po' Package po generated by 'freedom new-po' Package po generated by 'freedom new-po' Package po generated by 'freedom new-po' Package po generated by 'freedom new-po' Package po generated by 'freedom new-po' Package po generated by 'freedom new-po'
Package po generated by 'freedom new-po' Package po generated by 'freedom new-po' Package po generated by 'freedom new-po' Package po generated by 'freedom new-po' Package po generated by 'freedom new-po' Package po generated by 'freedom new-po' Package po generated by 'freedom new-po'

Jump to

Keyboard shortcuts

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