Пример #1
0
 @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);
 }
Пример #2
0
 @RequestMapping(value = "/userinfo", method = RequestMethod.GET)
 @ResponseBody
 public UserInfo getUserInfo(@RequestHeader("Authorization") final String token) {
   return userRepository.getUserInfo(token);
 }
Пример #3
0
 @RequestMapping(value = "/users", method = RequestMethod.GET)
 @ResponseBody
 public List<User> getAllUsers(@RequestHeader("Authorization") final String token) {
   return userRepository.getAllUsers(token);
 }