Class InternalProductsRestController

java.lang.Object
es.kukenan.smartfi.microservice.contracts.controller.InternalProductsRestController

@RestController public class InternalProductsRestController extends Object
Internal products service Rest API controller.
  • Field Details

    • API_BASE_PATH

      public static final String API_BASE_PATH
      Base path for internal products Rest API.
      See Also:
    • API_PRODUCT_PATH

      public static final String API_PRODUCT_PATH
      Path for single product Rest API.
      See Also:
    • API_AUTHORITIES

      public static final String API_AUTHORITIES
      Authority (role) required in order to be able to invoke greeting API.
      See Also:
    • jwtService

      @Autowired protected es.kukenan.smartfi.common.service.jwt.JwtService jwtService
      JWT service for create a bearer to call products.
    • productsService

      @Autowired private ProductsService productsService
      Products service.
    • requestContextManager

      @Autowired private es.kukenan.smartfi.common.context.RequestContextManager requestContextManager
      Request context manager.
    • connectedContractCacheOperation

      @Autowired private ConnectedContractCacheOperation connectedContractCacheOperation
      Connected Contract Cache Operation.
    • contractService

      @Autowired private ContractService contractService
      Contract Service.
  • Constructor Details

    • InternalProductsRestController

      public InternalProductsRestController()
  • Method Details

    • findInternalProducts

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_USER\') or hasRole(\'ROLE_ACCESS_AGENT\') or hasRole(\'ROLE_ACCESS_SUPERVISOR\')) and (hasRole(\'ROLE_LEVEL_USER_PWD\') or hasRole(\'ROLE_LEVEL_USER_SCA\'))") @GetMapping(produces="application/json", path="/api/v1/internal/products") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.contracts.api.products.ProductsResponseDto> findInternalProducts(es.kukenan.smartfi.common.security.WalletAuthentication walletAuthentication, @RequestParam(required=false) String byType, @RequestParam(required=false) Boolean withPostedBalance, @RequestParam(required=false) String byStatus, @RequestParam(required=false) String bySignature, @RequestParam(required=false) String byCurrency, @RequestParam(required=false) String byService, @RequestHeader(name="X-SKYLINE-USER-IP",defaultValue="") String userIp)
      Internal products endpoint.
      Parameters:
      walletAuthentication - user credentials.
      byType - types to filter
      withPostedBalance - flag to filter for posted balance
      byStatus - status to filter
      bySignature - signatures to filter
      byCurrency - currency to filter
      byService - service to filter
      userIp - User Ip
      Returns:
      products movements.
    • findInternalProducts

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_USER\') or hasRole(\'ROLE_ACCESS_AGENT\') or hasRole(\'ROLE_ACCESS_SUPERVISOR\')) and (hasRole(\'ROLE_LEVEL_USER_PWD\') or hasRole(\'ROLE_LEVEL_USER_SCA\'))") @GetMapping(produces="application/json", path="/api/v1/internal/products/{productId}") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.contracts.api.products.ProductDto> findInternalProducts(@PathVariable(name="productId") String productId, es.kukenan.smartfi.common.security.WalletAuthentication walletAuthentication)
      Internal products endpoint for defined productId.
      Parameters:
      productId - product id.
      walletAuthentication - user credentials.
      Returns:
      product movement.
    • createBearerToken

      private String createBearerToken(es.kukenan.smartfi.common.security.WalletAuthentication walletAuthentication)