Package inha.git.project.api.controller
Class ProjectCommentController
java.lang.Object
inha.git.project.api.controller.ProjectCommentController
@RestController
@RequestMapping("/api/v1/projects/comments")
public class ProjectCommentController
extends Object
ProjectCommentController는 project 댓글 관련 엔드포인트를 처리.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateComment
(User user, CreateCommentRequest createCommentRequest) 프로젝트 댓글 생성 APIcreateReply
(User user, CreateReplyCommentRequest createReplyCommentRequest) 프로젝트 댓글 답글 생성 APIdeleteComment
(User user, Integer commentIdx) 프로젝트 댓글 삭제 APIdeleteReply
(User user, Integer replyCommentIdx) 프로젝트 댓글 답글 삭제 APIgetAllComments
(User user, Integer projectIdx) projectCommentLike
(User user, @Valid CommentLikeRequest commentLikeRequest) 프로젝트 댓글 좋아요 APIprojectCommentLikeCancel
(User user, @Valid CommentLikeRequest commentLikeRequest) 프로젝트 댓글 좋아요 취소 APIprojectReplyCommentLike
(User user, @Valid CommentLikeRequest commentLikeRequest) 프로젝트 대댓글 좋아요 APIprojectReplyCommentLikeCancel
(User user, @Valid CommentLikeRequest commentLikeRequest) 프로젝트 대댓글 좋아요 취소 APIupdateComment
(User user, Integer commentIdx, UpdateCommentRequest updateCommentRequest) 프로젝트 댓글 수정 APIupdateReply
(User user, Integer replyCommentIdx, UpdateCommentRequest updateCommentRequest) 프로젝트 댓글 답글 수정 API
-
Constructor Details
-
ProjectCommentController
public ProjectCommentController()
-
-
Method Details
-
getAllComments
@GetMapping public BaseResponse<List<CommentWithRepliesResponse>> getAllComments(@AuthenticationPrincipal User user, @RequestParam("projectIdx") Integer projectIdx) -
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
- 댓글 식별자updateCommentRequest
- 댓글 수정 요청- Returns:
- BaseResponse
-
deleteComment
@DeleteMapping("/{commentIdx}") public BaseResponse<CommentResponse> deleteComment(@AuthenticationPrincipal User user, @PathVariable("commentIdx") Integer commentIdx) 프로젝트 댓글 삭제 API- Parameters:
user
- 사용자 정보commentIdx
- 댓글 식별자- Returns:
- BaseResponse
-
createReply
@PostMapping("/reply") public BaseResponse<ReplyCommentResponse> createReply(@AuthenticationPrincipal User user, @Validated @RequestBody CreateReplyCommentRequest createReplyCommentRequest) 프로젝트 댓글 답글 생성 API- Parameters:
user
- 사용자 정보createReplyCommentRequest
- 답글 생성 요청- Returns:
- BaseResponse
-
updateReply
@PutMapping("/reply/{replyCommentIdx}") public BaseResponse<ReplyCommentResponse> updateReply(@AuthenticationPrincipal User user, @PathVariable("replyCommentIdx") Integer replyCommentIdx, @Validated @RequestBody UpdateCommentRequest updateCommentRequest) 프로젝트 댓글 답글 수정 API- Parameters:
user
- 사용자 정보replyCommentIdx
- 답글 식별자updateCommentRequest
- 답글 수정 요청- Returns:
- BaseResponse
-
deleteReply
@DeleteMapping("/reply/{replyCommentIdx}") public BaseResponse<ReplyCommentResponse> deleteReply(@AuthenticationPrincipal User user, @PathVariable("replyCommentIdx") Integer replyCommentIdx) 프로젝트 댓글 답글 삭제 API- Parameters:
user
- 사용자 정보replyCommentIdx
- 답글 식별자- Returns:
- BaseResponse
-
projectCommentLike
@PostMapping("/like") public BaseResponse<String> projectCommentLike(@AuthenticationPrincipal User user, @RequestBody @Valid @Valid CommentLikeRequest commentLikeRequest) 프로젝트 댓글 좋아요 API특정 프로젝트 댓글에 좋아요를 합니다.
- Parameters:
user
- 로그인한 사용자 정보commentLikeRequest
- 좋아요할 프로젝트 댓글 정보- Returns:
- 좋아요 성공 메시지를 포함하는 BaseResponse
-
projectCommentLikeCancel
@DeleteMapping("/like") public BaseResponse<String> projectCommentLikeCancel(@AuthenticationPrincipal User user, @RequestBody @Valid @Valid CommentLikeRequest commentLikeRequest) 프로젝트 댓글 좋아요 취소 API특정 프로젝트 댓글에 좋아요를 취소합니다.
- Parameters:
user
- 로그인한 사용자 정보commentLikeRequest
- 좋아요할 프로젝트 댓글 정보- Returns:
- 좋아요 취소 성공 메시지를 포함하는 BaseResponse
-
projectReplyCommentLike
@PostMapping("/reply/like") public BaseResponse<String> projectReplyCommentLike(@AuthenticationPrincipal User user, @RequestBody @Valid @Valid CommentLikeRequest commentLikeRequest) 프로젝트 대댓글 좋아요 API특정 프로젝트 대댓글에 좋아요를 합니다.
- Parameters:
user
- 로그인한 사용자 정보commentLikeRequest
- 좋아요할 프로젝트 대댓글 정보- Returns:
- 좋아요 성공 메시지를 포함하는 BaseResponse
-
projectReplyCommentLikeCancel
@DeleteMapping("/reply/like") public BaseResponse<String> projectReplyCommentLikeCancel(@AuthenticationPrincipal User user, @RequestBody @Valid @Valid CommentLikeRequest commentLikeRequest) 프로젝트 대댓글 좋아요 취소 API특정 프로젝트 대댓글에 좋아요를 취소합니다.
- Parameters:
user
- 로그인한 사용자 정보commentLikeRequest
- 좋아요할 프로젝트 대댓글 정보- Returns:
- 좋아요 취소 성공 메시지를 포함하는 BaseResponse
-