From a2ef1db88a2fead2b08e1aee3aa9ad51fff322ab Mon Sep 17 00:00:00 2001 From: zhishi <1951671751@qq.com> Date: Sat, 21 Mar 2026 17:50:57 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=AE=8C=E5=96=84flow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/production/editStoryboard/getStoryboardFlow.ts | 1 - src/routes/production/editStoryboard/saveStoryboardFlow.ts | 1 + src/routes/production/getStoryboardData.ts | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes/production/editStoryboard/getStoryboardFlow.ts b/src/routes/production/editStoryboard/getStoryboardFlow.ts index 682fbfa..19447db 100644 --- a/src/routes/production/editStoryboard/getStoryboardFlow.ts +++ b/src/routes/production/editStoryboard/getStoryboardFlow.ts @@ -12,7 +12,6 @@ export default router.post( }), async (req, res) => { const { id } = req.body; - console.log("%c Line:15 🥤 id", "background:#e41a6a", id); const storyboardFlowData = await u.db("o_storyboardFlow").where("stroryboardId", id).first(); if (storyboardFlowData?.flowData) { const parseFlow = JSON.parse(storyboardFlowData.flowData); diff --git a/src/routes/production/editStoryboard/saveStoryboardFlow.ts b/src/routes/production/editStoryboard/saveStoryboardFlow.ts index 74d1dfb..e16281b 100644 --- a/src/routes/production/editStoryboard/saveStoryboardFlow.ts +++ b/src/routes/production/editStoryboard/saveStoryboardFlow.ts @@ -27,6 +27,7 @@ export default router.post( }); const [id] = await u.db("o_storyboard").insert({ filePath: new URL(imageUrl).pathname, + createTime: Date.now(), }); await u.db("o_storyboardFlow").insert({ stroryboardId: id, diff --git a/src/routes/production/getStoryboardData.ts b/src/routes/production/getStoryboardData.ts index 4d5dc5d..39f9f6f 100644 --- a/src/routes/production/getStoryboardData.ts +++ b/src/routes/production/getStoryboardData.ts @@ -18,7 +18,8 @@ export default router.post( storyboardData.map(async (i) => { return { ...i, - image: i.filePath ? await u.oss.getFileUrl(i.filePath!) : "", + title: i.name, + src: i.filePath ? await u.oss.getFileUrl(i.filePath!) : "", }; }), ); From 40c732d0213c70bbf9fda632af465a72f03bf409 Mon Sep 17 00:00:00 2001 From: zhishi <1951671751@qq.com> Date: Sat, 21 Mar 2026 18:17:38 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=88=86=E9=95=9C?= =?UTF-8?q?=E8=A1=A8=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/initDB.ts | 3 +++ src/types/database.d.ts | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/lib/initDB.ts b/src/lib/initDB.ts index 0631fb6..0a9e0da 100644 --- a/src/lib/initDB.ts +++ b/src/lib/initDB.ts @@ -314,6 +314,9 @@ export default async (knex: Knex, forceInit: boolean = false): Promise => table.text("seconds"); table.text("filePath"); table.text("frameType"); + table.text("camera"); + table.text("sound"); + table.text("associateAssetsIds"); table.integer("createTime"); table.primary(["id"]); table.unique(["id"]); diff --git a/src/types/database.d.ts b/src/types/database.d.ts index 775ad75..cc7ae3a 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -1,6 +1,16 @@ -// @db-hash 8af8e41e3ca0cb5ee554944515d72ba8 +// @db-hash 4e0fc4daee764ea1a80bacd64b0cac2b //该文件由脚本自动生成,请勿手动修改 +export interface _o_storyboard_old_20260321 { + 'createTime'?: number | null; + 'detail'?: string | null; + 'filePath'?: string | null; + 'frameType'?: string | null; + 'id'?: number; + 'name'?: string | null; + 'prompt'?: string | null; + 'seconds'?: string | null; +} export interface memories { 'content': string; 'createTime': number; @@ -162,6 +172,8 @@ export interface o_skills { 'startTime'?: number | null; } export interface o_storyboard { + 'associateAssetsIds'?: string | null; + 'camera'?: string | null; 'createTime'?: number | null; 'detail'?: string | null; 'filePath'?: string | null; @@ -170,6 +182,8 @@ export interface o_storyboard { 'name'?: string | null; 'prompt'?: string | null; 'seconds'?: string | null; + 'sound'?: string | null; + 'TEXT'?: any | null; } export interface o_storyboardFlow { 'flowData': string; @@ -242,6 +256,7 @@ export interface o_videoConfig { } export interface DB { + "_o_storyboard_old_20260321": _o_storyboard_old_20260321; "memories": memories; "o_agentDeploy": o_agentDeploy; "o_artStyle": o_artStyle; From cf22b8f94838ebc9bd83b6d870be35d515923fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B8=85?= <2944435683> Date: Mon, 23 Mar 2026 10:06:31 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=94=9F=E6=88=90=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/initDB.ts | 9 +- src/routes/production/getProductionData.ts | 32 +++++- .../production/workbench/generateVideo.ts | 2 +- src/types/database.d.ts | 105 +++--------------- 4 files changed, 52 insertions(+), 96 deletions(-) diff --git a/src/lib/initDB.ts b/src/lib/initDB.ts index 0631fb6..8a26b3e 100644 --- a/src/lib/initDB.ts +++ b/src/lib/initDB.ts @@ -309,11 +309,12 @@ export default async (knex: Knex, forceInit: boolean = false): Promise => table.integer("id").notNullable(); table.integer("scriptId"); table.text("name"); - table.text("detail"); table.text("prompt"); - table.text("seconds"); table.text("filePath"); - table.text("frameType"); + table.text("model"); + table.text("mode"); + table.text("duration"); + table.text("resolution"); table.integer("createTime"); table.primary(["id"]); table.unique(["id"]); @@ -350,7 +351,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise => builder: (table) => { table.integer("id").notNullable(); table.integer("storyboardId"); - table.integer("videoId"); + table.integer("videoId"); table.integer("audio"); // 声音 table.text("model"); // 模型 table.text("mode"); // 模式: diff --git a/src/routes/production/getProductionData.ts b/src/routes/production/getProductionData.ts index 4c71293..dded0bf 100644 --- a/src/routes/production/getProductionData.ts +++ b/src/routes/production/getProductionData.ts @@ -71,11 +71,39 @@ export default router.post( const data = await Promise.all( storyboards.map(async (storyboard) => { const sid = storyboard.id as number; + const config = configMap.get(sid) ?? null; + let configDataWithFilePath: any[] = []; + if (config?.data) { + const parsedData: { id: number; type: string }[] = JSON.parse(config.data); + configDataWithFilePath = await Promise.all( + parsedData.map(async (item) => { + if (item.type === "storyboard") { + const row = await u.db("o_storyboard").where("id", item.id).select("filePath").first(); + return row?.filePath ? await u.oss.getFileUrl(row.filePath) : null; + } + if (item.type === "assets") { + const row = await u + .db("o_assets") + .where("o_assets.id", item.id) + .leftJoin("o_image", "o_assets.imageId", "o_image.id") + .select("o_image.filePath") + .first(); + return row?.filePath ? await u.oss.getFileUrl(row.filePath) : null; + } + return null; + }), + ); + } return { ...storyboard, filePath: storyboard.filePath && (await u.oss.getFileUrl(storyboard.filePath!)), - config: configMap.get(sid) ?? null, - videos: videoMap.get(sid) ?? [], + config: config ? { ...config, data: configDataWithFilePath } : null, + videos: await Promise.all( + (videoMap.get(sid) ?? []).map(async (video) => ({ + ...video, + filePath: video.filePath ? await u.oss.getFileUrl(video.filePath) : null, + })), + ), }; }), ); diff --git a/src/routes/production/workbench/generateVideo.ts b/src/routes/production/workbench/generateVideo.ts index 9777435..2d32d32 100644 --- a/src/routes/production/workbench/generateVideo.ts +++ b/src/routes/production/workbench/generateVideo.ts @@ -22,7 +22,7 @@ export default router.post( ) .optional(), model: z.string(), - duration: z.string(), + duration: z.number(), resolution: z.string(), audio: z.boolean().optional(), mode: z.string(), diff --git a/src/types/database.d.ts b/src/types/database.d.ts index 775ad75..8b0cb2f 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -1,4 +1,4 @@ -// @db-hash 8af8e41e3ca0cb5ee554944515d72ba8 +// @db-hash 18bcc156a22196f0e296ee2b33700879 //该文件由脚本自动生成,请勿手动修改 export interface memories { @@ -35,18 +35,12 @@ export interface o_assets { 'projectId'?: number | null; 'prompt'?: string | null; 'remark'?: string | null; + 'scriptId'?: number | null; 'sonId'?: number | null; 'startTime'?: number | null; 'state'?: string | null; 'type'?: string | null; } -export interface o_chatHistory { - 'data'?: string | null; - 'id'?: number; - 'novel'?: string | null; - 'projectId'?: number | null; - 'type'?: string | null; -} export interface o_event { 'createTime'?: number | null; 'detail'?: string | null; @@ -67,33 +61,10 @@ export interface o_image { 'assetsId'?: number | null; 'filePath'?: string | null; 'id'?: number; - 'projectId'?: number | null; - 'scriptId'?: number | null; + 'model'?: string | null; + 'resolution'?: string | null; 'state'?: string | null; 'type'?: string | null; - 'videoId'?: number | null; -} -export interface o_model { - 'apiKey'?: string | null; - 'baseUrl'?: string | null; - 'createTime'?: number | null; - 'id'?: number; - 'index'?: number | null; - 'manufacturer'?: string | null; - 'model'?: string | null; - 'modelType'?: string | null; - 'type'?: string | null; -} -export interface o_myTasks { - 'describe'?: string | null; - 'id'?: number; - 'model'?: string | null; - 'projectId'?: number | null; - 'reason'?: string | null; - 'relatedObjects'?: string | null; - 'startTime'?: number | null; - 'state'?: string | null; - 'taskClass'?: string | null; } export interface o_novel { 'chapter'?: string | null; @@ -126,15 +97,6 @@ export interface o_project { 'userId'?: number | null; 'videoRatio'?: string | null; } -export interface o_prompts { - 'code'?: string | null; - 'customValue'?: string | null; - 'defaultValue'?: string | null; - 'id'?: number; - 'name'?: string | null; - 'parentCode'?: string | null; - 'type'?: string | null; -} export interface o_script { 'content'?: string | null; 'createTime'?: number | null; @@ -142,45 +104,27 @@ export interface o_script { 'name'?: string | null; 'projectId'?: number | null; } -export interface o_scriptAssets { - 'assetsId'?: number | null; - 'id'?: number; - 'scriptId'?: number | null; -} -export interface o_scriptOutline { - 'id'?: number; - 'outlineId'?: number | null; - 'scriptId'?: number | null; -} export interface o_setting { 'key'?: string | null; 'value'?: string | null; } -export interface o_skills { - 'id'?: number; - 'name'?: string | null; - 'startTime'?: number | null; -} export interface o_storyboard { 'createTime'?: number | null; - 'detail'?: string | null; + 'duration'?: string | null; 'filePath'?: string | null; - 'frameType'?: string | null; 'id'?: number; + 'mode'?: string | null; + 'model'?: string | null; 'name'?: string | null; 'prompt'?: string | null; - 'seconds'?: string | null; + 'resolution'?: string | null; + 'scriptId'?: number | null; } export interface o_storyboardFlow { 'flowData': string; 'id'?: number; 'stroryboardId': number; } -export interface o_storyboardScript { - 'id'?: number; - 'scriptId'?: number | null; - 'storyboardId'?: number | null; -} export interface o_tasks { 'describe'?: string | null; 'id'?: number; @@ -209,36 +153,27 @@ export interface o_vendorConfig { 'version'?: string | null; } export interface o_video { - 'configId'?: number | null; 'errorReason'?: string | null; 'filePath'?: string | null; - 'firstFrame'?: string | null; 'id'?: number; - 'model'?: string | null; - 'prompt'?: string | null; - 'resolution'?: string | null; 'scriptId'?: number | null; - 'state'?: number | null; - 'storyboardImgs'?: string | null; + 'state'?: string | null; + 'storyboardId'?: number | null; 'time'?: number | null; } export interface o_videoConfig { - 'aiConfigId'?: number | null; - 'audioEnabled'?: number | null; + 'audio'?: number | null; 'createTime'?: number | null; + 'data'?: string | null; 'duration'?: number | null; - 'endFrame'?: string | null; 'id'?: number; - 'images'?: string | null; - 'manufacturer'?: string | null; 'mode'?: string | null; - 'projectId'?: number | null; + 'model'?: string | null; 'prompt'?: string | null; 'resolution'?: string | null; - 'scriptId'?: number | null; - 'selectedResultId'?: number | null; - 'startFrame'?: string | null; + 'storyboardId'?: number | null; 'updateTime'?: number | null; + 'videoId'?: number | null; } export interface DB { @@ -246,26 +181,18 @@ export interface DB { "o_agentDeploy": o_agentDeploy; "o_artStyle": o_artStyle; "o_assets": o_assets; - "o_chatHistory": o_chatHistory; "o_event": o_event; "o_eventChapter": o_eventChapter; "o_flowData": o_flowData; "o_image": o_image; - "o_model": o_model; - "o_myTasks": o_myTasks; "o_novel": o_novel; "o_outline": o_outline; "o_outlineNovel": o_outlineNovel; "o_project": o_project; - "o_prompts": o_prompts; "o_script": o_script; - "o_scriptAssets": o_scriptAssets; - "o_scriptOutline": o_scriptOutline; "o_setting": o_setting; - "o_skills": o_skills; "o_storyboard": o_storyboard; "o_storyboardFlow": o_storyboardFlow; - "o_storyboardScript": o_storyboardScript; "o_tasks": o_tasks; "o_user": o_user; "o_vendorConfig": o_vendorConfig;