Package com.skava.oms.web
Class CollectionController
java.lang.Object
com.skava.oms.web.CollectionController
This class defines the controller implementations to handle
the collection request.
- Author:
- Infosys Equinox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<CollectionDTO>
createCollection
(long businessId, String version, String locale, CollectionDTO collection) org.springframework.http.ResponseEntity<CollectionsResponse>
getAllCollections
(long businessId, String version, String locale, int page, int size, String filters, String sort) This method is used to find all Collections based on given CollectionRequest.org.springframework.http.ResponseEntity<CollectionDTO>
getCollectionById
(long businessId, String version, String locale, long collectionId) This method is used to load single collection based on given CollectionRequest.org.springframework.http.ResponseEntity<CollectionDTO>
updateCollection
(long businessId, String version, String locale, long collectionId, CollectionDTO collection) This method is used to update all field in Collection based on given CollectionRequest.
-
Constructor Details
-
CollectionController
public CollectionController()
-
-
Method Details
-
createCollection
@PostMapping("") @PreAuthorize("hasPrivilegeForBusinessById(\'oms/create/collection\', #businessId)") public org.springframework.http.ResponseEntity<CollectionDTO> createCollection(@RequestParam(value="businessId",required=true) long businessId, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") String version, @RequestHeader(value="locale",required=false) String locale, @RequestBody(required=true) CollectionDTO collection) -
getCollectionById
@GetMapping("/{collectionId}") @PreAuthorize("hasPrivilegeForServiceAndCollection(\'oms/view/collection\', #businessId, \'oms\', #collectionId)") public org.springframework.http.ResponseEntity<CollectionDTO> getCollectionById(@RequestParam(value="businessId",required=false) long businessId, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") String version, @RequestHeader(value="locale",required=false) String locale, @PathVariable(value="collectionId",required=true) long collectionId) This method is used to load single collection based on given CollectionRequest.- Parameters:
businessId
- It contains the business id.version
- It contains value of the API version.locale
- It contains value of user locale.collectionId
- It refers to load of Collection.- Returns:
- It returns the
CollectionResponse
.
-
getAllCollections
@GetMapping("") @PreAuthorize("hasPrivilegeForBusinessById(\'oms/viewall/collection\', #businessId)") public org.springframework.http.ResponseEntity<CollectionsResponse> getAllCollections(@RequestParam(value="businessId",required=false,defaultValue="0") long businessId, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") String version, @RequestHeader(value="locale",required=false) String locale, @RequestParam(value="page",required=false,defaultValue="1") int page, @RequestParam(value="size",required=false,defaultValue="100") int size, @RequestParam(value="filters",required=false) String filters, @RequestParam(value="sort",required=false) String sort) This method is used to find all Collections based on given CollectionRequest.- Parameters:
businessId
- It contains the business id.version
- It contains value of the API version.locale
- It contains value of user locale.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.filters
- This parameter contains the filterssort
- This parameter explains on which param, the result to be sorted- Returns:
- It returns the
CollectionResponse
.
-
updateCollection
@PutMapping("/{collectionId}") @PreAuthorize("hasPrivilegeForServiceAndCollection(\'oms/update/collection\', #businessId, \'oms\', #collectionId)") public org.springframework.http.ResponseEntity<CollectionDTO> updateCollection(@RequestParam(value="businessId",required=true) long businessId, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") String version, @RequestHeader(value="locale",required=false) String locale, @PathVariable(value="collectionId",required=true) long collectionId, @RequestBody(required=true) CollectionDTO collection) This method is used to update all field in Collection based on given CollectionRequest.- Parameters:
businessId
- It contains the business id.version
- It contains value of the API version.locale
- It contains value of user locale.collectionId
- It refers to update Collection id.collection
- It contains the attributes required for the update all field in Collection.- Returns:
- It returns the
CollectionResponse
.
-