Class CurrencyDataController

java.lang.Object
api.mpba.rastvdmy.controller.CurrencyDataController

@RestController @PreAuthorize("hasAnyRole(\'ROLE_DEFAULT\', \'ROLE_ADMIN\')") @RequestMapping("/api/v1/currency-data") public class CurrencyDataController extends Object
Controller for managing currency data.

This controller provides endpoints for users to retrieve and update currency exchange rates. It uses the CurrencyDataService for business logic and CurrencyDataMapper for mapping between request and response objects.

  • Constructor Details

  • Method Details

    • updateAndFetchAllCurrencies

      @GetMapping(produces="application/json") public org.springframework.http.ResponseEntity<List<CurrencyDataResponse>> updateAndFetchAllCurrencies(jakarta.servlet.http.HttpServletRequest request)
      Updates and retrieves all currency data.
      Parameters:
      request - The HTTP servlet request containing user information.
      Returns:
      A ResponseEntity containing a list of CurrencyDataResponse.
    • findByCurrency

      @GetMapping(path="/{currency}", produces="application/json") public org.springframework.http.ResponseEntity<CurrencyDataResponse> findByCurrency(jakarta.servlet.http.HttpServletRequest request, @PathVariable("currency") String currencyType)
      Retrieves currency data by currency type.
      Parameters:
      request - The HTTP servlet request containing user information.
      currencyType - The type of currency to retrieve.
      Returns:
      A ResponseEntity containing the requested CurrencyDataResponse.