application

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2020 License: Apache-2.0 Imports: 6 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          //运行时,一个请求绑定一个运行时
	UserRepo    repository.UserRepo     //用户仓库
	CartRepo    repository.CartRepo     //购物车仓库
	GoodsRepo   repository.GoodsRepo    //商品仓库
	OrderRepo   repository.OrderRepo    //订单仓库
	Transaction transaction.Transaction //事务组件
}

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 added in v1.6.1

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

Shop 购物车全部购买

type Goods

type Goods struct {
	Worker    freedom.Worker       //运行时,一个请求绑定一个运行时
	GoodsRepo repository.GoodsRepo //商品仓库
	OrderRepo repository.OrderRepo //订单仓库
	UserRepo  repository.UserRepo  //用户仓库

	Transaction transaction.Transaction //事务组件
}

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 购买商品

type Order added in v1.6.1

type Order struct {
	Worker       freedom.Worker          //运行时,一个请求绑定一个运行时
	UserRepo     repository.UserRepo     //用户仓库
	OrderRepo    repository.OrderRepo    //订单仓库
	AdminRepo    repository.AdminRepo    //管理仓库
	DeliveryRepo repository.DeliveryRepo //发货仓库
	Transaction  transaction.Transaction //事务组件
}

Order 订单领域服务.

func (*Order) Delivery added in v1.6.5

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

Delivery 管理员发货服务

func (*Order) Items added in v1.6.1

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

Items 订单列表.

func (*Order) Pay added in v1.6.1

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

Pay 订单支付 .

type User

type User struct {
	Worker   freedom.Worker      //运行时,一个请求绑定一个运行时
	UserRepo repository.UserRepo //用户仓库
}

User 用户领域服务.

func (*User) ChangePassword

func (s *User) ChangePassword(userId int, newPassword, oldPassword string) (e error)

ChangePassword 修改密码

func (*User) Get

func (s *User) Get(userId int) (result dto.UserInfoRes, e error)

Get .

func (*User) Register

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

Register .

Directories

Path Synopsis
Code generated by 'freedom new-crud' Code generated by 'freedom new-crud' Code generated by 'freedom new-crud' Code generated by 'freedom new-crud' Code generated by 'freedom new-crud' Code generated by 'freedom new-crud' Code generated by 'freedom new-crud'
Code generated by 'freedom new-crud' Code generated by 'freedom new-crud' Code generated by 'freedom new-crud' Code generated by 'freedom new-crud' Code generated by 'freedom new-crud' Code generated by 'freedom new-crud' Code generated by 'freedom new-crud'

Jump to

Keyboard shortcuts

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