@RequestMapping(value = "/users", method = RequestMethod.POST) @ResponseBody public void registerUser( @RequestParam("username") String username, @RequestParam("firstName") String firstName, @RequestParam("lastName") String lastName, @RequestParam("password") String password) { userRepository.registerUser(username, firstName, lastName, password); }
@RequestMapping(value = "/userinfo", method = RequestMethod.GET) @ResponseBody public UserInfo getUserInfo(@RequestHeader("Authorization") final String token) { return userRepository.getUserInfo(token); }
@RequestMapping(value = "/users", method = RequestMethod.GET) @ResponseBody public List<User> getAllUsers(@RequestHeader("Authorization") final String token) { return userRepository.getAllUsers(token); }