controllers

package
v0.0.0-...-557f8b3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBook

func CreateBook(c *fiber.Ctx) error

CreateBook func for creates a new book. @Description Create a new book. @Summary create a new book @Tags Book @Accept json @Produce json @Param title body string true "Title" @Param author body string true "Author" @Param book_attrs body models.BookAttrs true "Book attributes" @Success 200 {object} models.Book @Security ApiKeyAuth @Router /v1/book [post]

func DeleteBook

func DeleteBook(c *fiber.Ctx) error

DeleteBook func for deletes book by given ID. @Description Delete book by given ID. @Summary delete book by given ID @Tags Book @Accept json @Produce json @Param id body string true "Book ID" @Success 204 {string} status "ok" @Security ApiKeyAuth @Router /v1/book [delete]

func GetBook

func GetBook(c *fiber.Ctx) error

GetBook func gets book by given ID or 404 error. @Description Get book by given ID. @Summary get book by given ID @Tags Book @Accept json @Produce json @Param id path string true "Book ID" @Success 200 {object} models.Book @Router /v1/book/{id} [get]

func GetBooks

func GetBooks(c *fiber.Ctx) error

GetBooks func gets all exists books. @Description Get all exists books. @Summary get all exists books @Tags Books @Accept json @Produce json @Success 200 {array} models.Book @Router /v1/books [get]

func GetNewAccessToken

func GetNewAccessToken(c *fiber.Ctx) error

GetNewAccessToken method for create a new access token. @Description Create a new access token. @Summary create a new access token @Tags Token @Accept json @Produce json @Success 200 {string} status "ok" @Router /v1/token/new [get]

func UpdateBook

func UpdateBook(c *fiber.Ctx) error

UpdateBook func for updates book by given ID. @Description Update book. @Summary update book @Tags Book @Accept json @Produce json @Param id body string true "Book ID" @Param title body string true "Title" @Param author body string true "Author" @Param book_status body integer true "Book status" @Param book_attrs body models.BookAttrs true "Book attributes" @Success 201 {string} status "ok" @Security ApiKeyAuth @Router /v1/book [put]

Types

This section is empty.

Jump to

Keyboard shortcuts

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