|
|
@@ -1,5 +1,4 @@
|
|
|
import { z } from '@hono/zod-openapi';
|
|
|
-import { FileSchema } from '@/server/modules/files/file.schema';
|
|
|
|
|
|
// 基础消息Schema
|
|
|
export const ChatMessageSchema = z.object({
|
|
|
@@ -35,8 +34,14 @@ export const ChatMessageSchema = z.object({
|
|
|
example: 1,
|
|
|
description: '关联文件ID(用于图片消息)'
|
|
|
}),
|
|
|
- file: FileSchema.nullable().optional().openapi({
|
|
|
- description: '关联文件信息(用于图片消息)'
|
|
|
+ file: z.object({
|
|
|
+ id: z.number().int().positive().openapi({ description: '文件ID' }),
|
|
|
+ name: z.string().max(255).openapi({ description: '文件名', example: 'example.jpg' }),
|
|
|
+ fullUrl: z.string().openapi({ description: '文件完整URL', example: 'https://example.com/file.jpg' }),
|
|
|
+ type: z.string().nullable().openapi({ description: '文件类型', example: 'image/jpeg' }),
|
|
|
+ size: z.number().nullable().openapi({ description: '文件大小(字节)', example: 102400 })
|
|
|
+ }).nullable().optional().openapi({
|
|
|
+ description: '{描述}文件信息'
|
|
|
}),
|
|
|
createdBy: z.number().int().positive().nullable().openapi({
|
|
|
example: 1,
|