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

View File

@@ -0,0 +1,76 @@
import {
IsString,
IsNotEmpty,
IsOptional,
IsNumber,
IsBoolean,
MinLength,
MaxLength,
IsIn,
Min,
} from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
export class CreateBrokerDto {
@ApiProperty({
description: '券商代码',
example: 'HTZQ',
maxLength: 50,
})
@IsString()
@IsNotEmpty()
@MinLength(1)
@MaxLength(50)
brokerCode: string;
@ApiProperty({
description: '券商名称',
example: '华泰证券',
maxLength: 100,
})
@IsString()
@IsNotEmpty()
@MinLength(1)
@MaxLength(100)
brokerName: string;
@ApiProperty({
description: '地区/国家代码',
example: 'CN',
enum: ['CN', 'US', 'HK', 'SG', 'JP', 'UK', 'AU', 'CA', 'OTHER'],
})
@IsString()
@IsNotEmpty()
@IsIn(['CN', 'US', 'HK', 'SG', 'JP', 'UK', 'AU', 'CA', 'OTHER'])
region: string;
@ApiPropertyOptional({
description: '排序顺序',
example: 1,
minimum: 0,
default: 0,
})
@IsOptional()
@IsNumber()
@Min(0)
sortOrder?: number;
@ApiPropertyOptional({
description: '是否启用',
example: true,
default: true,
})
@IsOptional()
@IsBoolean()
isActive?: boolean;
@ApiPropertyOptional({
description: '券商图片地址',
example: 'https://example.com/broker-image.jpg',
maxLength: 200,
})
@IsOptional()
@IsString()
@MaxLength(200)
brokerImage?: string;
}