@RequestMapping(value = "/{id}", method = RequestMethod.PUT) @ResponseBody public String update(@PathVariable("id") K id, @RequestBody E resource) { resource.setPrimaryKey(id); getService().update(resource); resource = getService().find(resource.getPrimaryKey()); return JsonUtils.toString(resource); }
@RequestMapping(value = "/{id}", method = RequestMethod.GET) @ResponseBody public String get(@PathVariable("id") K id) { E resource = getService().find(id); return JsonUtils.toString(resource); }