StudentLoanManagement
|
Public Member Functions | |
UserController (UserService userService, ItemService itemService) | |
ResponseEntity< List< User > > | getAllUsers (@RequestParam("token") String token) |
ResponseEntity<?> | login (@RequestBody CredentialsDTO credentials) |
ResponseEntity< String > | logout (@RequestParam("token") String token) |
ResponseEntity< UserDTO > | getUserById (@PathVariable Long id) |
ResponseEntity< UserRecord > | getUserRecordById (@PathVariable Long id) |
ResponseEntity< List< LoanAndItemDto > > | getItemsLentByUser (@PathVariable Long userId) |
ResponseEntity< List< LoanAndItemDto > > | getItemsBorrowedByUser (@PathVariable Long userId) |
ResponseEntity< User > | updateUser (@PathVariable Long id, @RequestBody UserRecord userData, @RequestParam("token") String token) |
ResponseEntity< String > | register (@RequestBody RegistrationRecord userDTO) |
ResponseEntity< String > | deleteUser (@PathVariable Long id, @RequestParam("token") String token) |
User | registerRecordToUser (RegistrationRecord data) |
User | userRecordToUser (UserRecord userDTO) |
UserRecord | userToUserRecord (User user) |
Controller class for managing users in the system. Handles HTTP requests related to user operations such as creating, updating, deleting, and retrieving users.
Definition at line 30 of file UserController.java.
com.student_loan.controller.UserController.UserController | ( | UserService | userService, |
ItemService | itemService | ||
) |
Constructor for UserController.
userService | Service for user operations. |
Definition at line 41 of file UserController.java.
ResponseEntity< String > com.student_loan.controller.UserController.deleteUser | ( | @PathVariable Long | id, |
@RequestParam("token") String | token | ||
) |
Deletes a user by their ID.
id | The ID of the user. |
token | The authentication token. |
Definition at line 194 of file UserController.java.
ResponseEntity< List< User > > com.student_loan.controller.UserController.getAllUsers | ( | @RequestParam("token") String | token | ) |
Retrieves all users in the system.
token | The authentication token. |
Definition at line 52 of file UserController.java.
ResponseEntity< List< LoanAndItemDto > > com.student_loan.controller.UserController.getItemsBorrowedByUser | ( | @PathVariable Long | userId | ) |
Definition at line 142 of file UserController.java.
ResponseEntity< List< LoanAndItemDto > > com.student_loan.controller.UserController.getItemsLentByUser | ( | @PathVariable Long | userId | ) |
Definition at line 135 of file UserController.java.
ResponseEntity< UserDTO > com.student_loan.controller.UserController.getUserById | ( | @PathVariable Long | id | ) |
Retrieves a user by their ID.
id | The ID of the user. |
Definition at line 95 of file UserController.java.
ResponseEntity< UserRecord > com.student_loan.controller.UserController.getUserRecordById | ( | @PathVariable Long | id | ) |
Retrieves a user by their ID (versión completa usando UserRecord).
GET /users/{id}/record
id | The ID of the user. |
Definition at line 118 of file UserController.java.
ResponseEntity<?> com.student_loan.controller.UserController.login | ( | @RequestBody CredentialsDTO | credentials | ) |
Authenticates a user and generates a token.
credentials | The user's credentials. |
Definition at line 66 of file UserController.java.
ResponseEntity< String > com.student_loan.controller.UserController.logout | ( | @RequestParam("token") String | token | ) |
Logs out a user by invalidating their token.
token | The authentication token. |
Definition at line 81 of file UserController.java.
ResponseEntity< String > com.student_loan.controller.UserController.register | ( | @RequestBody RegistrationRecord | userDTO | ) |
Registers a new user.
userDTO | The registration data. |
Definition at line 178 of file UserController.java.
User com.student_loan.controller.UserController.registerRecordToUser | ( | RegistrationRecord | data | ) |
Converts a RegistrationRecord to a User entity.
data | The registration record. |
Definition at line 212 of file UserController.java.
ResponseEntity< User > com.student_loan.controller.UserController.updateUser | ( | @PathVariable Long | id, |
@RequestBody UserRecord | userData, | ||
@RequestParam("token") String | token | ||
) |
Updates a user by their ID.
id | The ID of the user. |
userData | The updated user data. |
token | The authentication token. |
Definition at line 156 of file UserController.java.
User com.student_loan.controller.UserController.userRecordToUser | ( | UserRecord | userDTO | ) |
Converts a UserRecord to a User entity.
userDTO | The user record. |
Definition at line 233 of file UserController.java.
UserRecord com.student_loan.controller.UserController.userToUserRecord | ( | User | user | ) |
Definition at line 249 of file UserController.java.