handlers

package
v0.0.0-...-587043a Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBook

func AddBook(service book.Service) fiber.Handler

TODO update doc first AddBook godoc @Summary Add a new book @Description add by json book @Tags book @Accept json @Produce json @Param book body entities.Book true "Add Book" @Success 201 {object} presenter.BookSuccessResponseStruct @Failure 400 {object} presenter.BookErrorResponseStruct @Router /book/add [post]

func AddEmployee

func AddEmployee(service employee.Service) fiber.Handler

AddEmployee godoc @Summary Add a new employee @Description add by json employee @Tags employee @Accept json @Produce json @Param employee body entities.Employee true "Add Employee" @Success 201 {object} presenter.EmployeeSuccessResponseStruct @Failure 400 {object} presenter.EmployeeErrorResponseStruct @Router /employee/add [post]

func AddStudent

func AddStudent(service student.Service) fiber.Handler

AddStudent godoc @Summary Add a new student @Description add by json student @Tags student @Accept json @Produce json @Param student body entities.Student true "Add Student" @Success 201 {object} presenter.StudentSuccessResponseStruct @Failure 400 {object} presenter.StudentErrorResponseStruct @Failure 500 {object} presenter.StudentErrorResponseStruct @Router /student/add [post]

func BookBorrowHandler

func BookBorrowHandler(service student.Service) fiber.Handler

BookBorrowHandler godoc @Summary Borrow a book @Description Allows a student to borrow a book @Tags student @Accept json @Produce json @Param request body presenter.StudentBorrowBookRequestStruct true "Borrow Book Request" @Success 200 {object} presenter.StudentOKResponseStruct @Failure 400 {object} presenter.StudentErrorResponseStruct @Failure 500 {object} presenter.StudentErrorResponseStruct @Router /student/borrow-book/ [post]

func DeleteBook

func DeleteBook(service book.Service) fiber.Handler

DeleteBook godoc @Summary Delete a book @Description Delete a book by ID @Tags book @Accept json @Produce json @Param id path string true "Book ID" @Success 204 "No Content" @Failure 400 {object} presenter.BookErrorResponseStruct @Failure 500 {object} presenter.BookErrorResponseStruct @Router /book/delete/{id} [delete]

func DeleteEmployee

func DeleteEmployee(service employee.Service) fiber.Handler

DeleteEmployee godoc @Summary Delete an employee @Description Delete an employee by ID @Tags employee @Accept json @Produce json @Param id path string true "Employee ID" @Success 204 "No Content" @Failure 400 {object} presenter.EmployeeErrorResponseStruct @Failure 500 {object} presenter.EmployeeErrorResponseStruct @Router /employee/delete/{id} [delete]

func DeliverBookHandler

func DeliverBookHandler(service student.Service) fiber.Handler

DeliverBookHandler godoc @Summary Deliver a book @Description Allows a student to deliver a book @Tags student @Accept json @Produce json @Param borrow_id path string true "Borrow ID" @Param book_id path string true "Book ID" @Param student_id path string true "Student ID" @Success 200 {object} presenter.StudentOKResponseStruct @Failure 400 {object} presenter.StudentErrorResponseStruct @Failure 500 {object} presenter.StudentErrorResponseStruct @Router /student/deliver-book/{borrow_id}/{book_id}/{student_id} [post]

func EmployeeSignIn

func EmployeeSignIn(service employee.Service) fiber.Handler

SignIn godoc @Summary Sign in an employee @Description Sign in an employee with email and password @Tags employee @Accept json @Produce json @Param signin body object{email=string,password=string} true "Sign In" @Success 200 {object} presenter.EmployeeSuccessResponseStruct @Failure 400 {object} presenter.EmployeeErrorResponseStruct @Failure 401 {object} presenter.EmployeeErrorResponseStruct @Router /employee/signin [post]

func ExtendDateHandler

func ExtendDateHandler(service student.Service) fiber.Handler

@Summary Extend Borrow Date @Description Extend the borrow date for a given borrow ID. @Tags student @Accept json @Produce json @Param borrowID path string true "Borrow ID" @Success 200 {object} presenter.StudentOKResponseStruct @Failure 400 {object} presenter.StudentErrorResponseStruct @Failure 500 {object} presenter.StudentErrorResponseStruct @Router /student/extend/{borrowID} [post]

func GetBook

func GetBook(service book.Service) fiber.Handler

GetBook godoc @Summary Get a book @Description Get a book by ID @Tags book @Accept json @Produce json @Param id path string true "Book ID" @Success 200 {object} presenter.BookSuccessResponseStruct @Failure 400 {object} presenter.BookErrorResponseStruct @Failure 500 {object} presenter.BookErrorResponseStruct @Router /book/get/{id} [get]

func GetBooks

func GetBooks(service book.Service) fiber.Handler

GetBooks godoc @Summary Get a listed books @Description Get a listed books with an order @Tags book @Accept json @Produce json @Success 200 {object} presenter.BooksSuccessResponseStruct @Failure 500 {object} presenter.BookErrorResponseStruct @Router /book/gets [get]

func GetBooksByIDHandler

func GetBooksByIDHandler(service book.Service) fiber.Handler

GetBooksByID godoc @Summary Get books by ID @Description Retrieve a list of books by their IDs @Tags book @Accept json @Produce json @Param request body object true "Book ID List" @Success 200 {object} presenter.BooksSuccessResponseStruct @Failure 400 {object} presenter.BookErrorResponseStruct @Failure 500 {object} presenter.BookErrorResponseStruct @Router /book/gets-by-ID [get]

func GetBorrowedBooksHandler

func GetBorrowedBooksHandler(service student.Service) fiber.Handler

@Summary Get Borrowed Books @Description Get a list of borrowed books for a given student ID @Tags student @Accept json @Produce json @Param studentID path string true "Student ID" @Success 200 {object} presenter.StudentBorrowedBookStruct @Failure 400 {object} presenter.StudentErrorResponseStruct @Failure 500 {object} presenter.StudentErrorResponseStruct @Router /students/get-borrowed-books/{studentID} [get]

func RequestPasswordResetHandler

func RequestPasswordResetHandler(service student.Service) fiber.Handler

RequestPasswordResetHandler godoc @Summary Request password reset @Description Send a password reset email to the student @Tags student @Accept json @Produce json @Param resetRequest body object{email=string} true "Reset Request" @Success 201 {object} presenter.StudentOKResponseStruct @Failure 400 {object} presenter.StudentErrorResponseStruct @Failure 500 {object} presenter.StudentErrorResponseStruct @Router /student/password-reset-request [post]

func ResetPasswordHandler

func ResetPasswordHandler(service student.Service) fiber.Handler

ResetPasswordHandler godoc @Summary Reset password @Description Reset the student's password using a token @Tags student @Accept json @Produce json @Param token path string true "Token" @Param request body object{new_email=string} true "New Password" @Success 200 {object} presenter.StudentOKResponseStruct @Failure 400 {object} presenter.StudentErrorResponseStruct @Failure 500 {object} presenter.StudentErrorResponseStruct @Router /student/reset-password/{token} [post]

func StudentSignIn

func StudentSignIn(service student.Service) fiber.Handler

SignIn godoc @Summary Sign in a student @Description Sign in a student with email and password @Tags student @Accept json @Produce json @Param signin body object{email=string,password=string} true "Sign In" @Success 201 {object} presenter.StudentSuccessResponseStruct @Failure 400 {object} presenter.StudentErrorResponseStruct @Failure 401 {object} presenter.StudentErrorResponseStruct @Failure 500 {object} presenter.StudentErrorResponseStruct @Router /student/signin [post]

Types

This section is empty.

Jump to

Keyboard shortcuts

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