@RestController
public class CommentsController
extends java.lang.Object
Constructor and Description |
---|
CommentsController() |
Modifier and Type | Method and Description |
---|---|
CommentBO |
add(CommentVO commentVO,
java.lang.Long commentableId)
This method adds a new comment to a specified by id commentable.
|
java.util.List<CommentBO> |
comments(java.lang.Long commentableId)
This method returns all comments that are available
to a specified by id commentable.
|
void |
delete(java.lang.Long commentableId,
java.lang.Long commentId)
This method deletes a specified by id comment to a specified by id commentable.
|
CommentBO |
update(CommentVO commentVO,
java.lang.Long commentableId,
java.lang.Long commentId)
This method updates an existing specified by id comment to a specified by id commentable.
|
@RequestMapping(method=POST, value="api/commentables/{commentableId}/comments") public CommentBO add(@RequestBody CommentVO commentVO, @PathVariable java.lang.Long commentableId)
commentVO
- CommentVO's instance with user's input datacommentableId
- Id of commentable to add a comment to@RequestMapping(value="api/commentables/{commentableId}/comments") public java.util.List<CommentBO> comments(@PathVariable java.lang.Long commentableId)
commentableId
- Id of commentable to receive comments to@RequestMapping(method=PUT, value="api/commentables/{commentableId}/comments/{commentId}") public CommentBO update(@RequestBody CommentVO commentVO, @PathVariable java.lang.Long commentableId, @PathVariable java.lang.Long commentId)
commentVO
- CommentVO's instance with user's changed and old data.commentableId
- Id of commentable to edit an comment tocommentId
- Id of comment to edit@RequestMapping(method=DELETE, value="api/commentables/{commentableId}/comments/{commentId}") public void delete(@PathVariable java.lang.Long commentableId, @PathVariable java.lang.Long commentId)
commentableId
- Id of commentable to delete an comment tocommentId
- Id of comment to delete