Ejemplo n.º 1
0
 @RequestMapping(value = "/add", method = RequestMethod.POST)
 @ResponseBody
 public String add(HttpServletResponse response, Principal principal, @RequestParam int points)
     throws IOException {
   User user = userService.getUserByPseudo(principal.getName());
   user.setPoints(user.getPoints() + points);
   userService.updateUserByAdmin(user);
   return "" + user.getPoints();
 }
Ejemplo n.º 2
0
 @RequestMapping(value = "/getPoints", method = RequestMethod.GET)
 @ResponseBody
 public String getPoints(HttpServletResponse response, Principal principal) throws IOException {
   User user = userService.getUserByPseudo(principal.getName());
   return "" + user.getPoints();
 }