From 1b95fcc357610e5fbb64e17161f12bb9af8945e2 Mon Sep 17 00:00:00 2001 From: wnd01jun Date: Thu, 1 Aug 2024 11:50:04 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20Swagger=20API=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ntrollerV2.java => CommentController.java} | 7 ++- .../controller/CommentControllerApi.java | 48 ++++++++++++++++++- 2 files changed, 50 insertions(+), 5 deletions(-) rename src/main/java/com/bbteam/budgetbuddies/domain/comment/controller/{CommentControllerV2.java => CommentController.java} (94%) diff --git a/src/main/java/com/bbteam/budgetbuddies/domain/comment/controller/CommentControllerV2.java b/src/main/java/com/bbteam/budgetbuddies/domain/comment/controller/CommentController.java similarity index 94% rename from src/main/java/com/bbteam/budgetbuddies/domain/comment/controller/CommentControllerV2.java rename to src/main/java/com/bbteam/budgetbuddies/domain/comment/controller/CommentController.java index 9a4c70a5..96f7e436 100644 --- a/src/main/java/com/bbteam/budgetbuddies/domain/comment/controller/CommentControllerV2.java +++ b/src/main/java/com/bbteam/budgetbuddies/domain/comment/controller/CommentController.java @@ -3,7 +3,6 @@ import com.bbteam.budgetbuddies.domain.comment.dto.CommentRequestDto; import com.bbteam.budgetbuddies.domain.comment.dto.CommentResponseDto; import com.bbteam.budgetbuddies.domain.comment.service.CommentService; -import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -12,7 +11,7 @@ import org.springframework.web.bind.annotation.*; @RestController -public class CommentControllerV2 implements CommentControllerApi { +public class CommentController implements CommentControllerApi { @Qualifier("discountCommentService") private final CommentService supportCommentService; - public CommentControllerV2(CommentService discountCommentService, - CommentService supportCommentService) { this.discountCommentService = discountCommentService; this.supportCommentService = supportCommentService; diff --git a/src/main/java/com/bbteam/budgetbuddies/domain/comment/controller/CommentControllerApi.java b/src/main/java/com/bbteam/budgetbuddies/domain/comment/controller/CommentControllerApi.java index 730f6b6e..ecaa37a4 100644 --- a/src/main/java/com/bbteam/budgetbuddies/domain/comment/controller/CommentControllerApi.java +++ b/src/main/java/com/bbteam/budgetbuddies/domain/comment/controller/CommentControllerApi.java @@ -11,6 +11,9 @@ import org.springframework.data.domain.Pageable; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; public interface CommentControllerApi { @Operation(summary = "[User] 특정 할인 정보 게시글에 댓글달기", description = "특정 할인 정보 게시글에 댓글을 다는 API입니다.") @@ -75,6 +78,49 @@ ResponseEntity> findAllBySupportI @Parameters({ @Parameter(name = "commentId", description = "삭제할 댓글 id 입니다. parameter") }) - @GetMapping("/comments/delete") ResponseEntity deleteComment(Long commentId); + + @Operation(summary = "[User] SupportInfo의 댓글 요청 API ", description = "특정 댓글을 요청하는 API입니다.") + @ApiResponses({ + @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "OK, 성공"), + }) + @Parameters({ + @Parameter(name = "commentId", description = "조회할 댓글 id 입니다. parameter") + }) + ResponseEntity findSupportOne(@RequestParam("commentId")Long commentId); + + @Operation(summary = "[User] SupprotInfo의 댓글 변경 API", description = "특정 댓글을 변경하는 API입니다.") + @ApiResponses({ + @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "OK, 성공"), + }) + @Parameters({ + @Parameter(name = "commentId", description = "변경할 댓글 id 입니다. requestbody"), + @Parameter(name = "comment", description = "변경할 댓글 내용입니다.. requestbody") + + }) + ResponseEntity modifySupportOne( + @RequestBody CommentRequestDto.CommentModifyDto dto); + + + @Operation(summary = "[User] DiscountInfo의 댓글 요청 API ", description = "특정 댓글을 요청하는 API입니다.") + @ApiResponses({ + @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "OK, 성공"), + }) + @Parameters({ + @Parameter(name = "commentId", description = "조회할 댓글 id 입니다. parameter") + }) + ResponseEntity findDiscountOne(@RequestParam("commentId")Long commentId); + + @Operation(summary = "[User] DiscountInfo의 댓글 변경 API", description = "특정 댓글을 변경하는 API입니다.") + @ApiResponses({ + @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "OK, 성공"), + }) + @Parameters({ + @Parameter(name = "commentId", description = "변경할 댓글 id 입니다. requestbody"), + @Parameter(name = "comment", description = "변경할 댓글 내용입니다.. requestbody") + + }) + ResponseEntity modifyDiscountOne( + @RequestBody CommentRequestDto.CommentModifyDto dto); + }