Class VersionController

java.lang.Object
com.skava.price.web.VersionController

@RestController @RequestMapping("/versions") public class VersionController extends Object
The Class VersionController
Author:
Infosys Equinox
  • Field Details

  • Constructor Details

    • VersionController

      public VersionController()
  • Method Details

    • findAllVersion

      @ResponseStatus(OK) @PreAuthorize("hasPrivilegeForServiceAndCollection(\'price/view/pricelist\',\'price\', #collectionId)") @GetMapping public org.springframework.http.ResponseEntity<VersionsAPIResponse> findAllVersion(@RequestHeader(value="x-auth-token",required=true) String authToken, @RequestHeader(value="x-collection-id",required=true) long collectionId, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") String versionId, @RequestParam(value="sort",required=false) com.skava.core.qdsl.sort.EcomSorts sort, @RequestParam(value="filters",required=false) String filters, @RequestParam(value="locale",required=false,defaultValue="en_US") String locale, @RequestParam(value="page",required=false,defaultValue="1") int page, @RequestParam(value="size",required=false,defaultValue="10") int size)
      This method is used to find all Versions based on given VersionRequest.
      Parameters:
      collectionId - This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier.
      authToken - This field holds a valid authorization token generated using the Authorization microservice for an user.Auth token (JWT format) represents claims containing roles and privileges of the user accessing this API. JSON Web Token.
      versionId - This field holds a API version information.
      page - This parameter will be available for all the services that supports pagination. This parameter is used to mention the starting index of the items which going to responded by the API.
      size - This parameter will be available for all the services that supports pagination. This parameter is used to mention the number of maximum items that needs to be responded for the request.
      sort - It contains the parameters for sorting. Example Format : {"sort":[{"field":"status","direction":"ASC"}, {"field":"status","direction":"DESC"}]}
      filters - This field holds the simple query criteria (can be multiple) based on the available fields to limit returned results
      locale - Response would be rendered in the mentioned locale.
      Returns:
      It returns the VersionAPIResponse.
    • getVersionById

      @ResponseStatus(OK) @PreAuthorize("hasPrivilegeForServiceAndCollection(\'price/view/pricelist\',\'price\', #collectionId)") @GetMapping("/{versionId}") public org.springframework.http.ResponseEntity<Version> getVersionById(@RequestHeader(value="x-auth-token",required=true) String authToken, @RequestHeader(value="x-collection-id",required=true) long collectionId, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") String versionId, @RequestParam(value="locale",required=false) String locale, @PathVariable(value="versionId",required=true) long id)
      This method is used to load single Version based on given VersionRequest.
      Parameters:
      collectionId - This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier.
      authToken - This field holds a valid authorization token generated using the Authorization microservice for an user.Auth token (JWT format) represents claims containing roles and privileges of the user accessing this API. JSON Web Token.
      versionId - This field holds a API version information.
      locale - Response would be rendered in the mentioned locale.
      id - It contains identifier of Version.
      Returns:
      It returns the VersionAPIResponse.
    • initBinder

      @InitBinder public void initBinder(org.springframework.web.bind.WebDataBinder binder)