2026-01-28 13:03:28 +08:00
|
|
|
import { IsEmail, IsOptional, IsString, MinLength } from "class-validator";
|
|
|
|
|
import { ApiProperty } from "@nestjs/swagger";
|
2026-01-28 10:42:06 +08:00
|
|
|
|
|
|
|
|
export class UpdateUserDto {
|
2026-01-28 13:03:28 +08:00
|
|
|
@ApiProperty({ description: "邮箱", required: false })
|
|
|
|
|
@IsEmail({}, { message: "邮箱格式不正确" })
|
2026-01-28 10:42:06 +08:00
|
|
|
@IsOptional()
|
|
|
|
|
email?: string;
|
|
|
|
|
|
2026-01-28 13:03:28 +08:00
|
|
|
@ApiProperty({ description: "手机号", required: false })
|
2026-01-28 10:42:06 +08:00
|
|
|
@IsString()
|
|
|
|
|
@IsOptional()
|
|
|
|
|
phone?: string;
|
|
|
|
|
|
2026-01-28 13:03:28 +08:00
|
|
|
@ApiProperty({ description: "头像URL", required: false })
|
2026-01-28 10:42:06 +08:00
|
|
|
@IsString()
|
|
|
|
|
@IsOptional()
|
|
|
|
|
avatar?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class ChangePasswordDto {
|
2026-01-28 13:03:28 +08:00
|
|
|
@ApiProperty({ description: "旧密码" })
|
2026-01-28 10:42:06 +08:00
|
|
|
@IsString()
|
|
|
|
|
@IsOptional()
|
|
|
|
|
oldPassword: string;
|
|
|
|
|
|
2026-01-28 13:03:28 +08:00
|
|
|
@ApiProperty({ description: "新密码" })
|
2026-01-28 10:42:06 +08:00
|
|
|
@IsString()
|
2026-01-28 13:03:28 +08:00
|
|
|
@MinLength(6, { message: "密码至少6个字符" })
|
2026-01-28 10:42:06 +08:00
|
|
|
newPassword: string;
|
|
|
|
|
}
|