controllers

package
v0.0.0-...-e51c59f Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UsersController

type UsersController struct {
	beego.Controller
}

UsersController allows REST-based operations for user models

func (*UsersController) Delete

func (u *UsersController) Delete()

Delete godoc @Summary Update user @Description Delete by user ID @Tags users @Security BasicAuth @Produce json @Param id path int true "User ID" Format(int64) @Success 200 {object} models.User @Failure 400 {object} models.RequestError @Router /users/{id} [delete]

func (*UsersController) Get

func (u *UsersController) Get()

Get godoc @Summary Get list of all users @Description Get all users. No paging applied. Protected with basic auth (but on server side real protection does @Description not happen, logging only). @Tags users @Produce json @Router /users [get] @Success 200 {array} models.User

func (*UsersController) GetByID

func (u *UsersController) GetByID()

GetByID godoc @Summary Get single user by it's ID @Description Get single user. ID of user should be specified. Error if no user found. Protected with basic auth @Description (but on server side real protection does not happen, logging only). @Tags users @Produce json @Param id path int true "User ID" @Router /users/{id} [get] @Success 200 {object} models.User @Failure 400 {object} models.RequestError @Failure 404 {object} models.RequestError

func (*UsersController) Post

func (u *UsersController) Post()

Post godoc @Summary Add new user @Description Creates new user in our user set. User ID, if provided as part of user spec, is ignored. @Tags users @Security BasicAuth @Accept json @Produce json @Param user body models.User true "The user to add" @Success 200 {object} models.User @Failure 400 {object} models.RequestError @Router /users [post]

func (*UsersController) Put

func (u *UsersController) Put()

Put godoc @Summary Update user @Description Update user with a json @Tags users @Security BasicAuth @Accept json @Produce json @Param user body models.User true "The user to update" @Success 200 {object} models.User @Failure 400 {object} models.RequestError @Failure 404 {object} models.RequestError @Router /users [put]

Jump to

Keyboard shortcuts

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