controllers

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2020 License: Apache-2.0 Imports: 3 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 {
	Runtime     freedom.Runtime
	GoodsSev    *application.GoodsService
	JSONRequest *infra.JSONRequest
}

func (*GoodsController) Get

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

GetBy 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) PutStock

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

GetBy handles the PUT: /goods/stock route 增加商品库存.

type OrderController

type OrderController struct {
	Runtime  freedom.Runtime
	OrderSev *application.OrderService
}

func (*OrderController) Get

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

GetBy 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 {
	Runtime  freedom.Runtime
	OrderSev *application.OrderService
}

func (*ShopController) Post

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

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

Jump to

Keyboard shortcuts

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