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 utilizes the BankIdentityService for business logic and BankIdentityMapper for mapping between request and response objects.

  • Constructor Details

  • 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 ResponseEntity containing a list of BankIdentityResponse.
    • 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 ResponseEntity containing the requested BankIdentityResponse.
    • addBank

      @PostMapping(consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<BankIdentityResponse> addBank(jakarta.servlet.http.HttpServletRequest request, @Valid @RequestBody @Valid BankIdentityRequest identityRequest) throws Exception
      Adds a new bank identity.
      Parameters:
      request - The HTTP servlet request containing user information.
      identityRequest - The request body containing bank identity details.
      Returns:
      A ResponseEntity containing the created BankIdentityResponse.
      Throws:
      Exception - If there is an error 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 ResponseEntity with no content.