import { ApiProperty } from '@nestjs/swagger'; import { IsString, IsNotEmpty, IsOptional, MaxLength } from 'class-validator'; export class SearchAssetDto { @ApiProperty({ description: '搜索关键词(股票代码或名称)', example: '600519', maxLength: 50, }) @IsString() @IsNotEmpty() @MaxLength(50) keyword: string; @ApiProperty({ description: '资产类型过滤(可选)', example: 'stock', enum: ['stock', 'fund', 'bond'], required: false, }) @IsOptional() @IsString() assetType?: string; @ApiProperty({ description: '返回结果数量限制', example: 10, default: 10, required: false, }) @IsOptional() limit?: number; } export class AssetSearchResult { @ApiProperty({ description: '股票代码', example: '600519' }) symbol: string; @ApiProperty({ description: '股票名称', example: '贵州茅台' }) name: string; @ApiProperty({ description: '市场代码', example: 'sh' }) market: string; @ApiProperty({ description: '资产类型', example: 'stock' }) assetType: string; }