Class CommentController
- java.lang.Object
-
- com.restapi.template.api.community.comment.controller.CommentController
-
@RestController @RequestMapping(value="/board/posts/{postId}", produces="application/hal+json") public class CommentController extends java.lang.Object댓글 컨트롤러.- Version:
- 1.0
- Author:
- always0ne
-
-
Field Summary
Fields Modifier and Type Field Description private CommentServicecommentService
-
Constructor Summary
Constructors Constructor Description CommentController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LinksResponseaddComment(java.lang.Long postId, AddCommentRequest addCommentRequest)댓글 작성.LinksResponsedeleteComment(java.lang.Long postId, java.lang.Long commentId)댓글 삭제.LinksResponseupdateComment(java.lang.Long postId, java.lang.Long commentId, UpdateCommentRequest updateCommentRequest)댓글 수정.
-
-
-
Field Detail
-
commentService
private final CommentService commentService
-
-
Method Detail
-
addComment
@PostMapping @ResponseStatus(CREATED) public LinksResponse addComment(@PathVariable java.lang.Long postId, @RequestBody AddCommentRequest addCommentRequest)
댓글 작성.- Parameters:
postId- 게시글 IDaddCommentRequest- 댓글 정보- Returns:
- API Docs 링크
-
updateComment
@PutMapping("/{commentId}") @ResponseStatus(OK) public LinksResponse updateComment(@PathVariable java.lang.Long postId, @PathVariable java.lang.Long commentId, @RequestBody UpdateCommentRequest updateCommentRequest)댓글 수정.- Parameters:
postId- 게시글 IDcommentId- 게시글 IDupdateCommentRequest- 댓글 정보- Returns:
- API Docs 링크
-
deleteComment
@DeleteMapping("/{commentId}") @ResponseStatus(OK) public LinksResponse deleteComment(@PathVariable java.lang.Long postId, @PathVariable java.lang.Long commentId)댓글 삭제.- Parameters:
postId- 게시글 IDcommentId- 게시글 ID- Returns:
- API Docs 링크
-
-