Skip to content
Snippets Groups Projects
Commit 9bb068d9 authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Controller methods previously returning primitive types now return

Strings. This fixes incorrect content types being set in the response
header.
parent 99241d8c
Branches
Tags
No related merge requests found
...@@ -60,10 +60,10 @@ public class FoodVoteController extends AbstractController { ...@@ -60,10 +60,10 @@ public class FoodVoteController extends AbstractController {
return foodService.getFoodVote(); return foodService.getFoodVote();
} }
@RequestMapping(value = "/canteen/menu/vote/count", method = RequestMethod.GET) @RequestMapping(value = "/canteen/menu/vote/count", method = RequestMethod.GET, produces = "text/plain")
@ResponseBody @ResponseBody
public final int getFoodVoteCount() { public final String getFoodVoteCount() {
return foodService.getFoodVoteCount(); return Integer.toString(foodService.getFoodVoteCount());
} }
......
...@@ -21,16 +21,16 @@ public class StatisticsController { ...@@ -21,16 +21,16 @@ public class StatisticsController {
return statisticsService.getStatistics(); return statisticsService.getStatistics();
} }
@RequestMapping(method = RequestMethod.GET, value = "/statistics/activeusercount") @RequestMapping(method = RequestMethod.GET, value = "/statistics/activeusercount", produces = "text/plain")
@ResponseBody @ResponseBody
public final int countActiveUsers() { public final String countActiveUsers() {
return statisticsService.countActiveUsers(); return Integer.toString(statisticsService.countActiveUsers());
} }
@RequestMapping(method = RequestMethod.GET, value = "/statistics/sessioncount") @RequestMapping(method = RequestMethod.GET, value = "/statistics/sessioncount", produces = "text/plain")
@ResponseBody @ResponseBody
public final int countSessions() { public final String countSessions() {
return statisticsService.getStatistics().getOpenSessions() return Integer.toString(statisticsService.getStatistics().getOpenSessions()
+ statisticsService.getStatistics().getClosedSessions(); + statisticsService.getStatistics().getClosedSessions());
} }
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment