From 2d70176d02fe65d33defeddeae2491eb0edf156e Mon Sep 17 00:00:00 2001 From: dgrh99 <daniel.gerhardt@mni.thm.de> Date: Tue, 5 Feb 2013 14:50:36 +0100 Subject: [PATCH] Moved shared route prefix in RequestMapping annotation from method to class. --- .../java/de/thm/arsnova/controller/FoodVoteController.java | 7 ++++--- .../de/thm/arsnova/controller/StatisticsController.java | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/thm/arsnova/controller/FoodVoteController.java b/src/main/java/de/thm/arsnova/controller/FoodVoteController.java index 0f2772d1..61269ef5 100644 --- a/src/main/java/de/thm/arsnova/controller/FoodVoteController.java +++ b/src/main/java/de/thm/arsnova/controller/FoodVoteController.java @@ -37,6 +37,7 @@ import de.thm.arsnova.entities.FoodVote; import de.thm.arsnova.services.IFoodService; @Controller +@RequestMapping("/canteen/menu/vote") public class FoodVoteController extends AbstractController { public static final Logger LOGGER = LoggerFactory @@ -45,7 +46,7 @@ public class FoodVoteController extends AbstractController { @Autowired private IFoodService foodService; - @RequestMapping(value = "/canteen/menu/vote", method = RequestMethod.POST) + @RequestMapping(value = "/", method = RequestMethod.POST) public final void setFoodVote( @RequestBody final Object menu, final HttpServletResponse response @@ -54,13 +55,13 @@ public class FoodVoteController extends AbstractController { foodService.vote(menustring); } - @RequestMapping(value = "/canteen/menu/vote", method = RequestMethod.GET) + @RequestMapping(value = "/", method = RequestMethod.GET) @ResponseBody public final List<FoodVote> getFoodVote() { return foodService.getFoodVote(); } - @RequestMapping(value = "/canteen/menu/vote/count", method = RequestMethod.GET, produces = "text/plain") + @RequestMapping(value = "/count", method = RequestMethod.GET, produces = "text/plain") @ResponseBody public final String getFoodVoteCount() { return Integer.toString(foodService.getFoodVoteCount()); diff --git a/src/main/java/de/thm/arsnova/controller/StatisticsController.java b/src/main/java/de/thm/arsnova/controller/StatisticsController.java index e6da1033..09317972 100644 --- a/src/main/java/de/thm/arsnova/controller/StatisticsController.java +++ b/src/main/java/de/thm/arsnova/controller/StatisticsController.java @@ -10,24 +10,25 @@ import de.thm.arsnova.entities.Statistics; import de.thm.arsnova.services.IStatisticsService; @Controller +@RequestMapping("/statistics") public class StatisticsController { @Autowired private IStatisticsService statisticsService; - @RequestMapping(method = RequestMethod.GET, value = "/statistics") + @RequestMapping(method = RequestMethod.GET, value = "/") @ResponseBody public final Statistics getStatistics() { return statisticsService.getStatistics(); } - @RequestMapping(method = RequestMethod.GET, value = "/statistics/activeusercount", produces = "text/plain") + @RequestMapping(method = RequestMethod.GET, value = "/activeusercount", produces = "text/plain") @ResponseBody public final String countActiveUsers() { return Integer.toString(statisticsService.countActiveUsers()); } - @RequestMapping(method = RequestMethod.GET, value = "/statistics/sessioncount", produces = "text/plain") + @RequestMapping(method = RequestMethod.GET, value = "/sessioncount", produces = "text/plain") @ResponseBody public final String countSessions() { return Integer.toString(statisticsService.getStatistics().getOpenSessions() -- GitLab