Skip to content

Instantly share code, notes, and snippets.

@shazin
Created January 19, 2016 11:57
Show Gist options
  • Save shazin/703cd80efc1ed965e374 to your computer and use it in GitHub Desktop.
Save shazin/703cd80efc1ed965e374 to your computer and use it in GitHub Desktop.
@RestController
@RequestMapping("/user")
public class UserController {
@Autowired
private UserService userService;
@RequestMapping(method = RequestMethod.GET)
public Observable<List<User>> find() {
return userService.findAll().toList();
}
@RequestMapping(value="/name/{name}", method = RequestMethod.GET)
public Observable<List<User>> findByName(@PathVariable String name) {
return userService.findByName(name).toList();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment