Class CustomerSegmentationController
java.lang.Object
de.hybris.platform.webservicescommons.controllers.AbstractController
de.hybris.platform.personalizationwebservices.controllers.PersonalizationAbstractController
de.hybris.platform.personalizationwebservices.controllers.CustomerSegmentationController
@RestController
public class CustomerSegmentationController
extends PersonalizationAbstractController
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.webservicescommons.controllers.AbstractController
AbstractController.Executor -
Field Summary
Fields inherited from class de.hybris.platform.personalizationwebservices.controllers.PersonalizationAbstractController
BASE_URL, VERSIONFields inherited from class de.hybris.platform.webservicescommons.controllers.AbstractController
CATALOG_PATH -
Constructor Summary
ConstructorsConstructorDescriptionCustomerSegmentationController(CustomerSegmentationFacade cxCustomerSegmentationFacade, org.springframework.validation.Validator segmentationIdValidator) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<CustomerSegmentationData>create(CustomerSegmentationData customerSegmentation, org.springframework.web.util.UriComponentsBuilder builder) Creates relation between customer and segmentprotected CustomerSegmentationListWsDTOcreateListDTO(SearchPageData<CustomerSegmentationData> segmentations) voidRemoves relation between customer and segmentgetCustomerSegmentation(String segmentationId) Returns relation between customer and segmentgetCustomerSegmentations(String customerId, String segmentId, String baseSite, Map<String, String> requestParams) Method for searching customersegmentation objects based on given parametersupdate(String segmentationId, CustomerSegmentationData data) Updates relation between customer and segmentMethods inherited from class de.hybris.platform.webservicescommons.controllers.AbstractController
executeAndConvertException, executeAndConvertException, getBindingResult, getLocationHeader, getWebPaginationUtils, setWebPaginationUtils, validate, validate, validateInputCode, validateResponse
-
Constructor Details
-
CustomerSegmentationController
@Autowired public CustomerSegmentationController(CustomerSegmentationFacade cxCustomerSegmentationFacade, org.springframework.validation.Validator segmentationIdValidator)
-
-
Method Details
-
getCustomerSegmentations
@RequestMapping(value="/v1/customersegmentations", method=GET) public CustomerSegmentationListWsDTO getCustomerSegmentations(@RequestParam(required=false) String customerId, @RequestParam(required=false) String segmentId, @RequestParam(required=false) String baseSite, @RequestParam(required=false) Map<String, String> requestParams) Method for searching customersegmentation objects based on given parameters- Returns:
- list of found relations or object with empty list
-
createListDTO
protected CustomerSegmentationListWsDTO createListDTO(SearchPageData<CustomerSegmentationData> segmentations) -
create
@RequestMapping(value="/v1/customersegmentations", method=POST, consumes={"application/json","application/xml"}) @ResponseStatus(CREATED) public org.springframework.http.ResponseEntity<CustomerSegmentationData> create(@RequestBody CustomerSegmentationData customerSegmentation, org.springframework.web.util.UriComponentsBuilder builder) Creates relation between customer and segment- Parameters:
customerSegmentation- Request body parameter (DTO in xml or json format) which contains customer and segment identifiers.- Throws:
AlreadyExistsException- When relation between customer and segment already existsWebserviceValidationException- When customer or segment identifier is invalid (empty or object not exists)NotFoundException- When customer or segment with given identifier doesn't exist
-
getCustomerSegmentation
@RequestMapping(value="/v1/customersegmentations/{segmentationId}", method=GET) public CustomerSegmentationData getCustomerSegmentation(@PathVariable String segmentationId) Returns relation between customer and segment- Returns:
- information about relation between customer and segment
- Throws:
NotFoundException- When there is no relation with given identifierWebserviceValidationException- When identifier is invalid (have not supported format)
-
update
@RequestMapping(value="/v1/customersegmentations/{segmentationId}", method=PUT, consumes={"application/json","application/xml"}) public CustomerSegmentationData update(@PathVariable String segmentationId, @RequestBody CustomerSegmentationData data) Updates relation between customer and segment- Returns:
- Updated relation
- Throws:
WebserviceValidationException- When customer or segment identifier is invalid (empty or object not exists)NotFoundException- When there is no relation with given identifier
-
delete
@RequestMapping(value="/v1/customersegmentations/{segmentationId}", method=DELETE) @ResponseStatus(NO_CONTENT) public void delete(@PathVariable String segmentationId) Removes relation between customer and segment- Throws:
NotFoundException- When there is no relation with given identifier
-