@Path(value="shops/{shopId}/carts")
public final class CartResource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private OrderService |
orderService |
private CartService |
service |
private ShopRequestContextService |
shopService |
Constructor and Description |
---|
CartResource(ShopRequestContextService shopService,
CartService service,
OrderService orderService) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
create(java.lang.String shopId,
CartInput cartIn)
Creates a cart for the specified shop
|
javax.ws.rs.core.Response |
createOrderForCart(java.lang.String shopId,
GUID cartId) |
javax.ws.rs.core.Response |
get(java.lang.String shopId,
GUID cartId)
Fetches a specified cart from the specified shop
|
private final CartService service
private final OrderService orderService
private final ShopRequestContextService shopService
@Inject public CartResource(ShopRequestContextService shopService, CartService service, OrderService orderService)
@POST @Produces(value="application/vnd.epages.v1+json, application/json") @Consumes(value="application/json") @RolesAllowed(value={"sf","products_read"}) public javax.ws.rs.core.Response create(@PathParam(value="shopId") java.lang.String shopId, CartInput cartIn)
shopId
- Unique identifier of the shopcartIn
- Cart creation input@GET @Path(value="{cartId}") @Produces(value="application/vnd.epages.v1+json, application/json") @RolesAllowed(value={"sf","carts_read"}) public javax.ws.rs.core.Response get(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="cartId") GUID cartId)
shopId
- Unique identifier of the shopcartId
- Unique identifier of the cart@POST @Path(value="{cartId}/order") @Produces(value="application/vnd.epages.v1+json, application/json") @RolesAllowed(value="orders_write") @Consumes(value="application/json") public javax.ws.rs.core.Response createOrderForCart(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="cartId") GUID cartId)