103 lines
2.1 KiB
TypeScript
103 lines
2.1 KiB
TypeScript
import {
|
|
IsOptional,
|
|
IsString,
|
|
IsNumber,
|
|
Min,
|
|
IsDateString,
|
|
} from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
|
export class QueryStockDailyPriceDto {
|
|
@ApiPropertyOptional({
|
|
description: '股票代码',
|
|
example: '600519',
|
|
})
|
|
@IsOptional()
|
|
@IsString()
|
|
stockCode?: string;
|
|
|
|
@ApiPropertyOptional({
|
|
description: '股票名称(模糊查询)',
|
|
example: '茅台',
|
|
})
|
|
@IsOptional()
|
|
@IsString()
|
|
stockName?: string;
|
|
|
|
@ApiPropertyOptional({
|
|
description: '市场标识',
|
|
example: 'sh',
|
|
})
|
|
@IsOptional()
|
|
@IsString()
|
|
market?: string;
|
|
|
|
@ApiPropertyOptional({
|
|
description: '交易日期(模糊查询,支持日期范围)',
|
|
example: '2024-01',
|
|
})
|
|
@IsOptional()
|
|
@IsString()
|
|
tradeDate?: string;
|
|
|
|
@ApiPropertyOptional({
|
|
description: '起始日期',
|
|
example: '2024-01-01',
|
|
})
|
|
@IsOptional()
|
|
@IsDateString()
|
|
startDate?: string;
|
|
|
|
@ApiPropertyOptional({
|
|
description: '结束日期',
|
|
example: '2024-01-31',
|
|
})
|
|
@IsOptional()
|
|
@IsDateString()
|
|
endDate?: string;
|
|
|
|
@ApiPropertyOptional({
|
|
description: '页码',
|
|
example: 1,
|
|
minimum: 1,
|
|
default: 1,
|
|
})
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsNumber()
|
|
@Min(1)
|
|
page?: number = 1;
|
|
|
|
@ApiPropertyOptional({
|
|
description: '每页数量',
|
|
example: 10,
|
|
minimum: 1,
|
|
default: 10,
|
|
})
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsNumber()
|
|
@Min(1)
|
|
limit?: number = 10;
|
|
|
|
@ApiPropertyOptional({
|
|
description: '排序字段',
|
|
example: 'tradeDate',
|
|
default: 'tradeDate',
|
|
})
|
|
@IsOptional()
|
|
@IsString()
|
|
sortBy?: string = 'tradeDate';
|
|
|
|
@ApiPropertyOptional({
|
|
description: '排序方向',
|
|
example: 'DESC',
|
|
enum: ['ASC', 'DESC'],
|
|
default: 'DESC',
|
|
})
|
|
@IsOptional()
|
|
@IsString()
|
|
sortOrder?: 'ASC' | 'DESC' = 'DESC';
|
|
}
|