コード例 #1
0
 // Delete comment
 @RequestMapping(
     value = "/comment/deletecomment/comment/{commentid}/user/{userid}",
     method = RequestMethod.GET)
 public @ResponseBody boolean DeleteComment(
     @PathVariable int commentid, @PathVariable int userid) {
   return commentService.DeleteComment(commentid, userid);
 }
コード例 #2
0
 // Get comment
 @RequestMapping(
     value = "/comment/getcomment/comment/{commentid}/user/{userid}/question/{questionid}",
     method = RequestMethod.GET)
 public @ResponseBody Comment GetComment(
     @PathVariable int commentid, @PathVariable int userid, @PathVariable int questionid) {
   return commentService.GetComment(commentid, userid, questionid);
 }
コード例 #3
0
 // Add comment
 @RequestMapping(value = "/comment/createcomment/{userid}/", method = RequestMethod.POST)
 public @ResponseBody int CreateComment(
     @PathVariable int userid,
     @RequestParam(value = "data", required = false) Comment inccomment) {
   Comment comment = inccomment;
   int id = commentService.CreateComment(userid, inccomment);
   return id;
 }
コード例 #4
0
 // Update comment
 @RequestMapping(value = "/comment/updatecomment/", method = RequestMethod.POST)
 public @ResponseBody boolean UpdateComment(@RequestBody Comment inccomment) {
   return commentService.UpdateComment(inccomment);
 }
コード例 #5
0
 // Get all comments
 @RequestMapping(value = "/comment/getcomments/question/{questionid}", method = RequestMethod.GET)
 public @ResponseBody List<Comment> GetComments(@PathVariable int questionid) {
   return commentService.GetComments(questionid);
 }