@RequestMapping(value = "/{id}", method = RequestMethod.GET) @ResponseBody public UIPing getById(@PathVariable Long id) { return pingService.getById(id); }
/* same as above method, but is mapped to * /api/person?id= rather than /api/person/{id} */ @RequestMapping(params = "id", method = RequestMethod.GET) @ResponseBody public UIPing getByIdFromParam(@RequestParam("id") Long id) { return pingService.getById(id); }
@RequestMapping(value = "/random", method = RequestMethod.GET) @ResponseBody public UIPing randomPerson() { return pingService.getRandom(); }