feat:生文
This commit is contained in:
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user