@PUT @Path("/{commentId}") public Comment updateComment( @PathParam("messageId") long messageId, @PathParam("commentId") long commentId, Comment comment) { comment.setId(commentId); return cs.UpdateComment(messageId, comment); }
@GET @Path("/{commentId}") public Comment getComment( @PathParam("messageId") long messageId, @PathParam("commentId") long commentId) { return cs.getComment(messageId, commentId); }
@DELETE @Path("/{commentId}") public void deleteComment( @PathParam("messageId") long messageId, @PathParam("commentId") long commentId) { cs.removeComment(messageId, commentId); }
@POST public Comment addComment(@PathParam("messageId") long messageId, Comment comment) { return cs.addComment(messageId, comment); }
@GET public List<Comment> getAllComments(@PathParam("messageId") long messageId) { return cs.getAllComments(messageId); }