controller

package
v1.8.8 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoodsController

type GoodsController struct {
	Worker       freedom.Worker
	GoodsSev     *domain.GoodsService
	Request      *infra.Request
	EventManager *domainevent.EventManager //领域事件组件
}

GoodsController .

func (*GoodsController) Get

func (goods *GoodsController) Get() freedom.Result

Get handles the GET: /goods/:id route 获取商品列表.

func (*GoodsController) GetBy

func (goods *GoodsController) GetBy(goodsID int) freedom.Result

GetBy handles the GET: /goods/:id route 获取指定商品.

func (*GoodsController) PostShop

func (goods *GoodsController) PostShop() freedom.Result

PostShop handles the POST: /goods/shop route 商品购买事件.

type OrderController

type OrderController struct {
	Worker   freedom.Worker
	OrderSev *domain.OrderService
}

OrderController .

func (*OrderController) Get

func (c *OrderController) Get() freedom.Result

Get handles the GET: /order route 获取全部订单.

func (*OrderController) GetBy

func (c *OrderController) GetBy(goodsID int) freedom.Result

GetBy handles the GET: /order/:id route 通过id获取订单.

type ShopController

type ShopController struct {
	Worker   freedom.Worker
	OrderSev *domain.OrderService
	Request  *infra.Request
}

ShopController .

func (*ShopController) Post

func (c *ShopController) Post() freedom.Result

Post handles the POST: /route 购买商品.

Jump to

Keyboard shortcuts

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