// 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); }
// 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); }
// 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; }
// Update comment @RequestMapping(value = "/comment/updatecomment/", method = RequestMethod.POST) public @ResponseBody boolean UpdateComment(@RequestBody Comment inccomment) { return commentService.UpdateComment(inccomment); }
// Get all comments @RequestMapping(value = "/comment/getcomments/question/{questionid}", method = RequestMethod.GET) public @ResponseBody List<Comment> GetComments(@PathVariable int questionid) { return commentService.GetComments(questionid); }