@Path(value="shops/{shopId}/carts")
@RolesAllowed(value={"sf","carts_write"})
public final class CartLineItemResource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private CartService |
cartService |
private ShopRequestContextService |
shopReqCtxService |
Constructor and Description |
---|
CartLineItemResource(ShopRequestContextService shopReqCtxService,
CartService cartService) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
createLineItem(java.lang.String shopId,
GUID cartId,
LineItemInput item)
Creates an item in the specified cart
|
javax.ws.rs.core.Response |
deleteLineItem(java.lang.String shopId,
GUID cartId,
GUID lineItemId)
Deletes a specified line item from the cart
|
javax.ws.rs.core.Response |
updateLineItem(java.lang.String shopId,
GUID cartId,
GUID lineItemId,
LineItemInput item)
Modifies a specified line item in the cart
|
private final ShopRequestContextService shopReqCtxService
private final CartService cartService
@Inject public CartLineItemResource(ShopRequestContextService shopReqCtxService, CartService cartService)
@POST @Path(value="{cartId}/line-items") @Produces(value="application/vnd.epages.v1+json, application/json") @Consumes(value="application/json") public javax.ws.rs.core.Response createLineItem(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="cartId") GUID cartId, LineItemInput item)
shopId
- Unique identifier of the shopcartId
- Unique identifier of the cartitem
- entity provided as JSON@PUT @Path(value="{cartId}/line-items/{lineItemId}") @Produces(value="application/vnd.epages.v1+json, application/json") @Consumes(value="application/json") public javax.ws.rs.core.Response updateLineItem(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="cartId") GUID cartId, @PathParam(value="lineItemId") GUID lineItemId, LineItemInput item)
shopId
- Unique identifier of the shopcartId
- Unique identifier of the cartlineItemId
- Unique identifier of the line itemitem
- entity provided as JSON@DELETE @Path(value="{cartId}/line-items/{lineItemId}") @Produces(value="application/vnd.epages.v1+json, application/json") public javax.ws.rs.core.Response deleteLineItem(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="cartId") GUID cartId, @PathParam(value="lineItemId") GUID lineItemId)
shopId
- Unique identifier of the shopcartId
- Unique identifier of the cartlineItemId
- Unique identifier of the line item