18 lines
434 B
TypeScript
18 lines
434 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsNotEmpty, IsString, MaxLength, MinLength } from 'class-validator';
|
|
|
|
export class LoginDto {
|
|
@ApiProperty({ description: '用户名', example: 'admin' })
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MaxLength(50)
|
|
username!: string;
|
|
|
|
@ApiProperty({ description: '密码', example: 'Admin@12345' })
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MinLength(6)
|
|
@MaxLength(64)
|
|
password!: string;
|
|
}
|