feat:生文

This commit is contained in:
R524809
2026-01-30 16:04:10 +08:00
parent d4fc8f44ee
commit e7b4a948ac
63 changed files with 981954 additions and 1124 deletions
@@ -1,4 +1,4 @@
import { IsOptional, IsString, IsNumber, Min, IsEnum } from 'class-validator';
import { IsOptional, IsString, IsNumber, Min, IsEnum, IsIn } from 'class-validator';
import { Type } from 'class-transformer';
import { ApiPropertyOptional } from '@nestjs/swagger';
import { UserRole, UserStatus } from '../user.entity';
@@ -12,6 +12,14 @@ export class QueryUserDto {
@IsString()
username?: string;
@ApiPropertyOptional({
description: '真实姓名',
example: '张三',
})
@IsOptional()
@IsString()
realName?: string;
@ApiPropertyOptional({
description: '邮箱',
example: 'admin@example.com',
@@ -61,4 +69,25 @@ export class QueryUserDto {
@IsNumber()
@Min(1)
limit?: number = 10;
@ApiPropertyOptional({
description: '排序字段',
example: 'createdAt',
default: 'createdAt',
})
@IsOptional()
@IsString()
@IsIn(['createdAt', 'updatedAt', 'lastLoginAt'])
sortBy?: string = 'createdAt';
@ApiPropertyOptional({
description: '排序方向',
example: 'DESC',
enum: ['ASC', 'DESC'],
default: 'DESC',
})
@IsOptional()
@IsString()
@IsIn(['ASC', 'DESC'])
sortOrder?: 'ASC' | 'DESC' = 'DESC';
}