fix: 优化后台体验与导出日志交互

This commit is contained in:
Nixevol
2026-07-05 00:04:35 +08:00
parent 935375a904
commit 4122897725
44 changed files with 798 additions and 221 deletions
+11 -1
View File
@@ -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;
}