Skip to content

Commit

Permalink
Merge pull request #260 from boostcampwm2023/docs/be/swagger
Browse files Browse the repository at this point in the history
swagger λ¬Έμ„œ μˆ˜μ •
  • Loading branch information
sickbirdd authored Mar 8, 2024
2 parents 0e1347d + cc376d0 commit 729130e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
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

0 comments on commit 729130e

Please sign in to comment.