|
|
@@ -1,5 +1,4 @@
|
|
|
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
|
|
-import { z } from '@hono/zod-openapi';
|
|
|
|
|
|
@Entity('date_notes')
|
|
|
@Index(['code', 'noteDate'], { unique: true })
|
|
|
@@ -21,25 +20,4 @@ export class DateNotes {
|
|
|
|
|
|
@Column({ name: 'updated_at', type: 'timestamp', default: () => 'CURRENT_TIMESTAMP', onUpdate: 'CURRENT_TIMESTAMP' })
|
|
|
updatedAt!: Date;
|
|
|
-}
|
|
|
-
|
|
|
-export const DateNotesSchema = z.object({
|
|
|
- id: z.number().int().positive().openapi({ description: 'ID', example: 1 }),
|
|
|
- code: z.string().max(255).openapi({ description: '股票代码', example: '001339' }),
|
|
|
- noteDate: z.date().openapi({ description: '备注日期', example: '2024-11-07T08:00:00Z' }),
|
|
|
- note: z.string().max(255).openapi({ description: '备注内容', example: 'test01' }),
|
|
|
- createdAt: z.date().openapi({ description: '创建时间', example: '2025-05-22T16:17:13Z' }),
|
|
|
- updatedAt: z.date().openapi({ description: '更新时间', example: '2025-05-22T16:17:13Z' })
|
|
|
-});
|
|
|
-
|
|
|
-export const CreateDateNotesDto = z.object({
|
|
|
- code: z.string().max(255).openapi({ description: '股票代码', example: '001339' }),
|
|
|
- noteDate: z.coerce.date().openapi({ description: '备注日期', example: '2024-11-07T08:00:00Z' }),
|
|
|
- note: z.string().max(255).openapi({ description: '备注内容', example: 'test01' })
|
|
|
-});
|
|
|
-
|
|
|
-export const UpdateDateNotesDto = z.object({
|
|
|
- code: z.string().max(255).optional().openapi({ description: '股票代码', example: '001339' }),
|
|
|
- noteDate: z.coerce.date().optional().openapi({ description: '备注日期', example: '2024-11-07T08:00:00Z' }),
|
|
|
- note: z.string().max(255).optional().openapi({ description: '备注内容', example: 'test01' })
|
|
|
-});
|
|
|
+}
|