Skip to content

Commit

Permalink
fix: 스웨거 오류 해결 (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekks authored Aug 9, 2024
1 parent 351ce19 commit 302e189
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -31,15 +33,27 @@ 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<CommentV2CreateCommentResponseDto> createComment(
@Valid @RequestBody CommentV2CreateCommentBodyDto requestBody, Principal principal);

@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<CommentV2UpdateCommentResponseDto> updateComment(
@PathVariable Integer commentId,
Expand All @@ -49,7 +63,14 @@ ResponseEntity<CommentV2UpdateCommentResponseDto> 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<CommentV2ReportCommentResponseDto> reportComment(
@PathVariable Integer commentId, Principal principal);
Expand All @@ -64,7 +85,9 @@ ResponseEntity<CommentV2ReportCommentResponseDto> reportComment(
@Operation(summary = "댓글에서 유저 멘션")
@ResponseStatus(HttpStatus.OK)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(
responseCode = "200",
description = "성공"),
})
ResponseEntity<Void> mentionUserInComment(
@Valid @RequestBody CommentV2MentionUserInCommentRequestDto requestBody,
Expand All @@ -73,31 +96,49 @@ ResponseEntity<Void> 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<CommentV2GetCommentsResponseDto> getComments(
@Valid @ModelAttribute @Parameter(hidden = true) CommentV2GetCommentsQueryDto request,
Principal principal);

@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<TempResponseDto<CommentV2GetCommentsResponseDto>> getCommentsTemp(
@Valid @ModelAttribute @Parameter(hidden = true) CommentV2GetCommentsQueryDto request,
Principal principal);

@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<CommentV2SwitchCommentLikeResponseDto> switchCommentLike(Principal principal,
@PathVariable Integer commentId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 302e189

Please sign in to comment.