Package inha.git.team.api.controller
Class TeamCommentController
java.lang.Object
inha.git.team.api.controller.TeamCommentController
@RestController
@RequestMapping("/api/v1/teams/comments")
public class TeamCommentController
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateComment
(User user, CreateCommentRequest createCommentRequest) 팀 게시글 댓글 생성 APIcreateReplyComment
(User user, CreateReplyCommentRequest createReplyCommentRequest) deleteComment
(User user, Integer commentIdx) 팀 게시글 댓글 삭제 APIdeleteReplyComment
(User user, Integer replyCommentIdx) 팀 게시글 대댓글 삭제 APIgetAllCommentsByTeamPostIdx
(Integer postIdx) 특정 팀 게시글 댓글 전체 조회 APIupdateComment
(User user, Integer commentIdx, UpdateCommentRequest updateCommentRequest) 팀 게시글 댓글 수정 APIupdateReplyComment
(User user, Integer replyCommentIdx, UpdateCommentRequest updateCommentRequest) 팀 게시글 대댓글 수정 API
-
Constructor Details
-
TeamCommentController
public TeamCommentController()
-
-
Method Details
-
getAllCommentsByTeamPostIdx
@GetMapping public BaseResponse<List<CommentWithRepliesResponse>> getAllCommentsByTeamPostIdx(@RequestParam("postIdx") Integer postIdx) 특정 팀 게시글 댓글 전체 조회 API- Parameters:
postIdx
- 게시글 식별자- Returns:
- BaseResponse<List
>
-
createComment
@PostMapping public BaseResponse<TeamCommentResponse> createComment(@AuthenticationPrincipal User user, @Validated @RequestBody CreateCommentRequest createCommentRequest) 팀 게시글 댓글 생성 API- Parameters:
user
- 사용자 정보createCommentRequest
- 댓글 생성 요청- Returns:
- BaseResponse
-
updateComment
@PutMapping("/{commentIdx}") public BaseResponse<TeamCommentResponse> updateComment(@AuthenticationPrincipal User user, @PathVariable("commentIdx") Integer commentIdx, @Validated @RequestBody UpdateCommentRequest updateCommentRequest) 팀 게시글 댓글 수정 API- Parameters:
user
- 사용자 정보commentIdx
- 댓글 식별자updateCommentRequest
- 댓글 수정 요청- Returns:
- BaseResponse
-
deleteComment
@DeleteMapping("/{commentIdx}") public BaseResponse<TeamCommentResponse> deleteComment(@AuthenticationPrincipal User user, @PathVariable("commentIdx") Integer commentIdx) 팀 게시글 댓글 삭제 API- Parameters:
user
- 사용자 정보commentIdx
- 댓글 식별자- Returns:
- BaseResponse
-
createReplyComment
@PostMapping("/reply") public BaseResponse<TeamReplyCommentResponse> createReplyComment(@AuthenticationPrincipal User user, @Validated @RequestBody CreateReplyCommentRequest createReplyCommentRequest) -
updateReplyComment
@PutMapping("/reply/{replyCommentIdx}") public BaseResponse<TeamReplyCommentResponse> updateReplyComment(@AuthenticationPrincipal User user, @PathVariable("replyCommentIdx") Integer replyCommentIdx, @Validated @RequestBody UpdateCommentRequest updateCommentRequest) 팀 게시글 대댓글 수정 API- Parameters:
user
- 사용자 정보replyCommentIdx
- 대댓글 식별자updateCommentRequest
- 대댓글 수정 요청- Returns:
- BaseResponse
-
deleteReplyComment
@DeleteMapping("/reply/{replyCommentIdx}") public BaseResponse<TeamReplyCommentResponse> deleteReplyComment(@AuthenticationPrincipal User user, @PathVariable("replyCommentIdx") Integer replyCommentIdx) 팀 게시글 대댓글 삭제 API- Parameters:
user
- 사용자 정보replyCommentIdx
- 대댓글 식별자- Returns:
- BaseResponse
-