79 lines
1.6 KiB
TypeScript
79 lines
1.6 KiB
TypeScript
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
||
|
||
export class CreateUserDto {
|
||
@ApiProperty({ description: '用户名' })
|
||
@IsString()
|
||
@IsNotEmpty()
|
||
username!: string;
|
||
|
||
@ApiProperty({ description: '初始密码' })
|
||
@IsString()
|
||
@IsNotEmpty()
|
||
password!: string;
|
||
|
||
@ApiPropertyOptional({ description: '昵称' })
|
||
@IsOptional()
|
||
@IsString()
|
||
nickname?: string;
|
||
|
||
@ApiPropertyOptional({ description: '邮箱' })
|
||
@IsOptional()
|
||
@IsString()
|
||
email?: string;
|
||
|
||
@ApiPropertyOptional({ description: '手机号' })
|
||
@IsOptional()
|
||
@IsString()
|
||
phone?: string;
|
||
|
||
@ApiPropertyOptional({ description: '头像' })
|
||
@IsOptional()
|
||
@IsString()
|
||
avatar?: string;
|
||
|
||
@ApiPropertyOptional({ description: '所属部门 code' })
|
||
@IsOptional()
|
||
@IsString()
|
||
orgCode?: string;
|
||
}
|
||
|
||
export class UpdateUserDto {
|
||
@ApiPropertyOptional({ description: '昵称' })
|
||
@IsOptional()
|
||
@IsString()
|
||
nickname?: string;
|
||
|
||
@ApiPropertyOptional({ description: '邮箱' })
|
||
@IsOptional()
|
||
@IsString()
|
||
email?: string;
|
||
|
||
@ApiPropertyOptional({ description: '手机号' })
|
||
@IsOptional()
|
||
@IsString()
|
||
phone?: string;
|
||
|
||
@ApiPropertyOptional({ description: '头像' })
|
||
@IsOptional()
|
||
@IsString()
|
||
avatar?: string;
|
||
|
||
@ApiPropertyOptional({ description: '所属部门 code' })
|
||
@IsOptional()
|
||
@IsString()
|
||
orgCode?: string;
|
||
|
||
@ApiPropertyOptional({ description: '状态:enabled/disabled/locked' })
|
||
@IsOptional()
|
||
@IsString()
|
||
status?: string;
|
||
}
|
||
|
||
export class ResetPasswordDto {
|
||
@ApiProperty({ description: '新密码' })
|
||
@IsString()
|
||
@IsNotEmpty()
|
||
password!: string;
|
||
}
|