diff --git a/00-backend/src/main/java/de/htwsaar/webshop/config/ControllerPathConfig.java b/00-backend/src/main/java/de/htwsaar/webshop/config/ControllerPathConfig.java index 46d1399..fb4b36b 100644 --- a/00-backend/src/main/java/de/htwsaar/webshop/config/ControllerPathConfig.java +++ b/00-backend/src/main/java/de/htwsaar/webshop/config/ControllerPathConfig.java @@ -8,14 +8,11 @@ public class ControllerPathConfig { //ErrorController public static final String ERROR = "/error"; - //ItemController - public static final String ARTICLE_ADD = "/item"; - public static final String ARTICLE_GET = "/item"; - public static final String ARTICLE_UPDATE = "/item"; - public static final String ARTICLE_DELETE = "/item"; - public static final String ARTICLE_GET_ALL = "/item/all"; + //ArticleController + public static final String ARTICLE_BASE = "/item"; + public static final String ARTICLE_GET_ALL = ARTICLE_BASE + "/all"; //ImageController - public static final String IMAGE_BASE = "/image"; - public static final String IMAGE_ADD = "/image/add"; -} + private static final String IMAGE_BASE = "/image"; + public static final String IMAGE_GET_ALL = IMAGE_BASE + "/all"; +} \ No newline at end of file diff --git a/00-backend/src/main/java/de/htwsaar/webshop/controller/ArticleController.java b/00-backend/src/main/java/de/htwsaar/webshop/controller/ArticleController.java index da7fcdb..108cbf5 100644 --- a/00-backend/src/main/java/de/htwsaar/webshop/controller/ArticleController.java +++ b/00-backend/src/main/java/de/htwsaar/webshop/controller/ArticleController.java @@ -35,14 +35,14 @@ public class ArticleController { return ResponseEntity.ok(articleModelFactory.from(articleService.findAll())); } - @RequestMapping(path = ARTICLE_GET, method = RequestMethod.GET, produces = "application/json") + @RequestMapping(path = ARTICLE_BASE, method = RequestMethod.GET, produces = "application/json") public ResponseEntity getByUUID(HttpServletRequest request, @RequestParam(value = PARAM_UUID) UUID uuid) { logRequest(request); return ResponseEntity.ok(articleModelFactory.from(articleService.findByUUID(uuid))); } - @RequestMapping(path = ARTICLE_ADD, method = RequestMethod.POST, produces = "application/json") + @RequestMapping(path = ARTICLE_BASE, method = RequestMethod.POST, produces = "application/json") public ResponseEntity add(HttpServletRequest request, @RequestBody Article article) { logRequest(request); @@ -56,7 +56,7 @@ public class ArticleController { return ResponseEntity.ok(a != null); } - @RequestMapping(path = ARTICLE_DELETE, method = RequestMethod.DELETE, produces = "application/json") + @RequestMapping(path = ARTICLE_BASE, method = RequestMethod.DELETE, produces = "application/json") public ResponseEntity update(HttpServletRequest request, @RequestParam(value = PARAM_UUID) UUID uuid, @RequestBody Article article) {