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