@@ -0,0 +1,970 @@
+package com.tymiller.controller;%0A%0Aimport java.util.List;%0A%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.web.bind.annotation.RequestBody;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod;%0Aimport org.springframework.web.bind.annotation.RestController;%0A%0Aimport com.tymiller.model.Comment;%0Aimport com.tymiller.model.Photo;%0Aimport com.tymiller.service.PhotoService;%0A%0A@RestController%0A@RequestMapping(%22/rest%22)%0Apublic class CommentResources %7B%0A%0A%09@Autowired%0A%09private PhotoService photoService;%0A%09%0A%09@Autowired%0A%09private CommentService commentService;%0A%09%0A%09@RequestMapping(value = %22/comment/add%22, method = RequestMethod.POST)%0A%09public void addComment (@RequestBody Comment comment) %7B%0A%09%09Photo photo = photoService.findByPhotoId(comment.getPhotoId());%0A%09%09List%3CComment%3E commentList = photo.getCommentList();%0A%09%09comment.setPhoto(photo);%0A%09%09commentService.save(comment);%0A%09%7D%0A%7D%0A

add comment resources