Package inha.git.question.api.controller
Class QuestionCommentController
java.lang.Object
inha.git.question.api.controller.QuestionCommentController
@RestController
@RequestMapping("/api/v1/questions/comments")
public class QuestionCommentController
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateComment
(User user, CreateCommentRequest createCommentRequest) 질문 댓글 생성 APIcreateReplyComment
(User user, CreateReplyCommentRequest createReplyCommentRequest) 질문 댓글 답글 생성 APIdeleteComment
(User user, Integer commentIdx) 질문 댓글 삭제 APIdeleteReplyComment
(User user, Integer replyCommentIdx) 질문 댓글 답글 삭제 APIgetAllComments
(User user, Integer questionIdx) 특정 질문 댓글 전체 조회 APIquestionCommentLike
(User user, @Valid CommentLikeRequest commentLikeRequest) 질문 댓글 좋아요 APIquestionCommentLikeCancel
(User user, @Valid CommentLikeRequest commentLikeRequest) 질문 댓글 좋아요 취소 APIquestionReplyCommentLike
(User user, @Valid CommentLikeRequest commentLikeRequest) 질문 대댓글 좋아요 APIquestionReplyCommentLikeCancel
(User user, @Valid CommentLikeRequest commentLikeRequest) 질문 대댓글 좋아요 취소 APIupdateComment
(User user, Integer commentIdx, UpdateCommentRequest updateCommentRequest) 질문 댓글 수정 APIupdateReplyComment
(User user, Integer replyCommentIdx, UpdateCommentRequest updateCommentRequest) 질문 댓글 답글 수정 API
-
Constructor Details
-
QuestionCommentController
public QuestionCommentController()
-
-
Method Details
-
getAllComments
@GetMapping public BaseResponse<List<CommentWithRepliesResponse>> getAllComments(@AuthenticationPrincipal User user, @RequestParam("questionIdx") Integer questionIdx) 특정 질문 댓글 전체 조회 API- Parameters:
questionIdx
- 질문 idx- Returns:
- BaseResponse<List
>
-
createComment
@PostMapping public BaseResponse<CommentResponse> createComment(@AuthenticationPrincipal User user, @Validated @RequestBody CreateCommentRequest createCommentRequest) 질문 댓글 생성 API- Parameters:
user
- 사용자 정보createCommentRequest
- 댓글 생성 요청- Returns:
- BaseResponse
-
updateComment
@PutMapping("/{commentIdx}") public BaseResponse<CommentResponse> updateComment(@AuthenticationPrincipal User user, @PathVariable("commentIdx") Integer commentIdx, @Validated @RequestBody UpdateCommentRequest updateCommentRequest) 질문 댓글 수정 API- Parameters:
user
- 사용자 정보commentIdx
- 댓글 idxupdateCommentRequest
- 댓글 수정 요청- Returns:
- BaseResponse
-
deleteComment
@DeleteMapping("/{commentIdx}") public BaseResponse<CommentResponse> deleteComment(@AuthenticationPrincipal User user, @PathVariable("commentIdx") Integer commentIdx) 질문 댓글 삭제 API- Parameters:
user
- 사용자 정보commentIdx
- 댓글 idx- Returns:
- BaseResponse
-
createReplyComment
@PostMapping("/reply") public BaseResponse<ReplyCommentResponse> createReplyComment(@AuthenticationPrincipal User user, @Validated @RequestBody CreateReplyCommentRequest createReplyCommentRequest) 질문 댓글 답글 생성 API- Parameters:
user
- 사용자 정보createReplyCommentRequest
- 댓글 생성 요청- Returns:
- BaseResponse
-
updateReplyComment
@PutMapping("/reply/{replyCommentIdx}") public BaseResponse<ReplyCommentResponse> updateReplyComment(@AuthenticationPrincipal User user, @PathVariable("replyCommentIdx") Integer replyCommentIdx, @Validated @RequestBody UpdateCommentRequest updateCommentRequest) 질문 댓글 답글 수정 API- Parameters:
user
- 사용자 정보replyCommentIdx
- 댓글 idxupdateCommentRequest
- 댓글 수정 요청- Returns:
- BaseResponse
-
deleteReplyComment
@DeleteMapping("/reply/{replyCommentIdx}") public BaseResponse<ReplyCommentResponse> deleteReplyComment(@AuthenticationPrincipal User user, @PathVariable("replyCommentIdx") Integer replyCommentIdx) 질문 댓글 답글 삭제 API- Parameters:
user
- 사용자 정보replyCommentIdx
- 댓글 idx- Returns:
- BaseResponse
-
questionCommentLike
@PostMapping("/like") public BaseResponse<String> questionCommentLike(@AuthenticationPrincipal User user, @RequestBody @Valid @Valid CommentLikeRequest commentLikeRequest) 질문 댓글 좋아요 API- Parameters:
user
- 사용자 정보commentLikeRequest
- 댓글 좋아요 요청- Returns:
- BaseResponse
-
questionCommentLikeCancel
@DeleteMapping("/like") public BaseResponse<String> questionCommentLikeCancel(@AuthenticationPrincipal User user, @RequestBody @Valid @Valid CommentLikeRequest commentLikeRequest) 질문 댓글 좋아요 취소 API- Parameters:
user
- 사용자 정보commentLikeRequest
- 댓글 좋아요 취소 요청- Returns:
- BaseResponse
-
questionReplyCommentLike
@PostMapping("/reply/like") public BaseResponse<String> questionReplyCommentLike(@AuthenticationPrincipal User user, @RequestBody @Valid @Valid CommentLikeRequest commentLikeRequest) 질문 대댓글 좋아요 API- Parameters:
user
- 사용자 정보commentLikeRequest
- 댓글 좋아요 요청- Returns:
- BaseResponse
-
questionReplyCommentLikeCancel
@DeleteMapping("/reply/like") public BaseResponse<String> questionReplyCommentLikeCancel(@AuthenticationPrincipal User user, @RequestBody @Valid @Valid CommentLikeRequest commentLikeRequest) 질문 대댓글 좋아요 취소 API- Parameters:
user
- 사용자 정보commentLikeRequest
- 댓글 좋아요 취소 요청- Returns:
- BaseResponse
-