think/packages/server/src/dtos/update-user.dto.ts

18 lines
602 B
TypeScript
Raw Normal View History

import { IsEmail, IsOptional, IsString, MinLength } from 'class-validator';
2022-02-20 11:51:55 +00:00
export class UpdateUserDto {
@IsString({ message: '用户头像类型错误正确类型为String' })
@IsOptional()
readonly avatar?: string;
@IsString({ message: ' 用户邮箱类型错误正确类型为String' })
@IsEmail()
@IsOptional()
readonly email?: string;
@MinLength(5, { message: '邮箱验证码至少5个字符' })
@IsString({ message: '邮箱验证码错误正确类型为String' })
@IsOptional({ message: '邮箱验证码不能为空' })
verifyCode?: string;
2022-02-20 11:51:55 +00:00
}