user

package
v0.0.0-...-17112b8 Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPage

func GetPage(c *UserController) int

Types

type LoginResult

type LoginResult struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data struct {
		Token interface{} `json:"token"`
	} `json:"data"`
}

type User

type User struct {
	Id       int    `json:"id"`
	Username string `json:"username"`
	Password string `json:"password"`
	Role     int    `json:"role_id"`
}

type UserController

type UserController struct {
	beego.Controller
}

用户

func (*UserController) DeleteUser

func (this *UserController) DeleteUser()

@Summary 删除用户 @Tags 删除用户 @Description 删除用户 @Accept json @Produce json @Param id path int true "id" @Failure 400 {string} json "{"code":400, "data":null,"msg":"请求参数错误"}" @Failure 404 {string} json "{ "code": 404, "data":null,"msg":"请求参数错误"}" @Success 200 {string} json "{ "code": 200, "data": { "token": "xxx" }, "msg": "ok" }" @router /users/:id [delete]

func (*UserController) GetAllUser

func (this *UserController) GetAllUser()

@Summary 查询所有用户 @Tags 查询所有用户 @Description 查询所有用户 @Accept json @Produce json @Failure 400 {string} json "{"code":400, "data":null,"msg":"请求参数错误"}" @Failure 404 {string} json "{ "code": 404, "data":null,"msg":"请求参数错误"}" @Success 200 {string} json "{ "code": 200, "data": { "token": "xxx" }, "msg": "ok" }" @router /users [get]

func (*UserController) GetInfo

func (this *UserController) GetInfo()

@Title 获取用户信息 @Description 获取用户信息 @Success 200 {string} @Failure 404 body is empty @router /getinfo [get]

func (*UserController) GetOneUser

func (this *UserController) GetOneUser()

@Summary 查询单个用户 @Tags 查询单个用户 @Description 查询单个用户 @Accept json @Produce json @Failure 400 {string} json "{"code":400, "data":null,"msg":"请求参数错误"}" @Failure 404 {string} json "{ "code": 404, "data":null,"msg":"请求参数错误"}" @Success 200 {string} json "{ "code": 200, "data": { "token": "xxx" }, "msg": "ok" }" @router /users/:id [get]

func (*UserController) Login

func (this *UserController) Login()

@Title 获取用户token @Description 获取用户token @Param body body User true "body" @Success 200 {string} @Failure 404 body is empty

func (*UserController) ResponseJson

func (this *UserController) ResponseJson(httpCode, errCode int, data interface{})

func (*UserController) URLMapping

func (this *UserController) URLMapping()

func (*UserController) UpdateUser

func (this *UserController) UpdateUser()

@Summary 修改用户信息 @Tags 修改用户信息 @Description 修改用户信息 @Accept json @Produce json @Param id body int true "id" @Param role_id body int false "role_id" @Failure 400 {string} json "{"code":400, "data":null,"msg":"请求参数错误"}" @Failure 404 {string} json "{ "code": 404, "data":null,"msg":"请求参数错误"}" @Success 200 {string} json "{ "code": 200, "data": { "token": "xxx" }, "msg": "ok" }" @router /users/ [put]

func (*UserController) UpdateUserPwd

func (this *UserController) UpdateUserPwd()

@Summary 修改用户密码 @Tags 修改用户密码 @Description 修改用户密码 @Accept json @Produce json @Param body body User true "body content" @Success 200 {string} json "{ "code": 200, "data": { "token": "xxx" }, "msg": "ok" }" @router /users/ [post]

func (*UserController) UserRegister

func (this *UserController) UserRegister()

@Summary 注册用户 @Tags 注册用户 @Description 注册用户 @Accept json @Produce json @Param username body string true "username" @Param password body string true "password" @Param role_id body int false "role_id" @Success 200 {string} json "{ "code": 200, "data": { "token": "xxx" }, "msg": "ok" }" @Failure 400 {string} json "{"code":400, "data":null,"msg":"请求参数错误"}" @Failure 404 {string} json "{ "code": 404, "data":null,"msg":"请求参数错误"}" @router /register [POST]

type Users

type Users struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
	Role []int  `json:"role_id"`
}

Jump to

Keyboard shortcuts

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