Class ProductDetailsEndpoint
java.lang.Object
com.broadleafcommerce.catalog.web.endpoint.commerce.ProductDetailsEndpoint
@FrameworkRestController
@FrameworkMapping("/product-details")
@DataRouteByExample(ProductDetails.class)
public class ProductDetailsEndpoint
extends Object
- Author:
- Nathan Moore (nathandmoore)
-
Constructor Summary
ConstructorDescriptionProductDetailsEndpoint
(ProductDetailsService productDetailsService, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected ProductDetailsService
protected com.broadleafcommerce.common.extension.TypeFactory
readAssetsForProducts
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, cz.jirutka.rsql.parser.ast.Node filters, List<String> productIds) org.springframework.http.ResponseEntity<ProductDetailsList>
readDetailsForRequests
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, ProductDetailsRequest productDetailsRequest) Returns aProductDetails
for the givenProductDetailsRequest
.readTagsForProducts
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, cz.jirutka.rsql.parser.ast.Node filters, List<String> productIds)
-
Constructor Details
-
ProductDetailsEndpoint
public ProductDetailsEndpoint(ProductDetailsService productDetailsService, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
readDetailsForRequests
@FrameworkGetMapping public org.springframework.http.ResponseEntity<ProductDetailsList> readDetailsForRequests(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, ProductDetailsRequest productDetailsRequest) Returns aProductDetails
for the givenProductDetailsRequest
. If the request is missing or has insufficient information (e.g., is missingProductDetailsRequest.getProductUris()
), then this returns a 400 error. If no product matches the request, then this returns a 404.- Parameters:
request
- AHttpServletRequest
context
- Context info for multitenant and sandbox conditionsproductDetailsRequest
- theProductDetailsRequest
with additional request context for identifying the products for which to retrieve details and defining the how much detail to go into.- Returns:
- a
ProductDetails
for the givenProductDetailsRequest
-
readAssetsForProducts
@FrameworkPostMapping(value="/assets", consumes="application/json") public Map<String,List<ProductAsset>> readAssetsForProducts(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, cz.jirutka.rsql.parser.ast.Node filters, @RequestBody List<String> productIds) -
readTagsForProducts
@FrameworkPostMapping(value="/tags", consumes="application/json") public Map<String,List<ProductTagDetail>> readTagsForProducts(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, cz.jirutka.rsql.parser.ast.Node filters, @RequestBody List<String> productIds) -
getProductDetailsService
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-