|
@@ -15,6 +15,43 @@ import {
|
|
|
UpdatePersonWorkStatusSchema
|
|
UpdatePersonWorkStatusSchema
|
|
|
} from '../schemas/order.schema';
|
|
} from '../schemas/order.schema';
|
|
|
import { OrderStatus, WorkStatus } from '@d8d/allin-enums';
|
|
import { OrderStatus, WorkStatus } from '@d8d/allin-enums';
|
|
|
|
|
+import { FileSchema } from '@d8d/file-module';
|
|
|
|
|
+
|
|
|
|
|
+// 简化的文件schema,用于订单资产查询
|
|
|
|
|
+const SimpleFileSchema = z.object({
|
|
|
|
|
+ id: z.number().int().positive().openapi({
|
|
|
|
|
+ description: '文件ID',
|
|
|
|
|
+ example: 1
|
|
|
|
|
+ }),
|
|
|
|
|
+ name: z.string().max(255).openapi({
|
|
|
|
|
+ description: '文件名称',
|
|
|
|
|
+ example: '项目计划书.pdf'
|
|
|
|
|
+ }),
|
|
|
|
|
+ type: z.string().max(50).nullable().openapi({
|
|
|
|
|
+ description: '文件类型',
|
|
|
|
|
+ example: 'application/pdf'
|
|
|
|
|
+ }),
|
|
|
|
|
+ size: z.number().int().positive().nullable().openapi({
|
|
|
|
|
+ description: '文件大小,单位字节',
|
|
|
|
|
+ example: 102400
|
|
|
|
|
+ }),
|
|
|
|
|
+ path: z.string().max(512).openapi({
|
|
|
|
|
+ description: '文件存储路径',
|
|
|
|
|
+ example: '/uploads/documents/2023/project-plan.pdf'
|
|
|
|
|
+ }),
|
|
|
|
|
+ fullUrl: z.string().optional().openapi({
|
|
|
|
|
+ description: '完整文件访问URL',
|
|
|
|
|
+ example: 'https://minio.example.com/d8dai/uploads/documents/2023/project-plan.pdf'
|
|
|
|
|
+ }),
|
|
|
|
|
+ description: z.string().nullable().openapi({
|
|
|
|
|
+ description: '文件描述',
|
|
|
|
|
+ example: '2023年度项目计划书'
|
|
|
|
|
+ }),
|
|
|
|
|
+ uploadTime: z.coerce.date().openapi({
|
|
|
|
|
+ description: '上传时间',
|
|
|
|
|
+ example: '2023-01-15T10:30:00Z'
|
|
|
|
|
+ })
|
|
|
|
|
+});
|
|
|
|
|
|
|
|
// 创建订单路由
|
|
// 创建订单路由
|
|
|
const createOrderRoute = createRoute({
|
|
const createOrderRoute = createRoute({
|
|
@@ -414,6 +451,7 @@ const queryOrderPersonAssetRoute = createRoute({
|
|
|
assetType: z.string().openapi({ description: '资产类型' }),
|
|
assetType: z.string().openapi({ description: '资产类型' }),
|
|
|
assetFileType: z.string().openapi({ description: '资产文件类型' }),
|
|
assetFileType: z.string().openapi({ description: '资产文件类型' }),
|
|
|
fileId: z.number().int().openapi({ description: '文件ID' }),
|
|
fileId: z.number().int().openapi({ description: '文件ID' }),
|
|
|
|
|
+ file: SimpleFileSchema.optional().openapi({ description: '文件信息' }),
|
|
|
relatedTime: z.coerce.date().openapi({ description: '关联时间' }),
|
|
relatedTime: z.coerce.date().openapi({ description: '关联时间' }),
|
|
|
createTime: z.coerce.date().openapi({ description: '创建时间' }),
|
|
createTime: z.coerce.date().openapi({ description: '创建时间' }),
|
|
|
updateTime: z.coerce.date().openapi({ description: '更新时间' })
|
|
updateTime: z.coerce.date().openapi({ description: '更新时间' })
|
|
@@ -846,6 +884,7 @@ const app = new OpenAPIHono<AuthContext>()
|
|
|
assetType: z.string(),
|
|
assetType: z.string(),
|
|
|
assetFileType: z.string(),
|
|
assetFileType: z.string(),
|
|
|
fileId: z.number().int(),
|
|
fileId: z.number().int(),
|
|
|
|
|
+ file: SimpleFileSchema.optional(),
|
|
|
relatedTime: z.coerce.date(),
|
|
relatedTime: z.coerce.date(),
|
|
|
createTime: z.coerce.date(),
|
|
createTime: z.coerce.date(),
|
|
|
updateTime: z.coerce.date()
|
|
updateTime: z.coerce.date()
|