Class SegmentController
java.lang.Object
de.hybris.platform.webservicescommons.controllers.AbstractController
de.hybris.platform.personalizationwebservices.controllers.PersonalizationAbstractController
de.hybris.platform.personalizationwebservices.controllers.SegmentController
-
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
ConstructorsConstructorDescriptionSegmentController(SegmentFacade cxSegmentFacade, org.springframework.validation.Validator segmentValidator) -
Method Summary
Modifier and TypeMethodDescriptionprotected SegmentListWsDTOcreateListDTO(SearchPageData<SegmentData> segments) org.springframework.http.ResponseEntity<SegmentData>createSegment(SegmentData segment, org.springframework.web.util.UriComponentsBuilder builder) Creates segmentvoiddeleteSegment(String segmentCode) Removes segment with given codegetSegment(String segmentCode) Returns segment with given codegetSegments(Map<String, String> requestParams) Returns all segments from the systemupdateSegment(String segmentCode, SegmentData segment) Updates segment with given codeprotected voidvalidateSegment(SegmentData segment) Methods inherited from class de.hybris.platform.webservicescommons.controllers.AbstractController
executeAndConvertException, executeAndConvertException, getBindingResult, getLocationHeader, getWebPaginationUtils, setWebPaginationUtils, validate, validate, validateInputCode, validateResponse
-
Constructor Details
-
SegmentController
@Autowired public SegmentController(SegmentFacade cxSegmentFacade, org.springframework.validation.Validator segmentValidator)
-
-
Method Details
-
getSegments
@GetMapping("/v1/segments") public SegmentListWsDTO getSegments(@RequestParam Map<String, String> requestParams) Returns all segments from the system- Returns:
- List with all segments in the system
-
createListDTO
-
createSegment
@PostMapping(value="/v1/segments", consumes={"application/json","application/xml"}) @ResponseStatus(CREATED) public org.springframework.http.ResponseEntity<SegmentData> createSegment(@RequestBody SegmentData segment, org.springframework.web.util.UriComponentsBuilder builder) Creates segment- Returns:
- created segment
- Throws:
AlreadyExistsException- if segment with given code already existsWebserviceValidationException- if provided segment data is invalid
-
getSegment
@GetMapping("/v1/segments/{segmentCode}") public SegmentData getSegment(@PathVariable String segmentCode) Returns segment with given code- Returns:
- segmetn with given code
- Throws:
NotFoundException- if segment with given code does not exists
-
updateSegment
@PutMapping(value="/v1/segments/{segmentCode}", consumes={"application/json","application/xml"}) public SegmentData updateSegment(@PathVariable String segmentCode, @RequestBody SegmentData segment) Updates segment with given code- Returns:
- updated segment
- Throws:
WebserviceValidationException- if provided data is invalidNotFoundException- if segment with given code does not exists
-
deleteSegment
@DeleteMapping("/v1/segments/{segmentCode}") @ResponseStatus(NO_CONTENT) public void deleteSegment(@PathVariable String segmentCode) Removes segment with given code- Throws:
NotFoundException- if segment with given code does not exists
-
validateSegment
-