import { IsString, Matches } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class BindPhoneDto {
  @ApiProperty({ example: '13800138000' })
  @IsString()
  @Matches(/^1[3-9]\d{9}$/, { message: '手机号格式错误' })
  phoneNumber: string;

  @ApiProperty({ example: '123456' })
  @IsString()
  @Matches(/^\d{6}$/, { message: '验证码格式错误' })
  smsCode: string;
}
