Class QuestionCommentController

java.lang.Object
inha.git.question.api.controller.QuestionCommentController

@RestController @RequestMapping("/api/v1/questions/comments") public class QuestionCommentController extends Object
  • 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 - 댓글 idx
      updateCommentRequest - 댓글 수정 요청
      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 - 댓글 idx
      updateCommentRequest - 댓글 수정 요청
      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