28 lines
683 B
TypeScript
28 lines
683 B
TypeScript
import { IsString, IsNotEmpty, Matches } from 'class-validator';
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
|
|
export class SubmitKycDto {
|
|
@ApiProperty({ example: '张三' })
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
realName: string;
|
|
|
|
@ApiProperty({ example: '110101199001011234' })
|
|
@IsString()
|
|
@Matches(/^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[0-9Xx]$/, { message: '身份证号格式错误' })
|
|
idCardNumber: string;
|
|
|
|
@ApiProperty()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
idCardFrontUrl: string;
|
|
|
|
@ApiProperty()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
idCardBackUrl: string;
|
|
}
|
|
|
|
// 导出别名以兼容不同命名风格
|
|
export { SubmitKycDto as SubmitKYCDto };
|