- 基于 NestJS + TypeScript + MySQL + Redis 架构 - 完整的模块化设计(认证、用户、小组、游戏、预约等) - JWT 认证和 RBAC 权限控制系统 - Docker 容器化部署支持 - 添加 CLAUDE.md 项目开发指南 - 配置 .gitignore 忽略文件 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
32 lines
827 B
TypeScript
32 lines
827 B
TypeScript
import { IsEmail, IsOptional, IsString, MinLength } from 'class-validator';
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
|
|
export class UpdateUserDto {
|
|
@ApiProperty({ description: '邮箱', required: false })
|
|
@IsEmail({}, { message: '邮箱格式不正确' })
|
|
@IsOptional()
|
|
email?: string;
|
|
|
|
@ApiProperty({ description: '手机号', required: false })
|
|
@IsString()
|
|
@IsOptional()
|
|
phone?: string;
|
|
|
|
@ApiProperty({ description: '头像URL', required: false })
|
|
@IsString()
|
|
@IsOptional()
|
|
avatar?: string;
|
|
}
|
|
|
|
export class ChangePasswordDto {
|
|
@ApiProperty({ description: '旧密码' })
|
|
@IsString()
|
|
@IsOptional()
|
|
oldPassword: string;
|
|
|
|
@ApiProperty({ description: '新密码' })
|
|
@IsString()
|
|
@MinLength(6, { message: '密码至少6个字符' })
|
|
newPassword: string;
|
|
}
|