Documentation ¶
Index ¶
- func GetPage(c *UserController) int
- type LoginResult
- type User
- type UserController
- func (this *UserController) DeleteUser()
- func (this *UserController) GetAllUser()
- func (this *UserController) GetInfo()
- func (this *UserController) GetOneUser()
- func (this *UserController) Login()
- func (this *UserController) ResponseJson(httpCode, errCode int, data interface{})
- func (this *UserController) URLMapping()
- func (this *UserController) UpdateUser()
- func (this *UserController) UpdateUserPwd()
- func (this *UserController) UserRegister()
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPage ¶
func GetPage(c *UserController) int
Types ¶
type LoginResult ¶
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]