| 1 | /* |
| 2 | * @Author: nevin |
| 3 | * @Date: 2022-03-17 18:14:52 |
| 4 | * @LastEditors: nevin |
| 5 | * @LastEditTime: 2024-10-10 15:45:59 |
| 6 | * @Description: 表单数据 |
| 7 | */ |
| 8 | |
| 9 | import { ApiProperty } from '@nestjs/swagger'; |
| 10 | import { Expose, Type } from 'class-transformer'; |
| 11 | import { IsInt, IsOptional } from 'class-validator'; |
| 12 | |
| 13 | export class TableDto { |
| 14 | @Type(() => Number) |
| 15 | @IsInt({ message: '页码必须是数值' }) |
| 16 | @IsOptional() |
| 17 | @Expose() |
| 18 | readonly pageNo?: number = 1; |
| 19 | |
| 20 | @Type(() => Number) |
| 21 | @IsInt({ message: '每页个数必须是数值' }) |
| 22 | @Expose() |
| 23 | @IsOptional() |
| 24 | readonly pageSize?: number = 10; |
| 25 | |
| 26 | @Type(() => Number) |
| 27 | @IsInt({ message: '分页标识必须是数值' }) |
| 28 | @IsOptional() |
| 29 | readonly paging?: number = 1; |
| 30 | } |
| 31 | |
| 32 | export class TableResDto { |
| 33 | @ApiProperty({ title: '页码', description: '页码' }) |
| 34 | readonly pageNo: number = 1; |
| 35 | |
| 36 | @ApiProperty({ title: '页数', description: '页数' }) |
| 37 | readonly pageSize: number = 10; |
| 38 | |
| 39 | @ApiProperty({ title: '总数', description: '总数' }) |
| 40 | readonly count: number = 0; |
| 41 | } |
| 42 |