Class CartNoteOperationEndpoint
java.lang.Object
com.broadleafcommerce.cartoperation.web.endpoint.CartNoteOperationEndpoint
@FrameworkRestController
@FrameworkMapping("/cart-notes/{cartId}")
public class CartNoteOperationEndpoint
extends Object
Endpoint for
CartNote
management.- Author:
- Sunny Yu
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCartNoteOperationEndpoint
(CartResolverService cartResolverService, CartNoteOperationService<com.broadleafcommerce.cart.client.domain.CartNote> cartNoteOperationService) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
cartNotFoundMessage
(String cartId) com.broadleafcommerce.cart.client.domain.CartNote
createCartItemLevelNote
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, String cartId, String cartItemId, com.broadleafcommerce.cart.client.domain.CartNote cartNote) com.broadleafcommerce.cart.client.domain.CartNote
createCartLevelNote
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, String cartId, com.broadleafcommerce.cart.client.domain.CartNote cartNote) void
deleteNote
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, String cartId, String noteId) protected CartNoteOperationService<com.broadleafcommerce.cart.client.domain.CartNote>
protected CartResolverService
protected com.broadleafcommerce.common.extension.TypeFactory
org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.CartNote>
readByCartId
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, String cartId, boolean cartLevelOnly, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable) org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.CartNote>
readByCartItemId
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, String cartId, String cartItemId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable) com.broadleafcommerce.cart.client.domain.CartNote
replace
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, String cartId, String noteId, com.broadleafcommerce.cart.client.domain.CartNote cartNote) protected com.broadleafcommerce.cart.client.domain.Cart
resolveCart
(@NonNull String cartId, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) ResolvesCart
by the given cart id.void
setTypeFactory
(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
Field Details
-
BASE_URI
- See Also:
-
-
Constructor Details
-
CartNoteOperationEndpoint
public CartNoteOperationEndpoint(CartResolverService cartResolverService, CartNoteOperationService<com.broadleafcommerce.cart.client.domain.CartNote> cartNoteOperationService)
-
-
Method Details
-
createCartLevelNote
@FrameworkPostMapping public com.broadleafcommerce.cart.client.domain.CartNote createCartLevelNote(@ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @PathVariable String cartId, @RequestBody com.broadleafcommerce.cart.client.domain.CartNote cartNote) -
createCartItemLevelNote
@FrameworkPostMapping("/items/{cartItemId}") public com.broadleafcommerce.cart.client.domain.CartNote createCartItemLevelNote(@ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @PathVariable String cartId, @PathVariable String cartItemId, @RequestBody com.broadleafcommerce.cart.client.domain.CartNote cartNote) -
readByCartId
@FrameworkGetMapping public org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.CartNote> readByCartId(@ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @PathVariable String cartId, @RequestParam(required=false,defaultValue="false") boolean cartLevelOnly, cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50,sort="dateCreated",direction=DESC) org.springframework.data.domain.Pageable pageable) -
readByCartItemId
@FrameworkGetMapping("/items/{cartItemId}") public org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.CartNote> readByCartItemId(@ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @PathVariable String cartId, @PathVariable String cartItemId, cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50,sort="dateCreated",direction=DESC) org.springframework.data.domain.Pageable pageable) -
replace
@FrameworkPutMapping("/notes/{noteId}") public com.broadleafcommerce.cart.client.domain.CartNote replace(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @PathVariable String cartId, @PathVariable String noteId, @RequestBody com.broadleafcommerce.cart.client.domain.CartNote cartNote) -
deleteNote
-
resolveCart
protected com.broadleafcommerce.cart.client.domain.Cart resolveCart(@NonNull @NonNull String cartId, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) ResolvesCart
by the given cart id.This is used to ensure that the
Cart
that theCartNote
is being added for is owned by the givenCustomerRef
. -
cartNotFoundMessage
-
getCartResolverService
-
getCartNoteOperationService
protected CartNoteOperationService<com.broadleafcommerce.cart.client.domain.CartNote> getCartNoteOperationService() -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
setTypeFactory
@Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-