Class VariantEndpoint
java.lang.Object
com.broadleafcommerce.catalog.web.endpoint.VariantEndpoint
@FrameworkRestController
@FrameworkMapping("/products/{productId}/variants")
@DataRouteByExample(Variant.class)
public class VariantEndpoint
extends Object
Endpoints that only deal with
Variant
s. Most of the time, Variant
operations are
done solely within the context of a Product- Author:
- Phillip Verheyden (phillipuniverse)
-
Constructor Summary
ConstructorDescriptionVariantEndpoint
(VariantService<Variant> variantSvc, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService) -
Method Summary
Modifier and TypeMethodDescriptioncreateVariant
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String productId, Variant req) void
deleteVariant
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String productId, String variantId) org.springframework.data.domain.Page<Variant>
getAllProductVariants
(String productId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation>
protected VariantService<Variant>
readVariantById
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String variantId) com.broadleafcommerce.translation.service.dto.TranslationsPayload
replaceAllVariantTranslations
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String productId, String variantId, Locale locale, com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest) replaceVariant
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String productId, String variantId, Variant req) updateVariant
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String productId, String variantId, Variant req)
-
Constructor Details
-
VariantEndpoint
public VariantEndpoint(VariantService<Variant> variantSvc, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService)
-
-
Method Details
-
getAllProductVariants
@FrameworkGetMapping @Policy(permissionRoots="PRODUCT") public org.springframework.data.domain.Page<Variant> getAllProductVariants(@PathVariable("productId") String productId, cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context) -
readVariantById
-
replaceVariant
@FrameworkPutMapping(value="/{variantId}", consumes="application/json") @Policy(permissionRoots="PRODUCT") public Variant replaceVariant(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("productId") String productId, @PathVariable("variantId") String variantId, @RequestBody Variant req) -
replaceAllVariantTranslations
@FrameworkPutMapping(value="/{variantId}/translations/{locale}", consumes="application/json") @Policy(permissionRoots="PRODUCT") public com.broadleafcommerce.translation.service.dto.TranslationsPayload replaceAllVariantTranslations(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("productId") String productId, @PathVariable("variantId") String variantId, @PathVariable("locale") Locale locale, @RequestBody com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest) -
updateVariant
@FrameworkPatchMapping(value="/{variantId}", consumes="application/json") @Policy(permissionRoots="PRODUCT") public Variant updateVariant(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("productId") String productId, @PathVariable("variantId") String variantId, @RequestBody Variant req) -
createVariant
@FrameworkPostMapping(consumes="application/json") @Policy(permissionRoots="PRODUCT") public Variant createVariant(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("productId") String productId, @RequestBody Variant req) -
deleteVariant
@FrameworkDeleteMapping("/{variantId}") @Policy(permissionRoots="PRODUCT") public void deleteVariant(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("productId") String productId, @PathVariable("variantId") String variantId) -
getVariantSvc
-
getTranslationEntityService
protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> getTranslationEntityService()
-