refactor: migrate backend framework from Express to NestJS

This commit is contained in:
2026-02-07 01:45:53 +08:00
parent 2c006c3330
commit 1eb8abb447
31 changed files with 6052 additions and 995 deletions

31
src/auth/dto/index.ts Normal file
View File

@@ -0,0 +1,31 @@
import { IsString, IsNotEmpty, MinLength, IsEmail, IsOptional } from 'class-validator';
export class LoginDto {
@IsString()
@IsNotEmpty({ message: '用户名不能为空' })
username: string;
@IsString()
@IsNotEmpty({ message: '密码不能为空' })
password: string;
}
export class ChangePasswordDto {
@IsString()
@IsNotEmpty({ message: '当前密码不能为空' })
currentPassword: string;
@IsString()
@MinLength(6, { message: '新密码长度至少为6位' })
newPassword: string;
}
export class UpdateProfileDto {
@IsString()
@IsNotEmpty({ message: '姓名不能为空' })
name: string;
@IsOptional()
@IsEmail({}, { message: '邮箱格式不正确' })
email?: string;
}