Package com.skava.price.web
Class VersionController
java.lang.Object
com.skava.price.web.VersionController
The Class VersionController
- Author:
- Infosys Equinox
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<VersionsAPIResponse>
findAllVersion
(String authToken, long collectionId, String versionId, com.skava.core.qdsl.sort.EcomSorts sort, String filters, String locale, int page, int size) This method is used to find all Versions based on given VersionRequest.org.springframework.http.ResponseEntity<Version>
getVersionById
(String authToken, long collectionId, String versionId, String locale, long id) This method is used to load single Version based on given VersionRequest.void
initBinder
(org.springframework.web.bind.WebDataBinder binder)
-
Field Details
-
PAGE_CONSTANT
public static final int PAGE_CONSTANT- See Also:
-
-
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 resultslocale
- 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)
-