|
|
@@ -1,5 +1,4 @@
|
|
|
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
|
|
|
-import { z } from '@hono/zod-openapi';
|
|
|
|
|
|
@Entity('stock_xunlian_codes')
|
|
|
export class StockXunlianCodes {
|
|
|
@@ -29,34 +28,4 @@ export class StockXunlianCodes {
|
|
|
|
|
|
@Column({ name: 'updated_at', type: 'timestamp', default: () => 'CURRENT_TIMESTAMP', onUpdate: 'CURRENT_TIMESTAMP' })
|
|
|
updatedAt!: Date;
|
|
|
-}
|
|
|
-
|
|
|
-export const StockXunlianCodesSchema = z.object({
|
|
|
- id: z.number().int().positive().openapi({ description: 'ID', example: 1 }),
|
|
|
- code: z.string().max(255).openapi({ description: '股票代码', example: '001339' }),
|
|
|
- stockName: z.string().max(255).openapi({ description: '股票名称', example: 'test01' }),
|
|
|
- name: z.string().max(255).openapi({ description: '案例名称', example: 'test222' }),
|
|
|
- type: z.string().max(255).nullable().openapi({ description: '案例类型', example: '技术分析' }),
|
|
|
- description: z.string().max(255).nullable().openapi({ description: '案例描述', example: '这是一个测试案例' }),
|
|
|
- tradeDate: z.date().openapi({ description: '交易日期', example: '2025-05-21T08:00:00Z' }),
|
|
|
- createdAt: z.date().openapi({ description: '创建时间', example: '2025-05-22T16:58:01Z' }),
|
|
|
- updatedAt: z.date().openapi({ description: '更新时间', example: '2025-05-22T17:19:32Z' })
|
|
|
-});
|
|
|
-
|
|
|
-export const CreateStockXunlianCodesDto = z.object({
|
|
|
- code: z.string().max(255).openapi({ description: '股票代码', example: '001339' }),
|
|
|
- stockName: z.string().max(255).openapi({ description: '股票名称', example: 'test01' }),
|
|
|
- name: z.string().max(255).openapi({ description: '案例名称', example: 'test222' }),
|
|
|
- type: z.string().max(255).nullable().openapi({ description: '案例类型', example: '技术分析' }),
|
|
|
- description: z.string().max(255).nullable().optional().openapi({ description: '案例描述', example: '这是一个测试案例' }),
|
|
|
- tradeDate: z.coerce.date().openapi({ description: '交易日期', example: '2025-05-21T08:00:00Z' })
|
|
|
-});
|
|
|
-
|
|
|
-export const UpdateStockXunlianCodesDto = z.object({
|
|
|
- code: z.string().max(255).optional().openapi({ description: '股票代码', example: '001339' }),
|
|
|
- stockName: z.string().max(255).optional().openapi({ description: '股票名称', example: 'test01' }),
|
|
|
- name: z.string().max(255).optional().openapi({ description: '案例名称', example: 'test222' }),
|
|
|
- type: z.string().max(255).nullable().optional().openapi({ description: '案例类型', example: '技术分析' }),
|
|
|
- description: z.string().max(255).nullable().optional().openapi({ description: '案例描述', example: '这是一个测试案例' }),
|
|
|
- tradeDate: z.coerce.date().optional().openapi({ description: '交易日期', example: '2025-05-21T08:00:00Z' })
|
|
|
-});
|
|
|
+}
|