controllers

package
v0.0.0-...-d5996f0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProductController

type ProductController struct {
	Ctx iris.Context
	// TODO:NOTICE 使用session是临时的,后续会把session优化掉,在高并发场景,session数据维护消耗大
	Session        *sessions.Session
	ProductService service.IProductService
	OrderService   service.IOrderService
	RabbitMQ       *datasource.RabbitMQ
}

func (*ProductController) GetDetail

func (p *ProductController) GetDetail() mvc.View

秒杀商品详情

func (*ProductController) GetGenerateHtml

func (p *ProductController) GetGenerateHtml()

GET domain_name/generate/html?productID=1 生成秒杀商品静态 html 文件

func (*ProductController) GetOrder

func (p *ProductController) GetOrder() []byte

基于MySQL的秒杀抢购流程

type UserController

type UserController struct {
	Ctx     iris.Context
	Service service.IUserService
	Session *sessions.Session
}

func (*UserController) GetLogin

func (c *UserController) GetLogin() mvc.View

GET domain_name/login

func (*UserController) GetRegister

func (c *UserController) GetRegister() mvc.View

秒杀用户注册页面 GET domain_name/register

func (*UserController) PostLogin

func (c *UserController) PostLogin() mvc.Response

POST domain_name/login

func (*UserController) PostRegister

func (c *UserController) PostRegister()

POST domain_name/register

Jump to

Keyboard shortcuts

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