controllers

package
v0.0.0-...-7e63fe4 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 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 AuthorizedResponse

type AuthorizedResponse struct {
	Message string       `json:"message"`
	User    *models.User `json:"user"`
	Token   string       `json:"token"`
}

Define a struct to return when user is authorized

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
}

Define a struct to return when there is an error

type UserController

type UserController struct {
	beego.Controller
}

func (*UserController) IndexAll

func (cont *UserController) IndexAll(authorization string)

@Title Index Users @Description Index all of users when request is authorized @Param authorization header string true "Authorization Token" @router /all [get]

func (*UserController) LoginUser

func (cont *UserController) LoginUser()

@Title Login User @Description Log in an existing User with credentials @Param credentials body {BasicCredentials} true "User credentials" @router /login [post]

func (*UserController) RegisterUser

func (cont *UserController) RegisterUser()

@Title Register User @Description Register a new User in system @Param user body {InputUser} true "User initial data" @router /register [post]

Jump to

Keyboard shortcuts

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