예제 #1
0
 @RequestMapping(value = "/{id}", method = RequestMethod.PUT)
 public Tag updateTag(@RequestBody Tag updatedTag, @PathVariable Long id) {
   Tag tag = tagDao.getTagById(id);
   tag.setName(updatedTag.getName());
   tag.setItemCount(tag.getItemCount() + 1);
   return tagDao.modifyTag(tag);
 }
예제 #2
0
 @RequestMapping(method = RequestMethod.POST)
 @ResponseStatus(value = HttpStatus.CREATED)
 public Tag addTag(@RequestBody Tag tag) {
   tag.setId(null);
   return tagDao.newTag(tag);
 }