StudentLoanManagement
|
Public Member Functions | |
ResponseEntity< List< Loan > > | getAllLoans (@RequestParam("token") String token) |
ResponseEntity< Loan > | getLoanById (@PathVariable Long id, @RequestParam("token") String token) |
ResponseEntity< List< Loan > > | getLoansByLender () |
ResponseEntity< List< Loan > > | getLoansByBorrower () |
ResponseEntity< String > | createLoan (@RequestBody LoanRecord loanRecord) |
ResponseEntity< String > | updateLoan (@PathVariable Long id, @RequestBody LoanRecord loan, @RequestHeader("Authorization") String authHeader) |
ResponseEntity< Void > | returnLoan (@PathVariable Long itemId) |
ResponseEntity< String > | deleteLoan (@PathVariable Long id, @RequestParam("token") String token) |
Controller class for managing loans in the system. Handles HTTP requests related to loan operations such as creating, updating, deleting, and retrieving loans.
Definition at line 31 of file LoanController.java.
ResponseEntity< String > com.student_loan.controller.LoanController.createLoan | ( | @RequestBody LoanRecord | loanRecord | ) |
Creates a new loan.
loanRecord | The loan data. |
Definition at line 138 of file LoanController.java.
ResponseEntity< String > com.student_loan.controller.LoanController.deleteLoan | ( | @PathVariable Long | id, |
@RequestParam("token") String | token | ||
) |
Deletes a loan by its ID.
id | The ID of the loan. |
token | The authentication token. |
Definition at line 228 of file LoanController.java.
ResponseEntity< List< Loan > > com.student_loan.controller.LoanController.getAllLoans | ( | @RequestParam("token") String | token | ) |
Retrieves all loans in the system.
token | The authentication token. |
Definition at line 57 of file LoanController.java.
ResponseEntity< Loan > com.student_loan.controller.LoanController.getLoanById | ( | @PathVariable Long | id, |
@RequestParam("token") String | token | ||
) |
Retrieves a loan by its ID.
id | The ID of the loan. |
token | The authentication token. |
Definition at line 73 of file LoanController.java.
ResponseEntity< List< Loan > > com.student_loan.controller.LoanController.getLoansByBorrower | ( | ) |
Retrieves loans by borrower ID.
token | The authentication token. |
borrowerId | The ID of the borrower. |
Definition at line 120 of file LoanController.java.
ResponseEntity< List< Loan > > com.student_loan.controller.LoanController.getLoansByLender | ( | ) |
Retrieves loans by lender ID.
token | The authentication token. |
lenderId | The ID of the lender. |
Definition at line 98 of file LoanController.java.
ResponseEntity< Void > com.student_loan.controller.LoanController.returnLoan | ( | @PathVariable Long | itemId | ) |
Marks a loan as returned by its item ID.
itemId | The ID of the item. |
Definition at line 202 of file LoanController.java.
ResponseEntity< String > com.student_loan.controller.LoanController.updateLoan | ( | @PathVariable Long | id, |
@RequestBody LoanRecord | loan, | ||
@RequestHeader("Authorization") String | authHeader | ||
) |
Updates a loan by its ID.
id | The ID of the loan. |
loan | The updated loan data. |
authHeader | The authorization header containing the token. |
Definition at line 165 of file LoanController.java.