feat: 开发broker相关代码,开发全局代码

This commit is contained in:
R524809
2025-11-18 18:01:04 +08:00
parent a9d7fc9038
commit 7acadf191f
29 changed files with 3149 additions and 106 deletions
@@ -0,0 +1,99 @@
import {
IsOptional,
IsString,
IsNumber,
IsBoolean,
Min,
} from 'class-validator';
import { Type } from 'class-transformer';
import { ApiPropertyOptional } from '@nestjs/swagger';
export class QueryBrokerDto {
@ApiPropertyOptional({
description: '券商ID',
example: 1,
minimum: 1,
})
@IsOptional()
@Type(() => Number)
@IsNumber()
@Min(1)
brokerId?: number;
@ApiPropertyOptional({
description: '券商代码',
example: 'HTZQ',
})
@IsOptional()
@IsString()
brokerCode?: string;
@ApiPropertyOptional({
description: '券商名称',
example: '华泰证券',
})
@IsOptional()
@IsString()
brokerName?: string;
@ApiPropertyOptional({
description: '地区/国家代码',
example: 'CN',
enum: ['CN', 'US', 'HK', 'SG', 'JP', 'UK', 'AU', 'CA', 'OTHER'],
})
@IsOptional()
@IsString()
region?: string;
@ApiPropertyOptional({
description: '是否启用',
example: true,
})
@IsOptional()
@Type(() => Boolean)
@IsBoolean()
isActive?: boolean;
@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: 'createdAt',
default: 'createdAt',
})
@IsOptional()
@IsString()
sortBy?: string = 'createdAt';
@ApiPropertyOptional({
description: '排序方向',
example: 'DESC',
enum: ['ASC', 'DESC'],
default: 'DESC',
})
@IsOptional()
@IsString()
sortOrder?: 'ASC' | 'DESC' = 'DESC';
}