controllers

package
v0.0.0-...-089f0e8 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTask

func CreateTask(c *gin.Context)

func CreateUser

func CreateUser(c *gin.Context)

func DeleteTask

func DeleteTask(c *gin.Context)

func DeleteUser

func DeleteUser(c *gin.Context)

func GetTaskById

func GetTaskById(c *gin.Context)

GetTaskById godoc @Summary Retrieves task based on given ID @Description get Task by ID @Produce json @Param id path integer true "Task ID" @Success 200 {object} tasks.Task @Router /api/tasks/{id} [get] @Security Authorization Token

func GetTasks

func GetTasks(c *gin.Context)

GetTasks godoc @Summary Retrieves tasks based on query @Description Get Tasks @Produce json @Param taskname query string false "Taskname" @Param firstname query string false "Firstname" @Param lastname query string false "Lastname" @Success 200 {array} []tasks.Task @Router /api/tasks [get] @Security Authorization Token

func GetUserById

func GetUserById(c *gin.Context)

GetUserById godoc @Summary Retrieves user based on given ID @Description get User by ID @Produce json @Param id path integer true "User ID" @Success 200 {object} users.User @Router /api/users/{id} [get] @Security Authorization Token

func GetUsers

func GetUsers(c *gin.Context)

GetUsers godoc @Summary Retrieves users based on query @Description Get Users @Produce json @Param username query string false "Username" @Param firstname query string false "Firstname" @Param lastname query string false "Lastname" @Success 200 {array} []users.User @Router /api/users [get] @Security Authorization Token

func Login

func Login(c *gin.Context)

func UpdateTask

func UpdateTask(c *gin.Context)

func UpdateUser

func UpdateUser(c *gin.Context)

Types

type LoginInput

type LoginInput struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type UserInput

type UserInput struct {
	Username  string `json:"username" binding:"required"`
	Lastname  string `json:"lastname"`
	Firstname string `json:"firstname"`
	Password  string `json:"password" binding:"required"`
	Role      string `json:"role"`
}

Jump to

Keyboard shortcuts

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