diff --git a/src/lib/initDB.ts b/src/lib/initDB.ts index 8a26b3e..1ccac22 100644 --- a/src/lib/initDB.ts +++ b/src/lib/initDB.ts @@ -315,6 +315,10 @@ export default async (knex: Knex, forceInit: boolean = false): Promise => table.text("mode"); table.text("duration"); table.text("resolution"); + 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/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/getProductionData.ts b/src/routes/production/getProductionData.ts index dded0bf..3fa1f0d 100644 --- a/src/routes/production/getProductionData.ts +++ b/src/routes/production/getProductionData.ts @@ -13,20 +13,7 @@ export default router.post( const { scriptId } = req.body; // 1. 查出该剧本下所有分镜 - const storyboards = await u - .db("o_storyboard") - .where("o_storyboard.scriptId", scriptId) - .select( - "o_storyboard.id", - "o_storyboard.name", - "o_storyboard.detail", - "o_storyboard.prompt", - "o_storyboard.seconds", - "o_storyboard.filePath", - "o_storyboard.frameType", - "o_storyboard.scriptId", - ) - .orderBy("o_storyboard.createTime", "asc"); + const storyboards = await u.db("o_storyboard").where("o_storyboard.scriptId", scriptId).select("*").orderBy("o_storyboard.createTime", "asc"); if (storyboards.length === 0) { return res.status(200).send(success([])); diff --git a/src/routes/production/getStoryboardData.ts b/src/routes/production/getStoryboardData.ts index 4d5dc5d..bd72762 100644 --- a/src/routes/production/getStoryboardData.ts +++ b/src/routes/production/getStoryboardData.ts @@ -13,12 +13,12 @@ export default router.post( async (req, res) => { const { projectId } = req.body; const storyboardData = await u.db("o_storyboard"); - console.log("%c Line:16 🍖 storyboardData", "background:#ed9ec7", storyboardData); const data = await Promise.all( 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!) : "", }; }), ); diff --git a/src/types/database.d.ts b/src/types/database.d.ts index 8b0cb2f..069be36 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -1,4 +1,4 @@ -// @db-hash 18bcc156a22196f0e296ee2b33700879 +// @db-hash bea1bd617996a9e12ad951edcce03880 //该文件由脚本自动生成,请勿手动修改 export interface memories { @@ -109,9 +109,12 @@ export interface o_setting { 'value'?: string | null; } export interface o_storyboard { + 'associateAssetsIds'?: string | null; + 'camera'?: string | null; 'createTime'?: number | null; 'duration'?: string | null; 'filePath'?: string | null; + 'frameType'?: string | null; 'id'?: number; 'mode'?: string | null; 'model'?: string | null; @@ -119,6 +122,7 @@ export interface o_storyboard { 'prompt'?: string | null; 'resolution'?: string | null; 'scriptId'?: number | null; + 'sound'?: string | null; } export interface o_storyboardFlow { 'flowData': string;