Package com.skava.oms.web
Class CollectionPropertiesController
java.lang.Object
com.skava.oms.web.CollectionPropertiesController
@RestController
@Validated
@RequestMapping("/collections/{collectionId}/properties")
public class CollectionPropertiesController
extends Object
This class defines the controller implementations to handle
the collection properties request.
- Author:
- Infosys Equinox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<CollectionPropertiesDTO>
getCollectionPropertyById
(long businessId, String version, String locale, long collectionId, String name) This method is used to load single CollectionProperty based on given CollectionPropertyRequest.org.springframework.http.ResponseEntity<Object>
getCollectionPropertyByIdAndName
(long businessId, String version, String locale, long collectionId, String name) This method is used to load single CollectionProperty based on given CollectionPropertyRequest.org.springframework.http.ResponseEntity<Collection<CollectionPropertiesDTO>>
updateCollectionProperties
(long businessId, String version, String locale, long collectionId, @Valid @NotEmpty CollectionPropertiesDTO[] collectionProperties) This method is used to update CollectionProperties based on given CollectionPropertyRequest.org.springframework.http.ResponseEntity<Collection<CollectionPropertiesDTO>>
updateCollectionProperty
(long businessId, String version, String locale, long collectionId, @Valid @NotEmpty CollectionPropertiesDTO[] collectionProperties) This method is used to update CollectionProperty based on given CollectionPropertyRequest.org.springframework.http.ResponseEntity<Object>
updateCollectionPropertyByName
(long businessId, String version, String locale, long collectionId, String collectionPropertyName, String collectionPropertyValue) This method is used to update CollectionProperty value on given collection attribute.
-
Constructor Details
-
CollectionPropertiesController
public CollectionPropertiesController()
-
-
Method Details
-
getCollectionPropertyById
@GetMapping("/{name}") @PreAuthorize("hasPrivilegeForServiceAndCollection(\'oms/view/collectionproperty\', #businessId, \'oms\', #collectionId)") public org.springframework.http.ResponseEntity<CollectionPropertiesDTO> getCollectionPropertyById(@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, @PathVariable(value="name",required=true) String name) This method is used to load single CollectionProperty based on given CollectionPropertyRequest.- Parameters:
businessId
- contains the businessIdversion
- It contains value of the API version.locale
- It contains value of user locale.collectionId
- It contains the id of collection.name
- It refers to load of CollectionProperty.- Returns:
- It returns the
CollectionPropertyDTO
. It will throw Ecommerce exception if it process get failed.
-
updateCollectionProperty
@PatchMapping @PreAuthorize("hasPrivilegeForServiceAndCollection(\'oms/update/collectionproperty\', #businessId, \'oms\', #collectionId)") public org.springframework.http.ResponseEntity<Collection<CollectionPropertiesDTO>> updateCollectionProperty(@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) @Valid @NotEmpty @Valid @NotEmpty CollectionPropertiesDTO[] collectionProperties) This method is used to update CollectionProperty based on given CollectionPropertyRequest. It will return created collection property as response.- Parameters:
businessId
- contains the businessIdversion
- It contains value of the API version.locale
- It contains value of user locale.collectionId
- It contains the id of collection.collectionProperties
- It contains the attributes required for the creation of CollectionPropertiesDTO.- Returns:
- It returns the
CollectionPropertiesDTO
.
-
updateCollectionProperties
@PutMapping @PreAuthorize("hasPrivilegeForServiceAndCollection(\'oms/update/collectionproperty\', #businessId, \'oms\', #collectionId)") public org.springframework.http.ResponseEntity<Collection<CollectionPropertiesDTO>> updateCollectionProperties(@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) @Valid @NotEmpty @Valid @NotEmpty CollectionPropertiesDTO[] collectionProperties) This method is used to update CollectionProperties based on given CollectionPropertyRequest. It will return created collection property as response.- Parameters:
businessId
- contains the businessIdversion
- It contains value of the API version.locale
- It contains value of user locale.collectionId
- It contains the id of collection.businessId
- It contains the id of business.collectionProperties
- It contains the attributes required for the creation of CollectionPropertiesDTO.- Returns:
- It returns the
CollectionPropertiesDTO
. It will throw EcommerceException if it process get failed.
-
getCollectionPropertyByIdAndName
@GetMapping("/{name}/value") @PreAuthorize("hasPrivilegeForServiceAndCollection(\'oms/view/collectionproperty\', #businessId, \'oms\', #collectionId)") public org.springframework.http.ResponseEntity<Object> getCollectionPropertyByIdAndName(@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, @PathVariable(value="name",required=true) String name) This method is used to load single CollectionProperty based on given CollectionPropertyRequest.- Parameters:
businessId
- contains the businessIdversion
- It contains value of the API version.locale
- It contains value of user locale.collectionId
- It contains the id of collection.name
- It refers to load of CollectionProperty.- Returns:
- It returns the
CollectionPropertyDTO
. It will throw Ecommerce exception if it process get failed.
-
updateCollectionPropertyByName
@PatchMapping("/{name}/value") @PreAuthorize("hasPrivilegeForServiceAndCollection(\'oms/update/collectionproperty\', #businessId, \'oms\', #collectionId)") public org.springframework.http.ResponseEntity<Object> updateCollectionPropertyByName(@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, @PathVariable(value="name",required=true) String collectionPropertyName, @RequestBody(required=true) String collectionPropertyValue) This method is used to update CollectionProperty value on given collection attribute. It will return created collection property as response.- Parameters:
businessId
- contains the businessIdversion
- It contains value of the API version.locale
- It contains value of user locale.collectionId
- It contains the id of collection.collectionPropertyName
- It contains the attribute name to be updated in the collection.collectionPropertyValue
- It contains the attribute value to be updated in the collection.- Returns:
- It returns the value
Object
.
-