Documentation ¶
Index ¶
- func AddBook(service book.Service) fiber.Handler
- func AddEmployee(service employee.Service) fiber.Handler
- func AddStudent(service student.Service) fiber.Handler
- func BookBorrowHandler(service student.Service) fiber.Handler
- func DeleteBook(service book.Service) fiber.Handler
- func DeleteEmployee(service employee.Service) fiber.Handler
- func DeliverBookHandler(service student.Service) fiber.Handler
- func EmployeeSignIn(service employee.Service) fiber.Handler
- func ExtendDateHandler(service student.Service) fiber.Handler
- func GetBook(service book.Service) fiber.Handler
- func GetBooks(service book.Service) fiber.Handler
- func GetBooksByIDHandler(service book.Service) fiber.Handler
- func GetBorrowedBooksHandler(service student.Service) fiber.Handler
- func RequestPasswordResetHandler(service student.Service) fiber.Handler
- func ResetPasswordHandler(service student.Service) fiber.Handler
- func StudentSignIn(service student.Service) fiber.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBook ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
@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 ¶
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 ¶
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 ¶
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 ¶
@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 ¶
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 ¶
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 ¶
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.