Class PromotionsController
java.lang.Object
de.hybris.platform.ycommercewebservices.v1.controller.BaseController
de.hybris.platform.ycommercewebservices.v1.controller.PromotionsController
@Controller("promotionsControllerV1")
@RequestMapping("/{baseSiteId}/promotions")
public class PromotionsController
extends BaseController
Main Controller for Promotions
-
Field Summary
Fields inherited from class de.hybris.platform.ycommercewebservices.v1.controller.BaseController
DEFAULT_CURRENT_PAGE, DEFAULT_PAGE_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Set<PromotionOption>extractOptions(String options) getPromotionByCode(String code, String options) Web service handler for the getPromotionByCode call.protected List<PromotionData>getPromotionList(String type) protected List<PromotionData>getPromotionList(String type, String promotionGroup) getPromotions(String type, String promotionGroup) protected voidvalidateTypeParameter(String type) Methods inherited from class de.hybris.platform.ycommercewebservices.v1.controller.BaseController
handleErrorInternal, handleModelNotFoundException, sanitize
-
Constructor Details
-
PromotionsController
public PromotionsController()
-
-
Method Details
-
getPromotions
@Secured("ROLE_TRUSTED_CLIENT") @RequestMapping(method=GET) @ResponseBody public PromotionDataList getPromotions(@RequestParam String type, @RequestParam(required=false) String promotionGroup) throws RequestParameterException - Throws:
RequestParameterException
-
getPromotionByCode
@Secured("ROLE_TRUSTED_CLIENT") @RequestMapping(value="/{code}", method=GET) @ResponseBody public PromotionData getPromotionByCode(@PathVariable String code, @RequestParam(required=false) String options) Web service handler for the getPromotionByCode call. The options are turned into a Setand passed on to the facade. BASIC is included by default.
Sample Call: https://localhost:9002/rest/v1/{SITE}/promotions/{CODE}?options=BASIC%2CEXTENDED
Keep in mind ',' needs to be encoded as %2C- Parameters:
code- - the unique code used to identify a promotionoptions- - a String enumerating the detail level, values are BASIC (included by default), EXTENDED. Combine by using a ',', which needs to be encoded as part of a URI using URLEncoding: %2C.- Returns:
- the
PromotionDatawhich will be marshaled to JSON or XML based on Accept-Header
-
validateTypeParameter
- Throws:
RequestParameterException
-
getPromotionList
-
getPromotionList
-
extractOptions
-
getCommercePromotionFacade
-