@Path(value="shops/{shopId}/categories")
@RolesAllowed(value={"sf","products_read"})
public final class CategoryResource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private CategoryService |
service |
private ShopRequestContextService |
shopService |
Constructor and Description |
---|
CategoryResource(CategoryService service,
ShopRequestContextService shopService) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
get(java.lang.String shopId,
GUID categoryId,
java.util.Locale locale)
Returns the category identified by the provided category id.
|
javax.ws.rs.core.Response |
getRootCategories(java.lang.String shopId,
java.util.Locale locale)
Returns the root categories of the shop.
|
javax.ws.rs.core.Response |
saveCategory(java.lang.String shopId,
GUID categoryId,
java.util.Locale locale,
Category category) |
private final CategoryService service
private final ShopRequestContextService shopService
@Inject public CategoryResource(CategoryService service, ShopRequestContextService shopService)
@GET @Produces(value="application/vnd.epages.v1+json, application/json") public javax.ws.rs.core.Response getRootCategories(@PathParam(value="shopId") java.lang.String shopId, @QueryParam(value="locale") java.util.Locale locale)
shopId
- The id of the shop.locale
- The ISO 639-1 for language code and ISO 3166-1 for country code. (Example: de_DE).@GET @Path(value="/{categoryId}") @Produces(value="application/vnd.epages.v1+json, application/json") public javax.ws.rs.core.Response get(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="categoryId") GUID categoryId, @QueryParam(value="locale") java.util.Locale locale)
shopId
- The id of the shop.categoryId
- The category id (GUID)locale
- The ISO 639-1 for language code and ISO 3166-1 for country code. (Example: de_DE).@PUT @Path(value="{categoryId}") @Produces(value="application/vnd.epages.v1+json, application/json") @Consumes(value="application/json") @RolesAllowed(value="products_write") public javax.ws.rs.core.Response saveCategory(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="categoryId") GUID categoryId, @QueryParam(value="locale") java.util.Locale locale, @NotNull Category category)