/** * 管理员相关 DTO * * 功能描述: * - 定义管理员登录与用户密码重置的请求结构 * - 使用 class-validator 进行参数校验 * * @author jianuo * @version 1.0.0 * @since 2025-12-19 */ import { ApiProperty } from '@nestjs/swagger'; import { IsNotEmpty, IsString, MinLength } from 'class-validator'; export class AdminLoginDto { @ApiProperty({ description: '登录标识符(用户名/邮箱/手机号)', example: 'admin' }) @IsString() @IsNotEmpty() identifier: string; @ApiProperty({ description: '密码', example: 'Admin123456' }) @IsString() @IsNotEmpty() password: string; } export class AdminResetPasswordDto { @ApiProperty({ description: '新密码(至少8位,包含字母和数字)', example: 'NewPass1234' }) @IsString() @IsNotEmpty() @MinLength(8) new_password: string; }