adapter

package
v0.0.0-...-9279c85 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 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 {
	// contains filtered or unexported fields
}

BookHandler handles book-related HTTP requests

func NewBookHandler

func NewBookHandler(service in.BookService) *BookHandler

func (*BookHandler) CreateBook

func (h *BookHandler) CreateBook(c echo.Context) error

CreateBook godoc @Summary Create a new book @Description Add a new book to the library @Tags books @Accept json @Produce json @Param book body model.Book true "Book details" @Success 201 {object} model.Book @Failure 400 {object} string "Bad Request" @Router /books [post]

func (*BookHandler) DeleteBook

func (h *BookHandler) DeleteBook(c echo.Context) error

DeleteBook godoc @Summary Delete a book @Description Delete a specific book by its ID @Tags books @Produce json @Param id path int true "Book ID" @Success 200 {object} string "Book deleted" @Failure 404 {object} string "Book not found" @Router /books/{id} [delete]

func (*BookHandler) GetAllBooks

func (h *BookHandler) GetAllBooks(c echo.Context) error

GetAllBooks godoc @Summary Get all books @Description Retrieve a list of all books in the library @Tags books @Produce json @Success 200 {array} model.Book @Failure 500 {object} string "Internal Server Error" @Router /books [get]

func (*BookHandler) GetBookByID

func (h *BookHandler) GetBookByID(c echo.Context) error

GetBookByID godoc @Summary Get a book by ID @Description Retrieve a specific book using its ID @Tags books @Produce json @Param id path int true "Book ID" @Success 200 {object} model.Book @Failure 404 {object} string "Book not found" @Router /books/{id} [get]

func (*BookHandler) UpdateBook

func (h *BookHandler) UpdateBook(c echo.Context) error

UpdateBook godoc @Summary Update a book @Description Update details of an existing book @Tags books @Accept json @Produce json @Param id path int true "Book ID" @Param book body model.Book true "Updated book details" @Success 200 {object} model.Book @Failure 400 {object} string "Bad Request" @Failure 404 {object} string "Book not found" @Router /books/{id} [put]

type BorrowHandler

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

func NewBorrowHandler

func NewBorrowHandler(service in.BorrowService) *BorrowHandler

func (*BorrowHandler) CheckBorrow

func (b *BorrowHandler) CheckBorrow(c echo.Context) error

func (*BorrowHandler) CreateBorrow

func (b *BorrowHandler) CreateBorrow(context echo.Context) error

func (*BorrowHandler) GetAllBorrows

func (b *BorrowHandler) GetAllBorrows(c echo.Context) error

func (*BorrowHandler) HandleReturn

func (b *BorrowHandler) HandleReturn(c echo.Context) error

type PatronHandler

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

func NewPatronHandler

func NewPatronHandler(s in.PatronService) PatronHandler

func (*PatronHandler) CreatePatron

func (handler *PatronHandler) CreatePatron(context echo.Context) error

CreatePatron creates a new patron @Summary Create a new patron @Description Create a new patron and save it to the database @Tags patrons @Accept json @Produce json @Param patron body domain.Patron true "Patron data" @Success 201 {object} domain.Patron @Failure 400 {object} echo.HTTPError "Bad request" @Failure 500 {object} echo.HTTPError "Internal server error" @Router /patrons [post]

func (*PatronHandler) GetAllPatrons

func (handler *PatronHandler) GetAllPatrons(context echo.Context) error

GetAllBooks gets all patrons @Summary Get all patrons @Description Get a list of all patrons from the database @Tags patrons @Produce json @Success 200 {array} domain.Patron @Failure 500 {object} echo.HTTPError "Internal server error" @Router /patrons [get]

Jump to

Keyboard shortcuts

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