コード例 #1
0
 @RequestMapping(method = RequestMethod.PUT, value = "{id}")
 public Category update(@PathVariable String id, @RequestBody Category category)
     throws CategoryDoesntExistException {
   Category update = categoryService.findOne(Long.valueOf(id));
   update.setName(category.getName());
   return categoryService.save(update);
 }
コード例 #2
0
 @RequestMapping(method = RequestMethod.GET, value = "{id}")
 public Category get(@PathVariable String id) {
   return categoryService.findOne(Long.valueOf(id));
 }