修复bug
This commit is contained in:
parent
db8208d5b2
commit
1de3357155
@ -27,7 +27,7 @@ export default router.post(
|
|||||||
.db("o_assets")
|
.db("o_assets")
|
||||||
.leftJoin("o_image", "o_assets.imageId", "o_image.id")
|
.leftJoin("o_image", "o_assets.imageId", "o_image.id")
|
||||||
.whereIn("o_assets.id", parentIds as number[])
|
.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(
|
const assetsSrcArr = await Promise.all(
|
||||||
parentAssetsData.map(async (item) => {
|
parentAssetsData.map(async (item) => {
|
||||||
return {
|
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<number, string> = {};
|
const imageUrlRecord: Record<number, string> = {};
|
||||||
assetsSrcArr.forEach((item) => {
|
assetsSrcArr.forEach((item) => {
|
||||||
imageUrlRecord[item.id] = item.src;
|
imageUrlRecord[item.id] = item.src;
|
||||||
@ -70,7 +76,7 @@ export default router.post(
|
|||||||
|
|
||||||
const imageData: { id: number; state: string; src: string }[] = [];
|
const imageData: { id: number; state: string; src: string }[] = [];
|
||||||
res.status(200).send(success("开始生成资产图片"));
|
res.status(200).send(success("开始生成资产图片"));
|
||||||
const generateSingleAsset = async (item: (typeof assetsDataArr)[number]) => {
|
const generateSingleAsset = async (item: any) => {
|
||||||
const imageId = imageIdMap[item.id!];
|
const imageId = imageIdMap[item.id!];
|
||||||
const typeConfig = promptRecord[item.type!] || promptRecord["role"];
|
const typeConfig = promptRecord[item.type!] || promptRecord["role"];
|
||||||
|
|
||||||
@ -79,7 +85,9 @@ export default router.post(
|
|||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
role: "user",
|
role: "user",
|
||||||
content: `资产描述: ${item.describe || "无详细描述"}`,
|
content: `
|
||||||
|
父级资产描述: ${item.parentDescribe || "无详细描述"}
|
||||||
|
当前资产描述: ${item.describe || "无详细描述"}`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|||||||
20
src/types/database.d.ts
vendored
20
src/types/database.d.ts
vendored
@ -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 {
|
export interface _o_storyboard_old_20260402 {
|
||||||
'createTime'?: number | null;
|
'createTime'?: number | null;
|
||||||
'duration'?: string | null;
|
'duration'?: string | null;
|
||||||
@ -180,7 +165,6 @@ export interface o_outlineNovel {
|
|||||||
export interface o_project {
|
export interface o_project {
|
||||||
'artStyle'?: string | null;
|
'artStyle'?: string | null;
|
||||||
'createTime'?: number | null;
|
'createTime'?: number | null;
|
||||||
'directorManual'?: string | null;
|
|
||||||
'id'?: number | null;
|
'id'?: number | null;
|
||||||
'imageModel'?: string | null;
|
'imageModel'?: string | null;
|
||||||
'imageQuality'?: string | null;
|
'imageQuality'?: string | null;
|
||||||
@ -271,7 +255,6 @@ export interface o_vendorConfig {
|
|||||||
'createTime'?: number | null;
|
'createTime'?: number | null;
|
||||||
'description'?: string | null;
|
'description'?: string | null;
|
||||||
'enable'?: number | null;
|
'enable'?: number | null;
|
||||||
'enableEnglish'?: number | null;
|
|
||||||
'icon'?: string | null;
|
'icon'?: string | null;
|
||||||
'id'?: string;
|
'id'?: string;
|
||||||
'inputs'?: string | null;
|
'inputs'?: string | null;
|
||||||
@ -301,7 +284,6 @@ export interface o_videoTrack {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface DB {
|
export interface DB {
|
||||||
"_o_project_old_20260402": _o_project_old_20260402;
|
|
||||||
"_o_storyboard_old_20260402": _o_storyboard_old_20260402;
|
"_o_storyboard_old_20260402": _o_storyboard_old_20260402;
|
||||||
"_o_storyboard_old_20260402_1": _o_storyboard_old_20260402_1;
|
"_o_storyboard_old_20260402_1": _o_storyboard_old_20260402_1;
|
||||||
"_o_vendorConfig_old_20260401": _o_vendorConfig_old_20260401;
|
"_o_vendorConfig_old_20260401": _o_vendorConfig_old_20260401;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user