Skip to content

Commit

Permalink
feat: send-code, verify-code dto 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
baekhangyeol committed Feb 27, 2024
1 parent 64d1539 commit 13470ba
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
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;
}

0 comments on commit 13470ba

Please sign in to comment.