fix: 优化后台体验与导出日志交互
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsInt, IsOptional, Min } from 'class-validator';
|
||||
import { IsIn, IsInt, IsOptional, IsString, Min } from 'class-validator';
|
||||
|
||||
export class PaginationDto {
|
||||
@ApiPropertyOptional({ description: '页码,从 1 开始', default: 1 })
|
||||
@@ -17,6 +17,16 @@ export class PaginationDto {
|
||||
@Min(0)
|
||||
pageSize = 20;
|
||||
|
||||
@ApiPropertyOptional({ description: '排序字段' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
sortField?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: '排序方向', enum: ['ascend', 'descend', 'asc', 'desc'] })
|
||||
@IsOptional()
|
||||
@IsIn(['ascend', 'descend', 'asc', 'desc'])
|
||||
sortOrder?: 'ascend' | 'descend' | 'asc' | 'desc';
|
||||
|
||||
get skip(): number {
|
||||
return (this.page - 1) * this.pageSize;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user