From 1de33571551a5f90f3a12d8b6f156a3bcb556be6 Mon Sep 17 00:00:00 2001 From: zhishi <1951671751@qq.com> Date: Fri, 3 Apr 2026 04:39:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/batchGenerateAssetsImage.ts | 14 ++++++++++--- src/types/database.d.ts | 20 +------------------ 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/src/routes/production/assets/batchGenerateAssetsImage.ts b/src/routes/production/assets/batchGenerateAssetsImage.ts index 40b13da..d7ec5d8 100644 --- a/src/routes/production/assets/batchGenerateAssetsImage.ts +++ b/src/routes/production/assets/batchGenerateAssetsImage.ts @@ -27,7 +27,7 @@ export default router.post( .db("o_assets") .leftJoin("o_image", "o_assets.imageId", "o_image.id") .whereIn("o_assets.id", parentIds as number[]) - .select("o_assets.id", "o_image.filePath"); + .select("o_assets.id", "o_image.filePath", "o_assets.describe"); const assetsSrcArr = await Promise.all( parentAssetsData.map(async (item) => { return { @@ -36,6 +36,12 @@ export default router.post( }; }), ); + assetsDataArr.forEach((i: any) => { + const parent = parentAssetsData.find((item) => item.id === i.assetsId); + if (parent) { + i.parentDescribe = parent.describe; + } + }); const imageUrlRecord: Record = {}; assetsSrcArr.forEach((item) => { imageUrlRecord[item.id] = item.src; @@ -70,7 +76,7 @@ export default router.post( const imageData: { id: number; state: string; src: string }[] = []; res.status(200).send(success("开始生成资产图片")); - const generateSingleAsset = async (item: (typeof assetsDataArr)[number]) => { + const generateSingleAsset = async (item: any) => { const imageId = imageIdMap[item.id!]; const typeConfig = promptRecord[item.type!] || promptRecord["role"]; @@ -79,7 +85,9 @@ export default router.post( messages: [ { role: "user", - content: `资产描述: ${item.describe || "无详细描述"}`, + content: ` + 父级资产描述: ${item.parentDescribe || "无详细描述"} + 当前资产描述: ${item.describe || "无详细描述"}`, }, ], }); diff --git a/src/types/database.d.ts b/src/types/database.d.ts index 62a13d9..9cb1328 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -1,21 +1,6 @@ -// @db-hash 35cf00f711e9d4df398703de70511684 +// @db-hash e799af0c29da30dc4dbb46649b32bcaa //该文件由脚本自动生成,请勿手动修改 -export interface _o_project_old_20260402 { - 'artStyle'?: string | null; - 'createTime'?: number | null; - 'id'?: number | null; - 'imageModel'?: string | null; - 'imageQuality'?: string | null; - 'intro'?: string | null; - 'mode'?: string | null; - 'name'?: string | null; - 'projectType'?: string | null; - 'type'?: string | null; - 'userId'?: number | null; - 'videoModel'?: string | null; - 'videoRatio'?: string | null; -} export interface _o_storyboard_old_20260402 { 'createTime'?: number | null; 'duration'?: string | null; @@ -180,7 +165,6 @@ export interface o_outlineNovel { export interface o_project { 'artStyle'?: string | null; 'createTime'?: number | null; - 'directorManual'?: string | null; 'id'?: number | null; 'imageModel'?: string | null; 'imageQuality'?: string | null; @@ -271,7 +255,6 @@ export interface o_vendorConfig { 'createTime'?: number | null; 'description'?: string | null; 'enable'?: number | null; - 'enableEnglish'?: number | null; 'icon'?: string | null; 'id'?: string; 'inputs'?: string | null; @@ -301,7 +284,6 @@ export interface o_videoTrack { } export interface DB { - "_o_project_old_20260402": _o_project_old_20260402; "_o_storyboard_old_20260402": _o_storyboard_old_20260402; "_o_storyboard_old_20260402_1": _o_storyboard_old_20260402_1; "_o_vendorConfig_old_20260401": _o_vendorConfig_old_20260401;