Package api.mpba.rastvdmy.controller
Class BankIdentityController
java.lang.Object
api.mpba.rastvdmy.controller.BankIdentityController
@RestController
@PreAuthorize("hasRole(\'ROLE_DEFAULT\')")
@RequestMapping(path="/api/v1/banks")
public class BankIdentityController
extends Object
Controller for managing bank identities.
 
 This controller provides endpoints for users to interact with bank identities,
 including retrieving bank information, adding new banks, and deleting bank identities.
 It uses the BankIdentityService for business logic and BankIdentityMapper
 for mapping between request and response objects.
 
- 
Constructor Summary
ConstructorsConstructorDescriptionBankIdentityController(BankIdentityService identityService, BankIdentityMapper identityMapper) Constructor for BankIdentityController. - 
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<BankIdentityResponse> addBank(jakarta.servlet.http.HttpServletRequest request) Adds a new bank identity.org.springframework.http.ResponseEntity<Void> deleteBank(jakarta.servlet.http.HttpServletRequest request, String bankName) Deletes a bank identity by its name.org.springframework.http.ResponseEntity<BankIdentityResponse> getBankByName(jakarta.servlet.http.HttpServletRequest request, String name) Retrieves a specific bank identity by its name.org.springframework.http.ResponseEntity<List<BankIdentityResponse>> getBanks(jakarta.servlet.http.HttpServletRequest request) Retrieves all bank identities. 
- 
Constructor Details
- 
BankIdentityController
public BankIdentityController(BankIdentityService identityService, @Qualifier("bankIdentityMapperImpl") BankIdentityMapper identityMapper) Constructor for BankIdentityController.- Parameters:
 identityService- TheBankIdentityServiceto be used.identityMapper- TheBankIdentityMapperto be used.
 
 - 
 - 
Method Details
- 
getBanks
@GetMapping(produces="application/json") public org.springframework.http.ResponseEntity<List<BankIdentityResponse>> getBanks(jakarta.servlet.http.HttpServletRequest request) Retrieves all bank identities.- Parameters:
 request- The HTTP servlet request containing user information.- Returns:
 - A 
ResponseEntitycontaining a list ofBankIdentityResponse. 
 - 
getBankByName
@GetMapping(path="/{name}", produces="application/json") public org.springframework.http.ResponseEntity<BankIdentityResponse> getBankByName(jakarta.servlet.http.HttpServletRequest request, @PathVariable("name") String name) Retrieves a specific bank identity by its name.- Parameters:
 request- The HTTP servlet request containing user information.name- The name of the bank to retrieve.- Returns:
 - A 
ResponseEntitycontaining the requestedBankIdentityResponse. 
 - 
addBank
@PostMapping(produces="application/json") public org.springframework.http.ResponseEntity<BankIdentityResponse> addBank(jakarta.servlet.http.HttpServletRequest request) throws Exception Adds a new bank identity.- Parameters:
 request- The HTTP servlet request containing user information.- Returns:
 - A 
ResponseEntitycontaining the createdBankIdentityResponse. - Throws:
 Exception- if an error occurs while adding the bank identity.
 - 
deleteBank
@DeleteMapping(path="/{name}") public org.springframework.http.ResponseEntity<Void> deleteBank(jakarta.servlet.http.HttpServletRequest request, @PathVariable("name") String bankName) Deletes a bank identity by its name.- Parameters:
 request- The HTTP servlet request containing user information.bankName- The name of the bank to delete.- Returns:
 - A 
ResponseEntitywith no content. 
 
 -