@RestController
@RequestMapping(value="/api/comments/")
public class CommentsController
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private CommentService |
commentService |
Constructor and Description |
---|
CommentsController() |
Modifier and Type | Method and Description |
---|---|
org.springframework.http.ResponseEntity<java.lang.Void> |
createComment(CommentsDto commentsDto) |
org.springframework.http.ResponseEntity<java.util.List<CommentsDto>> |
getAllCommentsByUser(java.lang.String userName) |
org.springframework.http.ResponseEntity<java.util.List<CommentsDto>> |
getAllCommentsForPost(java.lang.Long postId) |
private final CommentService commentService
@PostMapping public org.springframework.http.ResponseEntity<java.lang.Void> createComment(@RequestBody CommentsDto commentsDto)
@GetMapping(value="by-post/{postId}") public org.springframework.http.ResponseEntity<java.util.List<CommentsDto>> getAllCommentsForPost(@PathVariable java.lang.Long postId)
@GetMapping(value="by-user/{userName}") public org.springframework.http.ResponseEntity<java.util.List<CommentsDto>> getAllCommentsByUser(@PathVariable java.lang.String userName)