Files
YiAi/service/src/modules/auth/dto/updatePassword.dto.ts
2024-01-27 19:53:17 +08:00

17 lines
753 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { IsNotEmpty, MinLength, MaxLength } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
export class UpdatePasswordDto {
@ApiProperty({ example: '123456', description: '用户旧密码' })
@IsNotEmpty({ message: '用户密码不能为空!' })
@MinLength(6, { message: '用户密码最低需要大于6位数' })
@MaxLength(30, { message: '用户密码最长不能超过30位数' })
oldPassword: string;
@ApiProperty({ example: '666666', description: '用户更新新密码' })
@IsNotEmpty({ message: '用户密码不能为空!' })
@MinLength(6, { message: '用户密码最低需要大于6位数' })
@MaxLength(30, { message: '用户密码最长不能超过30位数' })
password: string;
}