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, VERSION
-
Fields inherited from class de.hybris.platform.webservicescommons.controllers.AbstractController
CATALOG_PATH
-
-
Constructor Summary
Constructors Constructor Description CustomerSegmentationController(CustomerSegmentationFacade csFacade, org.springframework.validation.Validator segmentationIdValidator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<CustomerSegmentationData>
create(CustomerSegmentationData customerSegmentation, org.springframework.web.util.UriComponentsBuilder builder)
Creates relation between customer and segmentprotected CustomerSegmentationListWsDTO
createListDTO(SearchPageData<CustomerSegmentationData> segmentations)
void
delete(java.lang.String segmentationId)
Removes relation between customer and segmentCustomerSegmentationData
getCustomerSegmentation(java.lang.String segmentationId)
Returns relation between customer and segmentCustomerSegmentationListWsDTO
getCustomerSegmentations(java.lang.String customerId, java.lang.String segmentId, java.lang.String baseSite, java.util.Map<java.lang.String,java.lang.String> requestParams)
Method for searching customersegmentation objects based on given parametersCustomerSegmentationData
update(java.lang.String segmentationId, CustomerSegmentationData data)
Updates relation between customer and segment-
Methods inherited from class de.hybris.platform.webservicescommons.controllers.AbstractController
executeAndConvertException, executeAndConvertException, getBindingResult, getLocationHeader, getWebPaginationUtils, setWebPaginationUtils, validate, validate, validateInputCode, validateResponse
-
-
-
-
Constructor Detail
-
CustomerSegmentationController
@Autowired public CustomerSegmentationController(CustomerSegmentationFacade csFacade, org.springframework.validation.Validator segmentationIdValidator)
-
-
Method Detail
-
getCustomerSegmentations
@RequestMapping(value="/v1/customersegmentations", method=GET) public CustomerSegmentationListWsDTO getCustomerSegmentations(@RequestParam(required=false) java.lang.String customerId, @RequestParam(required=false) java.lang.String segmentId, @RequestParam(required=false) java.lang.String baseSite, @RequestParam(required=false) java.util.Map<java.lang.String,java.lang.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) @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 java.lang.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) public CustomerSegmentationData update(@PathVariable java.lang.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 java.lang.String segmentationId)
Removes relation between customer and segment- Throws:
NotFoundException
- When there is no relation with given identifier
-
-