book

package
v0.0.0-...-d4bccd0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 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 BookHandler

type BookHandler struct {
	BookUseCase _bookUseCase.BookUseCaseInterface
}

func NewBookHandler

func NewBookHandler(bookUseCase _bookUseCase.BookUseCaseInterface) *BookHandler

func (*BookHandler) CreateHandler

func (bh *BookHandler) CreateHandler(c echo.Context) error

CreateBook @Summary Create Book @Description Create Book @Tags books @ID create-book @Accept json @Produce json @Param data body helper.BookRequest true "Book Data" @Success 200 {object} helper.BookResponse @Failure 400 {object} helper.ResponseFailedBody "Server Error" @Failure 401 {object} helper.ResponseFailedBody "Authorization Error" @Failure 500 {object} helper.ResponseFailedBody "Server Error" @Security ApiKeyAuth @Router /books [post]

func (*BookHandler) DeleteHandler

func (bh *BookHandler) DeleteHandler(c echo.Context) error

DeeteBook @Summary Delete Book @Description Delete Book by id @Tags books @ID delete-book @Accept json @Produce json @Param id path int true "ID" @Success 200 {object} helper.BookResponse @Failure 400 {object} helper.ResponseFailedBody "Server Error" @Failure 401 {object} helper.ResponseFailedBody "Authorization Error" @Failure 500 {object} helper.ResponseFailedBody "Server Error" @Security ApiKeyAuth @Router /books/{id} [delete]

func (*BookHandler) GetAllHandler

func (bh *BookHandler) GetAllHandler(c echo.Context) error

GetAllBooks @Summary Get all books @Description show all books @Tags books @ID get-books @Accept json @Produce json @Param page query int false "Page" @Param limit query int false "Limit" @Param category query string false "Category" @Success 200 {object} helper.PaginationResponse "ok" @Failure 500 {object} helper.ResponseFailedBody "Server Error" @Router /books [get]

func (*BookHandler) GetByIDHandler

func (bh *BookHandler) GetByIDHandler(c echo.Context) error

GetBookByID @Summary get book by it id @Description get string by ID @Tags books @ID get-book @Accept json @Produce json @Param id path int true "ID" @Success 200 {object} helper.BookResponse @Failure 400 {object} helper.ResponseFailedBody "Server Error" @Failure 500 {object} helper.ResponseFailedBody "Server Error" @Router /books/{id} [get]

func (*BookHandler) UpdateHandler

func (bh *BookHandler) UpdateHandler(c echo.Context) error

UpdateBook @Summary Update Book @Description update book by id @Tags books @ID update-book @Accept json @Produce json @Param id path int true "ID" @Param data body helper.BookRequest true "Book Data" @Success 200 {object} helper.BookResponse @Failure 400 {object} helper.ResponseFailedBody "Server Error" @Failure 404 {object} helper.ResponseFailedBody "Server Error" @Failure 401 {object} helper.ResponseFailedBody "Authorization Error" @Failure 500 {object} helper.ResponseFailedBody "Server Error" @Security ApiKeyAuth @Router /books/{id} [put]

Jump to

Keyboard shortcuts

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