-
Notifications
You must be signed in to change notification settings - Fork 0
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 #145 from modern-agile-team/feature/user
- Loading branch information
Showing
4 changed files
with
96 additions
and
7 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
56 changes: 56 additions & 0 deletions
56
src/users/swagger-decorators/get-my-info-with-owner-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,56 @@ | ||
import { applyDecorators } from '@nestjs/common'; | ||
import { | ||
ApiHeaders, | ||
ApiOperation, | ||
ApiParam, | ||
ApiResponse, | ||
} from '@nestjs/swagger'; | ||
|
||
export function ApiGetMyInfoWithOwner() { | ||
return applyDecorators( | ||
ApiOperation({ | ||
summary: '내 정보 조회 API(owner 여부와 함께)', | ||
description: '내 정보 조회 API(owner 여부와 함께)', | ||
}), | ||
ApiResponse({ | ||
status: 200, | ||
description: '성공적으로 내 정보를 조회한 경우', | ||
content: { | ||
JSON: { | ||
example: { | ||
userId: 1, | ||
name: '홍길동', | ||
email: '[email protected]', | ||
gender: 'M', | ||
admin: false, | ||
provider: 'kakao', | ||
userImage: 'http://img.jpg', | ||
owner: false, | ||
}, | ||
}, | ||
}, | ||
}), | ||
ApiResponse({ | ||
status: 404, | ||
description: '내 정보를 찾을 수 없는 경우', | ||
content: { | ||
JSON: { | ||
example: { | ||
statusCode: 404, | ||
message: '사용자를 찾을 수 없습니다.', | ||
error: 'Not Found', | ||
}, | ||
}, | ||
}, | ||
}), | ||
ApiHeaders([ | ||
{ | ||
name: 'access_token', | ||
description: '액세스 토큰', | ||
required: true, | ||
example: '여기에 액세스 토큰', | ||
}, | ||
]), | ||
ApiParam({ name: 'targetId', example: 1, required: true }), | ||
); | ||
} |