delivery

package
v0.0.0-...-da803b4 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBookHandler

func NewBookHandler(router *echo.Group, usecase domain.CategoryUseCase)

Types

type CategoryHandler

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

func (*CategoryHandler) CreateCategory

func (h *CategoryHandler) CreateCategory(c echo.Context) error

@Summary Create a new category @Description Create a new category object. @Tags categories @Accept json @Produce json @Param request body domain.Category true "New Category data" @Param Authorization header string true "With the bearer started. Only staff members" @Success 201 {object} domain.Category @Failure 400 {object} httpErrors.RestError @Failure 500 {object} httpErrors.RestError @Router /categories [post]

func (*CategoryHandler) DeleteCategory

func (h *CategoryHandler) DeleteCategory(c echo.Context) error

@Summary Delete a category @Description Delete a category object. @Tags categories @Accept json @Produce json @Param category_id path int true "Category ID" @Param Authorization header string true "With the bearer started. Only staff members" @Success 204 @Failure 404 {object} httpErrors.RestError @Failure 409 {object} httpErrors.RestError @Failure 500 {object} httpErrors.RestError @Router /categories/{category_id} [delete]

func (*CategoryHandler) GetCategories

func (h *CategoryHandler) GetCategories(c echo.Context) error

@Summary Get a list of categories @Description Get a list of categories. Use page and size GET arguments to regulate the number of objects returned and the page, respectively. @Tags categories @Accept json @Produce json @Param page query int false "Page number" @Param size query int false "Size number" @Success 200 {array} domain.Category @Failure 400 {object} httpErrors.RestError @Failure 404 {object} httpErrors.EmptyBody @Failure 500 {object} httpErrors.RestError @Router /categories [get]

func (*CategoryHandler) GetCategoryById

func (h *CategoryHandler) GetCategoryById(c echo.Context) error

@Summary Get a category by its id @Description Get a specific category object. Id parameter must be an integer. @Tags categories @Accept json @Produce json @Param category_id path int true "Category ID" @Success 200 {array} domain.Category @Failure 400 {object} httpErrors.RestError @Failure 404 {object} httpErrors.RestError @Failure 500 {object} httpErrors.RestError @Router /categories/{category_id} [get]

func (*CategoryHandler) UpdateCategory

func (h *CategoryHandler) UpdateCategory(c echo.Context) error

@Summary Update a category @Description Update a category object by its Id. @Tags categories @Accept json @Produce json @Param request body domain.Category true "Updated Category data" @Param Authorization header string true "With the bearer started. Only staff members" @Param category_id path int true "Category ID" @Success 200 {object} domain.Category @Failure 400 {object} httpErrors.RestError @Failure 404 {object} httpErrors.RestError @Failure 500 {object} httpErrors.RestError @Router /categories/{category_id} [patch]

Jump to

Keyboard shortcuts

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