From 302e1898dcbdbfa278682cfcd69f9baf2fce042d Mon Sep 17 00:00:00 2001 From: Mingyu Song <100754581+mikekks@users.noreply.github.com> Date: Fri, 9 Aug 2024 11:32:41 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=8A=A4=EC=9B=A8=EA=B1=B0=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=ED=95=B4=EA=B2=B0=20(#297)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crew/main/comment/v2/CommentV2Api.java | 67 +++++++++++++++---- .../main/comment/v2/CommentV2Controller.java | 2 - 2 files changed, 54 insertions(+), 15 deletions(-) diff --git a/main/src/main/java/org/sopt/makers/crew/main/comment/v2/CommentV2Api.java b/main/src/main/java/org/sopt/makers/crew/main/comment/v2/CommentV2Api.java index 5a5438ef..a237d785 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/comment/v2/CommentV2Api.java +++ b/main/src/main/java/org/sopt/makers/crew/main/comment/v2/CommentV2Api.java @@ -3,6 +3,8 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; import jakarta.validation.Valid; @@ -31,7 +33,13 @@ public interface CommentV2Api { @Operation(summary = "모임 게시글 댓글 작성") @ResponseStatus(HttpStatus.CREATED) @ApiResponses(value = { - @ApiResponse(responseCode = "201", description = "성공"), + @ApiResponse( + responseCode = "201", + description = "성공", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = CommentV2CreateCommentResponseDto.class) + )), }) ResponseEntity createComment( @Valid @RequestBody CommentV2CreateCommentBodyDto requestBody, Principal principal); @@ -39,7 +47,13 @@ ResponseEntity createComment( @Operation(summary = "모임 게시글 댓글 수정") @ResponseStatus(HttpStatus.OK) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "성공"), + @ApiResponse( + responseCode = "200", + description = "성공", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = CommentV2UpdateCommentResponseDto.class) + )), }) ResponseEntity updateComment( @PathVariable Integer commentId, @@ -49,7 +63,14 @@ ResponseEntity updateComment( @Operation(summary = "댓글 신고하기") @ResponseStatus(HttpStatus.CREATED) @ApiResponses(value = { - @ApiResponse(responseCode = "201", description = "성공"), + @ApiResponse( + responseCode = "201", + description = "성공", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = CommentV2ReportCommentResponseDto.class) + ) + ), }) ResponseEntity reportComment( @PathVariable Integer commentId, Principal principal); @@ -64,7 +85,9 @@ ResponseEntity reportComment( @Operation(summary = "댓글에서 유저 멘션") @ResponseStatus(HttpStatus.OK) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "성공"), + @ApiResponse( + responseCode = "200", + description = "성공"), }) ResponseEntity mentionUserInComment( @Valid @RequestBody CommentV2MentionUserInCommentRequestDto requestBody, @@ -73,11 +96,20 @@ ResponseEntity mentionUserInComment( @Operation(summary = "모임 게시글 댓글 리스트 조회") @ResponseStatus(HttpStatus.OK) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "성공"), + @ApiResponse( + responseCode = "200", + description = "성공", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = CommentV2GetCommentsResponseDto.class) + )), }) - @Parameters({@Parameter(name = "page", description = "페이지, default = 1", example = "1"), - @Parameter(name = "take", description = "가져올 데이터 개수, default = 12", example = "50"), - @Parameter(name = "postId", description = "게시글 id", example = "3")}) + @Parameters( + { + @Parameter(name = "page", description = "페이지, default = 1", example = "1", schema = @Schema(type = "integer", format = "int32")), + @Parameter(name = "take", description = "가져올 데이터 개수, default = 12", example = "50", schema = @Schema(type = "integer", format = "int32")), + @Parameter(name = "postId", description = "게시글 id", example = "3", schema = @Schema(type = "integer", format = "int32")) + }) ResponseEntity getComments( @Valid @ModelAttribute @Parameter(hidden = true) CommentV2GetCommentsQueryDto request, Principal principal); @@ -85,11 +117,14 @@ ResponseEntity getComments( @Operation(summary = "[TEMP] 모임 게시글 댓글 리스트 조회") @ResponseStatus(HttpStatus.OK) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "성공"), + @ApiResponse( + responseCode = "200", + description = "성공"), }) - @Parameters({@Parameter(name = "page", description = "페이지, default = 1", example = "1"), - @Parameter(name = "take", description = "가져올 데이터 개수, default = 12", example = "50"), - @Parameter(name = "postId", description = "게시글 id", example = "3")}) + @Parameters({ + @Parameter(name = "page", description = "페이지, default = 1", example = "1", schema = @Schema(type = "integer", format = "int32")), + @Parameter(name = "take", description = "가져올 데이터 개수, default = 12", example = "50", schema = @Schema(type = "integer", format = "int32")), + @Parameter(name = "postId", description = "게시글 id", example = "3", schema = @Schema(type = "integer", format = "int32"))}) ResponseEntity> getCommentsTemp( @Valid @ModelAttribute @Parameter(hidden = true) CommentV2GetCommentsQueryDto request, Principal principal); @@ -97,7 +132,13 @@ ResponseEntity> getCommentsTemp @Operation(summary = "모임 게시글 댓글 좋아요 토글") @ResponseStatus(HttpStatus.CREATED) @ApiResponses(value = { - @ApiResponse(responseCode = "201", description = "성공"), + @ApiResponse( + responseCode = "201", + description = "성공", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = CommentV2SwitchCommentLikeResponseDto.class) + )), }) ResponseEntity switchCommentLike(Principal principal, @PathVariable Integer commentId); diff --git a/main/src/main/java/org/sopt/makers/crew/main/comment/v2/CommentV2Controller.java b/main/src/main/java/org/sopt/makers/crew/main/comment/v2/CommentV2Controller.java index 6931e347..132b24d9 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/comment/v2/CommentV2Controller.java +++ b/main/src/main/java/org/sopt/makers/crew/main/comment/v2/CommentV2Controller.java @@ -19,8 +19,6 @@ import org.sopt.makers.crew.main.comment.v2.dto.response.CommentV2UpdateCommentResponseDto; import org.sopt.makers.crew.main.comment.v2.service.CommentV2Service; import org.sopt.makers.crew.main.common.dto.TempResponseDto; -import org.sopt.makers.crew.main.common.pagination.dto.PageMetaDto; -import org.sopt.makers.crew.main.common.pagination.dto.PageOptionsDto; import org.sopt.makers.crew.main.common.util.UserUtil; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity;