Skip to content

Commit

Permalink
#13 [chore] swagger 문서화 인터페이스 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
sohyundoh committed Jan 5, 2024
1 parent 00a7127 commit c2194f1
Showing 1 changed file with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package com.mile.controller.user;

import com.mile.common.dto.ErrorResponse;
import com.mile.common.dto.SuccessResponse;
import com.mile.external.client.dto.UserLoginRequest;
import com.mile.user.serivce.dto.AccessTokenGetSuccess;
import com.mile.user.serivce.dto.LoginSuccessResponse;
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.tags.Tag;
Expand All @@ -18,10 +21,13 @@ public interface UserControllerSwagger {
@Operation(summary = "소셜 로그인")
@ApiResponses(
value = {
@ApiResponse(responseCode = "200", description = "소셜 로그인이 완료되었습니다."),
@ApiResponse(responseCode = "200", description = "소셜 로그인이 완료되었습니다.",
content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(responseCode = "400", description =
"1. 요청한 값이 유효하지 않습니다.\n" + "2. 인가 코드가 만료되었습니다.\n"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류입니다.")
"1. 요청한 값이 유효하지 않습니다.\n" + "2. 인가 코드가 만료되었습니다.\n",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "500", description = "서버 내부 오류입니다.",
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
}
)
SuccessResponse<LoginSuccessResponse> login(
Expand All @@ -32,10 +38,10 @@ SuccessResponse<LoginSuccessResponse> login(
@Operation(summary = "액세스 토큰 재발급")
@ApiResponses(
value = {
@ApiResponse(responseCode = "200", description = "액세스 토큰 재발급이 완료되었습니다."),
@ApiResponse(responseCode = "401", description = "리프레시 토큰이 유효하지 않습니다."),
@ApiResponse(responseCode = "404", description = "해당 유저의 리프레시 토큰이 존재하지 않습니다."),
@ApiResponse(responseCode = "500", description = "서버 내부 오류입니다.")
@ApiResponse(responseCode = "200", description = "액세스 토큰 재발급이 완료되었습니다.", content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(responseCode = "401", description = "리프레시 토큰이 유효하지 않습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "404", description = "해당 유저의 리프레시 토큰이 존재하지 않습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "500", description = "서버 내부 오류입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
}
)
SuccessResponse<AccessTokenGetSuccess> refreshToken(
Expand All @@ -45,11 +51,12 @@ SuccessResponse<AccessTokenGetSuccess> refreshToken(
@Operation(summary = "회원 탈퇴")
@ApiResponses(
value = {
@ApiResponse(responseCode = "200", description = "회원 삭제가 완료되었습니다."),
@ApiResponse(responseCode = "200", description = "회원 삭제가 완료되었습니다.", content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(responseCode = "404", description =
"1. 해당 유저의 리프레시 토큰이 존재하지 않습니다.\n" +
"2. 해당 유저는 존재하지 않습니다."
)
"2. 해당 유저는 존재하지 않습니다.",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "500", description = "서버 내부 오류입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
}
)
SuccessResponse deleteUser(
Expand All @@ -59,11 +66,12 @@ SuccessResponse deleteUser(
@Operation(summary = "로그아웃")
@ApiResponses(
value = {
@ApiResponse(responseCode = "200", description = "로그아웃이 완료되었습니다."),
@ApiResponse(responseCode = "404", description = "해당 유저의 리프레시 토큰이 존재하지 않습니다.")
@ApiResponse(responseCode = "200", description = "로그아웃이 완료되었습니다.", content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(responseCode = "404", description = "해당 유저의 리프레시 토큰이 존재하지 않습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "500", description = "서버 내부 오류입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
}
)
SuccessResponse logout(
Principal principal
final Principal principal
);
}

0 comments on commit c2194f1

Please sign in to comment.