controller

package
v0.0.0-...-075c139 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	// contains filtered or unexported fields
}

func NewBookController

func NewBookController(sb *service.Book) *Book

func (*Book) Create

func (c *Book) Create(ctx *fiber.Ctx) error

Create godoc @Summary Modify provided URL with certain operation @Tags Books @Accept json @Produce json @Success 200 {object} dto.CleanupResponse @Failure 400 {object} response.StdResponse @Failure 404 {string} "Not Found" @Router /books/ [post]

func (*Book) Delete

func (c *Book) Delete(ctx *fiber.Ctx) error

Delete godoc @Summary Soft delete a book by an ID @Tags Books @Produce json @Param id path uuid true "Book ID" @Success 200 {object} response.StdResponse @Failure 400 {object} response.StdResponse @Failure 404 {string} "Not Found" @Router /books/{id} [delete]

func (*Book) Detail

func (c *Book) Detail(ctx *fiber.Ctx) error

Detail godoc @Summary Get detailed data about a book @Tags Books @Produce json @Param id path uuid true "Book ID" @Success 200 {object} response.StdResponse @Failure 400 {object} response.StdResponse @Failure 404 {string} "Not Found" @Router /books/{id} [get]

func (*Book) Read

func (c *Book) Read(ctx *fiber.Ctx) error

Read godoc @Summary Get summary data of a book with pagination @Tags Books @Produce json @Param title query string false "title of a book" @Success 200 {object} response.StdResponse @Failure 400 {object} response.StdResponse @Failure 404 {string} "Not Found" @Router /books [post]

func (*Book) Update

func (c *Book) Update(ctx *fiber.Ctx) error

Update godoc @Summary Update whole data of a book @Tags Books @Accept json @Produce json @Param id path uuid true "Book ID" @Success 200 {object} response.StdResponse @Failure 400 {object} response.StdResponse @Failure 404 {string} "Not Found" @Router /books/{id} [put]

Jump to

Keyboard shortcuts

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