From bb2e8858a7f6b3b61dc314e8837f610ee507b3ea Mon Sep 17 00:00:00 2001 From: xhaktmchl Date: Wed, 9 Nov 2022 11:14:49 +0900 Subject: [PATCH] =?UTF-8?q?#27=20refactor:=20Comment=EC=BB=A8=ED=8A=B8?= =?UTF-8?q?=EB=A1=A4=EB=9F=AC=20=EC=9D=B4=EB=A6=84=20=EC=98=A4=ED=83=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95,=20Comment=20swagger=20ApiResponse=20?= =?UTF-8?q?=EB=88=84=EB=9D=BD=20=EB=90=9C=20=EC=9D=91=EB=8B=B5=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=98=EC=98=81,=20Req=EC=97=90=20=EB=B9=A0?= =?UTF-8?q?=EC=A7=84=20=ED=95=84=EB=93=9C=EA=B0=92=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...CommenrController.java => CommentController.java} | 12 +++++------- .../board/dto/request/comment/DeleteCommentReq.java | 4 ++++ 2 files changed, 9 insertions(+), 7 deletions(-) rename server/src/main/java/com/yogit/server/board/controller/{CommenrController.java => CommentController.java} (92%) diff --git a/server/src/main/java/com/yogit/server/board/controller/CommenrController.java b/server/src/main/java/com/yogit/server/board/controller/CommentController.java similarity index 92% rename from server/src/main/java/com/yogit/server/board/controller/CommenrController.java rename to server/src/main/java/com/yogit/server/board/controller/CommentController.java index a617f80..2adf5b4 100644 --- a/server/src/main/java/com/yogit/server/board/controller/CommenrController.java +++ b/server/src/main/java/com/yogit/server/board/controller/CommentController.java @@ -7,8 +7,6 @@ import com.yogit.server.board.dto.response.comment.DeleteCommentRes; import com.yogit.server.board.service.comment.CommentService; import com.yogit.server.global.dto.ApplicationResponse; -import com.yogit.server.user.entity.Gender; -import com.yogit.server.user.entity.Nationality; import io.swagger.annotations.*; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -21,7 +19,7 @@ @RestController @RequiredArgsConstructor // private final DI의존주입 @RequestMapping("/comments") -public class CommenrController { +public class CommentController { private final CommentService commentService; /** @@ -66,11 +64,11 @@ public ApplicationResponse> findAllComments(@PathVariable("clip @ApiResponses({ @ApiResponse(code= 201, message = "요청에 성공하였습니다."), @ApiResponse(code= 404, message = "존재하지 않는 유저입니다."), - @ApiResponse(code= 404, message = "존재하지 않는 클립보드입니다."), @ApiResponse(code= 404, message = "존재하지 않는 코멘트입니다."), + @ApiResponse(code= 404, message = "요청한 유저가 코멘트의 호스트가 아닙니다"), @ApiResponse(code = 4000 , message = "서버 오류입니다.") }) - @PatchMapping("/{commentId}") + @PatchMapping("/{commentId}/status") public ApplicationResponse deleteComment(@PathVariable("commentId") Long commentId, @RequestBody @Validated DeleteCommentReq deleteCommentReq){ return commentService.deleteComment(deleteCommentReq, commentId); } @@ -84,11 +82,11 @@ public ApplicationResponse deleteComment(@PathVariable("commen @ApiResponses({ @ApiResponse(code= 201, message = "요청에 성공하였습니다."), @ApiResponse(code= 404, message = "존재하지 않는 유저입니다."), - @ApiResponse(code= 404, message = "존재하지 않는 클립보드입니다."), @ApiResponse(code= 404, message = "존재하지 않는 코멘트입니다."), + @ApiResponse(code= 404, message = "요청한 유저가 코멘트의 호스트가 아닙니다"), @ApiResponse(code = 4000 , message = "서버 오류입니다.") }) - @PatchMapping("/{commentId}/content") + @PatchMapping("/{commentId}") public ApplicationResponse updateComment(@PathVariable("commentId") Long commentId, @RequestBody @Validated PatchCommentReq patchCommentReq){ return commentService.updateComment(patchCommentReq, commentId); } diff --git a/server/src/main/java/com/yogit/server/board/dto/request/comment/DeleteCommentReq.java b/server/src/main/java/com/yogit/server/board/dto/request/comment/DeleteCommentReq.java index 3a5cb5d..b84ea95 100644 --- a/server/src/main/java/com/yogit/server/board/dto/request/comment/DeleteCommentReq.java +++ b/server/src/main/java/com/yogit/server/board/dto/request/comment/DeleteCommentReq.java @@ -12,4 +12,8 @@ public class DeleteCommentReq { @ApiModelProperty(example = "1") @ApiParam(value = "유저 ID", required = true) private Long userId; + + @ApiModelProperty(example = "1") + @ApiParam(value = "코멘트 ID", required = true) + private Long commentId; }