-
Notifications
You must be signed in to change notification settings - Fork 0
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
Be/feature/#598 사용자 api 및 서비스 구현 #599
Merged
The head ref may contain hidden characters: "BE/feature/#598-\uC0AC\uC6A9\uC790-API-\uBC0F-\uC11C\uBE44\uC2A4-\uAD6C\uD604"
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8e22030
feat: 멤버 컨트롤러, 서비스 작성
kimyu0218 4b53311
feat: 컨트롤러 및 프로바이더 추가
kimyu0218 78d9766
feat: DTO 및 에러코드 정의
kimyu0218 2a4bc4a
style: Shorthand Property 적용
kimyu0218 8b91b48
test: MemberService 단위 테스트 작성
kimyu0218 d22b126
style: Shorthand Property 적용
kimyu0218 e3ab8b9
docs: verbose 옵션 추가
kimyu0218 1f57da2
test: Member e2e 테스트 작성
kimyu0218 cc905e1
refactor: jest 공통 부분 중복 정의 방지
kimyu0218 42f43d4
chore: 테스트 스크립트 수정 및 jest 설정정보 삭제
kimyu0218 d8ac96f
docs: ignorePatterns 추가
kimyu0218 0060370
feat: swagger 문서를 위한 정보 작성
kimyu0218 69020f3
style: path alias 설정에 따른 prettier 재적용
kimyu0218 6049fe9
feat: MembersController를 위한 데코레이터 정의
kimyu0218 60ae51d
feat: swagger 문서를 위한 데코레이터 추가
kimyu0218 91bf5f3
style: 테스트데이터 수정
kimyu0218 17724d3
fix: nickname은 필수 동의항목
kimyu0218 86feaed
style: 테스트 description 수정
kimyu0218 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const jestConfig = require('./jest.config'); | ||
|
||
module.exports = jestConfig('e2e'); |
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,3 @@ | ||
const jestConfig = require('./jest.config'); | ||
|
||
module.exports = jestConfig('unit'); |
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,17 @@ | ||
const commonJestConfig = require('./jest.config.json'); | ||
|
||
module.exports = (target) => { | ||
if (target === 'unit') { | ||
return { | ||
...commonJestConfig, | ||
testRegex: '.*\\.spec\\.ts$', | ||
}; | ||
} | ||
if (target === 'e2e') { | ||
return { | ||
...commonJestConfig, | ||
testRegex: '.e2e-spec.ts$', | ||
}; | ||
} | ||
return commonJestConfig; | ||
}; |
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
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
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,11 @@ | ||
import { ExceptionCodemap } from './type'; | ||
|
||
export const MEMBERS_CODEMAP: ExceptionCodemap = { | ||
NOT_FOUND: { | ||
status: 404, | ||
message: '사용자를 찾을 수 없습니다.', | ||
code: 'MME001', | ||
description: | ||
'해당 이메일에 해당하는 사용자가 존재하지 않습니다. 쿠키에 들어있는 email, providerId가 올바른지 확인해주세요.', | ||
}, | ||
}; | ||
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,12 @@ | ||
import { PartialType } from '@nestjs/swagger'; | ||
import { Member } from '../entities'; | ||
import { CreateMemberDto } from './create-member.dto'; | ||
|
||
export class MemberDto extends PartialType(CreateMemberDto) { | ||
static fromEntity(entity: Member): MemberDto { | ||
return { | ||
nickname: entity.nickname ?? '', | ||
profileUrl: entity.profileUrl, | ||
}; | ||
} | ||
} |
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,22 @@ | ||
import { Controller, Get, Req, UseGuards } from '@nestjs/common'; | ||
import { ApiTags } from '@nestjs/swagger'; | ||
import { JwtAuthGuard } from '@auth/guard'; | ||
import { MemberDto } from './dto/member.dto'; | ||
import { FindMemberByEmailDecorator } from './members.decorators'; | ||
import { MembersService } from './members.service'; | ||
|
||
@UseGuards(JwtAuthGuard) | ||
@Controller('/members') | ||
@ApiTags('✅ Members API') | ||
export class MembersController { | ||
constructor(private readonly membersService: MembersService) {} | ||
|
||
@Get() | ||
@FindMemberByEmailDecorator('사용자 정보', MemberDto) | ||
async findMemberByEmail(@Req() req: any): Promise<MemberDto> { | ||
return await this.membersService.findMemberByEmail( | ||
req.user.email, | ||
req.user.providerId, | ||
); | ||
} | ||
} |
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,6 @@ | ||
import { SwaggerDecoratorBuilder } from '@kimyu0218/swagger-decorator-builder'; | ||
|
||
export const FindMemberByEmailDecorator = (target: string, returnType: any) => | ||
new SwaggerDecoratorBuilder(target, 'GET', returnType) | ||
.removeResponse(403) | ||
.build(); |
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,8 +1,12 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { Member } from './entities'; | ||
import { MembersController } from './members.controller'; | ||
import { MembersService } from './members.service'; | ||
|
||
@Module({ | ||
imports: [TypeOrmModule.forFeature([Member])], | ||
controllers: [MembersController], | ||
providers: [MembersService], | ||
}) | ||
export class MembersModule {} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍 👍