22 lines
458 B
TypeScript
22 lines
458 B
TypeScript
import { IsEmail, IsString, Length } from 'class-validator';
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
|
|
export class EmailLoginDto {
|
|
@ApiProperty({
|
|
description: '邮箱地址',
|
|
example: 'user@example.com',
|
|
})
|
|
@IsEmail()
|
|
email: string;
|
|
|
|
@ApiProperty({
|
|
description: '验证码',
|
|
example: '123456',
|
|
minLength: 6,
|
|
maxLength: 6,
|
|
})
|
|
@IsString()
|
|
@Length(6, 6)
|
|
code: string;
|
|
}
|