-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from boostcampwm-2024/be/feature/edit_nickname
[BE/feature] 닉네임 수정 api 구현
- Loading branch information
Showing
13 changed files
with
119 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import { applyDecorators } from '@nestjs/common'; | ||
import { ApiBearerAuth, ApiResponse } from '@nestjs/swagger'; | ||
import { ApiResponse } from '@nestjs/swagger'; | ||
import { LogoutSuccessResponseDto } from '../dto/logout.dto'; | ||
import { TokenDecorator } from 'src/global/utils/tokenSwagger'; | ||
|
||
export function logoutResponseDecorator() { | ||
return applyDecorators( | ||
ApiBearerAuth(), | ||
TokenDecorator(), | ||
ApiResponse({ | ||
status: 200, | ||
description: '로그아웃 성공', | ||
type: LogoutSuccessResponseDto | ||
}), | ||
TokenDecorator() | ||
}) | ||
); | ||
} |
11 changes: 5 additions & 6 deletions
11
apps/backend/src/auth/decorator/updateIntroduce.decorator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import { applyDecorators } from '@nestjs/common'; | ||
import { ApiBearerAuth, ApiResponse } from '@nestjs/swagger'; | ||
import { ApiResponse } from '@nestjs/swagger'; | ||
import { TokenDecorator } from 'src/global/utils/tokenSwagger'; | ||
import { updateIntroduceSuccessResponseDto } from '../dto/updateIntroduce.dto'; | ||
import { UpdateIntroduceSuccessResponseDto } from '../dto/updateIntroduce.dto'; | ||
|
||
export function updateIntroduceResponseDecorator() { | ||
return applyDecorators( | ||
ApiBearerAuth(), | ||
TokenDecorator(), | ||
ApiResponse({ | ||
status: 200, | ||
description: '소개글 수정 성공', | ||
type: updateIntroduceSuccessResponseDto | ||
}), | ||
TokenDecorator() | ||
type: UpdateIntroduceSuccessResponseDto | ||
}) | ||
); | ||
} |
32 changes: 32 additions & 0 deletions
32
apps/backend/src/auth/decorator/updateNickname.decorator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { applyDecorators } from '@nestjs/common'; | ||
import { ApiResponse } from '@nestjs/swagger'; | ||
import { TokenDecorator } from 'src/global/utils/tokenSwagger'; | ||
import { UpdateNicknameSuccessResponseDto } from '../dto/updateNickname.dto'; | ||
|
||
export function updateNicknameResponseDecorator() { | ||
return applyDecorators( | ||
TokenDecorator(), | ||
ApiResponse({ | ||
status: 200, | ||
description: '닉네임 수정 성공', | ||
type: UpdateNicknameSuccessResponseDto | ||
}), | ||
ApiResponse({ | ||
status: 400, | ||
description: '유효하지 않은 입력값 에러', | ||
content: { | ||
'application/json': { | ||
examples: { | ||
invalidNickname: { | ||
summary: '닉네임이 2~10자 범위를 벗어남', | ||
value: { | ||
code: 400, | ||
message: '닉네임은 2자에서 10자 사이로 입력해주세요.' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
export class UpdateNicknameDto { | ||
@ApiProperty({ | ||
description: '닉네임', | ||
example: '홍길동' | ||
}) | ||
nickname: string; | ||
} | ||
|
||
export class UpdateNicknameSuccessResponseDto { | ||
@ApiProperty({ | ||
description: '응답 코드', | ||
example: 200 | ||
}) | ||
code: number; | ||
|
||
@ApiProperty({ | ||
description: '응답 메세지', | ||
example: '닉네임이 변경되었습니다.' | ||
}) | ||
message: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters