feat: 开发broker相关代码,开发全局代码
This commit is contained in:
76
apps/api/src/modules/broker/dto/create-broker.dto.ts
Normal file
76
apps/api/src/modules/broker/dto/create-broker.dto.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user