| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- import { z } from '@hono/zod-openapi';
- export const DateNotesSchema = z.object({
- id: z.number().int('ID必须是整数').positive('ID必须是正整数').openapi({
- description: '日期备注ID',
- example: 1
- }),
- code: z.string().min(1, '股票代码不能为空').max(255, '股票代码最多255个字符').openapi({
- description: '股票代码',
- example: '600000'
- }),
- noteDate: z.coerce.date<Date>('备注日期格式不正确').openapi({
- description: '备注日期',
- example: '2024-01-15T00:00:00Z'
- }),
- note: z.string().min(1, '备注内容不能为空').max(255, '备注内容最多255个字符').openapi({
- description: '备注内容',
- example: '重点关注该股票走势'
- }),
- createdAt: z.coerce.date('创建时间格式不正确').openapi({
- description: '创建时间',
- example: '2024-01-15T10:30:00Z'
- }),
- updatedAt: z.coerce.date('更新时间格式不正确').openapi({
- description: '更新时间',
- example: '2024-01-15T10:30:00Z'
- })
- });
- export const CreateDateNotesDto = z.object({
- code: z.string().min(1, '股票代码不能为空').max(255, '股票代码最多255个字符').openapi({
- description: '股票代码',
- example: '600000'
- }),
- noteDate: z.coerce.date<Date>('备注日期格式不正确').openapi({
- description: '备注日期',
- example: '2024-01-15T00:00:00Z'
- }),
- note: z.string().min(1, '备注内容不能为空').max(255, '备注内容最多255个字符').openapi({
- description: '备注内容',
- example: '重点关注该股票走势'
- })
- });
- export const UpdateDateNotesDto = z.object({
- code: z.string().min(1, '股票代码不能为空').max(255, '股票代码最多255个字符').optional().openapi({
- description: '股票代码',
- example: '600000'
- }),
- noteDate: z.coerce.date<Date>('备注日期格式不正确').optional().openapi({
- description: '备注日期',
- example: '2024-01-15T00:00:00Z'
- }),
- note: z.string().min(1, '备注内容不能为空').max(255, '备注内容最多255个字符').optional().openapi({
- description: '备注内容',
- example: '更新后的备注内容'
- })
- });
|