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

13 lines
365 B
TypeScript
Raw Normal View History

2022-02-20 11:51:55 +00:00
import { IsEmail, IsOptional, IsString } from 'class-validator';
export class UpdateUserDto {
@IsString({ message: '用户头像类型错误正确类型为String' })
@IsOptional()
readonly avatar?: string;
@IsString({ message: ' 用户邮箱类型错误正确类型为String' })
@IsEmail()
@IsOptional()
readonly email?: string;
}