controller

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserController

type UserController struct{}

func (*UserController) GetInfo

func (c *UserController) GetInfo(ctx iris.Context) error

@Summary 用户信息 @Description 用户信息 @Tags user @Accept json @Param Authorization header string true "Bearer JwtToken" @Param user_id query int true "用户id" @Success 200 {object} viewmodel.User @Router /user/info [get]

func (*UserController) HandleError

func (c *UserController) HandleError(ctx iris.Context, err error)

每个controller各自的error handler可以覆盖总的error handler

func (*UserController) PostLogin

func (c *UserController) PostLogin(ctx iris.Context) error

@Summary 用户登录 @Description 用户登录 @Tags user @Accept json @Produce json @Param body body param.LoginParam true "login" @Success 200 {object} datamodel.User @Failure 400 {object} viewmodel.Response @Router /user/login [post]

func (*UserController) PostRegister

func (c *UserController) PostRegister(ctx iris.Context) error

@Summary 用户注册 @Description 用户注册 @Tags user @Accept json @Produce json @Param body body param.RegisterParam true "register" @Success 200 {object} datamodel.User @Failure 400 {object} viewmodel.Response @Router /user/register [post]

Jump to

Keyboard shortcuts

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