Ejemplo n.º 1
0
 /** GET /users -> get all users. */
 @RequestMapping(
     value = "/users",
     method = RequestMethod.GET,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public List<User> getAll() {
   log.debug("REST request to get all Users");
   return userRepository.findAll();
 }
Ejemplo n.º 2
0
 /** GET /users/:login -> get the "login" user. */
 @RequestMapping(
     value = "/users/{login}",
     method = RequestMethod.GET,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public User getUser(@PathVariable String login, HttpServletResponse response) {
   log.debug("REST request to get User : {}", login);
   User user = userRepository.findOneByLogin(login);
   if (user == null) {
     response.setStatus(HttpServletResponse.SC_NOT_FOUND);
   }
   return user;
 }