- 使用z.coerce.number()确保timestamp字段能正确转换字符串类型的时间戳为数字
@@ -27,7 +27,7 @@ export const ChatMessageSchema = z.object({
example: '张三',
description: '发送者名称'
}),
- timestamp: z.number().int().positive().openapi({
+ timestamp: z.coerce.number().int().positive().openapi({
example: 1704067200000,
description: '消息时间戳'