Skip to content

Commit

Permalink
Merge pull request #49 from tukcomCD2024/fix/swagger
Browse files Browse the repository at this point in the history
fix: swagger 문서화 수정
  • Loading branch information
GaBaljaintheroom authored Jan 20, 2024
2 parents 0257551 + 97fb21c commit 88eea0c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package site.timecapsulearchive.core.domain.auth.api;

import io.swagger.v3.oas.annotations.Operation;
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 io.swagger.v3.oas.annotations.security.SecurityRequirement;
Expand All @@ -16,6 +18,7 @@
import site.timecapsulearchive.core.domain.auth.dto.response.TokenResponse;
import site.timecapsulearchive.core.domain.auth.dto.response.VerificationMessageSendResponse;
import site.timecapsulearchive.core.global.common.response.ApiSpec;
import site.timecapsulearchive.core.global.error.ErrorResponse;

public interface AuthApi {

Expand Down Expand Up @@ -115,6 +118,18 @@ public interface AuthApi {
@ApiResponse(
responseCode = "200",
description = "ok"
),
@ApiResponse(
responseCode = "400",
description = """
요청이 잘못되어 발생하는 오류이다.
<ul>
<li>올바르지 않은 요청인 경우 예외가 발생한다.</li>
<li>유효하지 않은 리프레시 토큰인 경우 오류가 발생한다.</li>
<li>이미 재발급에 사용된 리프레시 토큰인 경우 오류가 발생한다.</li>
</ul>
""",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))
)
})
@PostMapping(
Expand All @@ -134,12 +149,30 @@ public interface AuthApi {
@ApiResponses(value = {
@ApiResponse(
responseCode = "202",
description = "처리 시작"
description = "문자 전송 처리 시작"
),
@ApiResponse(
responseCode = "401",
description = "인증 수단이 올바르지 않으면 오류가 발생한다."
),
@ApiResponse(
responseCode = "429",
description = "24시간 이내 5회 초과 요청시 API 요청 제한 오류가 발생한다.",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))
),
@ApiResponse(
responseCode = "500",
description = """
외부 문자 발송 API 오류 시 발생한다. 오류 응답은 링크 참조 \n
<a href="https://smartsms.aligo.in/admin/api/spec.html">알리고 api</href>
""",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))
)
})
@PostMapping(
value = "/verification/send-message",
consumes = {"application/json"}
consumes = {"application/json"},
produces = {"application/json"}
)
ResponseEntity<ApiSpec<VerificationMessageSendResponse>> sendVerificationMessage(
Long memberId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import io.swagger.v3.oas.annotations.media.Schema;

@Schema(name = "인증 문자 발송 응답")
@Schema(description = "인증 문자 발송 응답")
public record VerificationMessageSendResponse(

@Schema(name = "전송 상태")
@Schema(description = "전송 상태")
Integer status,

@Schema(name = "상태 메시지")
@Schema(description = "상태 메시지")
String message
) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public interface MemberApi {
})
@GetMapping(
value = "/status",
consumes = {"application/json"},
produces = {"application/json"}
)
ResponseEntity<ApiSpec<MemberStatusResponse>> checkStatus(
Expand Down

0 comments on commit 88eea0c

Please sign in to comment.