Package com.example.restapi.controller
Class LibraryController
java.lang.Object
com.example.restapi.controller.LibraryController
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BookControllerprivate final BorrowingControllerprivate final UserController -
Constructor Summary
ConstructorsConstructorDescriptionLibraryController(UserController userController, BookController bookController, BorrowingController borrowingController) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Book>org.springframework.http.ResponseEntity<String>borrowBook(Long bookId, Long userId) org.springframework.http.ResponseEntity<Void>deleteBorrowing(Long bookId, Long userId) getBooks()getBorrowedBooksByUser(String username) org.springframework.http.ResponseEntity<User>getUserProfile(Long userId) org.springframework.http.ResponseEntity<User>getUserProfileByUsername(String username) org.springframework.http.ResponseEntity<?>getUserSession(jakarta.servlet.http.HttpSession session) org.springframework.http.ResponseEntity<?>org.springframework.http.ResponseEntity<?>registerUser(User user) org.springframework.http.ResponseEntity<String>returnBook(Long bookId)
-
Field Details
-
userController
-
bookController
-
borrowingController
-
-
Constructor Details
-
LibraryController
@Autowired public LibraryController(UserController userController, BookController bookController, BorrowingController borrowingController)
-
-
Method Details
-
registerUser
@PostMapping("/users/register") public org.springframework.http.ResponseEntity<?> registerUser(@RequestBody User user) -
loginUser
@PostMapping("/users/login") public org.springframework.http.ResponseEntity<?> loginUser(@RequestBody User user, jakarta.servlet.http.HttpSession session) -
getUserSession
@GetMapping("/users/session") public org.springframework.http.ResponseEntity<?> getUserSession(jakarta.servlet.http.HttpSession session) -
getBooks
-
addBook
-
borrowBook
-
returnBook
-
getUserProfile
-
getUserProfileByUsername
-
getBorrowedBooksByUser
-
deleteBorrowing
-