Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swagger 문서 수정 #260

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backend/src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { HttpExceptionFilter } from 'src/exceptions/http.exception.filter';
import {
AuthSuccess,
ExpiredTokenError,
InvalidCodeError,
InvalidTokenError,
RefreshJWTSuccess,
VerifyEmailSuccess,
Expand Down Expand Up @@ -64,6 +65,7 @@ export class AuthController {
@ApiOperation({ summary: '이메일 인증 코드 검증', description: '이메일 인증 코드를 검증한다.' })
@ApiOkResponse({ type: VerifyEmailSuccess, description: '이메일 인증 성공' })
@ApiBadRequestResponse({ type: RequestError, description: '잘못된 요청입니다.' })
@ApiUnauthorizedResponse({ type: InvalidCodeError, description: '유효하지 않은 인증코드' })
@ApiNotFoundResponse({ type: EmailNotFound, description: '해당 이메일로 발급받은 코드가 없거나 만료됨' })
@ApiBody({ type: VerifyEmailDto })
@Post('/verify/email')
Expand Down
13 changes: 13 additions & 0 deletions backend/src/dto/auth.swagger.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,16 @@ export class VerifyEmailSuccess {
})
verifyToken: string;
}

export class InvalidCodeError {
@ApiProperty({
example: HttpStatus.UNAUTHORIZED,
description: 'Http 상태 코드',
})
statusCode: number;
@ApiProperty({
example: '유효하지 않은 인증 코드.',
description: '메시지',
})
message: string;
}
5 changes: 5 additions & 0 deletions backend/src/dto/user.swagger.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ export class CheckEmailVerificatedSuccess {
description: 'Http 상태 코드',
})
statusCode: number;
@ApiProperty({
example: 'true',
description: '사용자 이메일 인증 여부',
})
verified: boolean;
@ApiProperty({
example: '사용자 이메일 인증 여부 조회 성공',
description: '메시지',
Expand Down
2 changes: 1 addition & 1 deletion backend/src/user/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export class UsersController {
name: 'Authorization Bearer Token',
description: 'accessToken',
})
@ApiOkResponse({ type: CheckEmailVerificatedSuccess, description: '이메일 인증 코드 발송 성공' })
@ApiOkResponse({ type: CheckEmailVerificatedSuccess, description: '사용자 이메일 인증 여부 확인 성공' })
@ApiBadRequestResponse({ type: RequestError, description: '잘못된 요청입니다.' })
@ApiNotFoundResponse({ type: EmailNotFound, description: '해당 이메일의 사용자를 찾을 수 없음' })
@ApiUnauthorizedResponse({ type: UnauthorizedRequest, description: '승인되지 않은 요청' })
Expand Down