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

[백한결] 휴대폰 인증 API #9

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat: send-code, verify-code dto 추가
baekhangyeol committed Feb 27, 2024
commit 13470bae40a927aad7ee0d47316caa314f2b7421
10 changes: 10 additions & 0 deletions src/modules/phone/dto/send-code.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { IsNotEmpty, IsString, Matches } from 'class-validator';

export class SendCodeDto {
@IsNotEmpty()
@IsString()
@Matches(/^010-\d{4}-\d{4}$/, {
message: '휴대전화 번호는 반드시 형식에 맞게 작성해야합니다.',
})
phoneNumber: string;
}
17 changes: 17 additions & 0 deletions src/modules/phone/dto/verify-code.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { IsNotEmpty, IsString, Length, Matches } from 'class-validator';

export class VerifyCodeDto {
@IsNotEmpty()
@IsString()
@Matches(/^010-\d{4}-\d{4}$/, {
message: '휴대전화 번호는 반드시 형식에 맞게 작성해야합니다.',
})
phoneNumber: string;

@IsNotEmpty()
@IsString()
@Length(6, 6, {
message: '코드는 여섯자리입니다.'
})
code: string;
}