no message
This commit is contained in:
parent
8b5a8ff9c2
commit
d7a220a8e4
@ -13,7 +13,15 @@ export default router.post(
|
|||||||
}),
|
}),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
const { edges, nodes } = req.body;
|
const { edges, nodes } = req.body;
|
||||||
|
nodes.forEach((node: any) => {
|
||||||
|
if (node.type == "upload") {
|
||||||
|
node.data.image = node.data.image ? u.replaceUrl(node.data.image) : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (node.type == "generated") {
|
||||||
|
node.data.generatedImage = node.data.generatedImage ? u.replaceUrl(node.data.generatedImage) : "";
|
||||||
|
}
|
||||||
|
});
|
||||||
const [insertFlowId] = await u.db("o_imageFlow").insert({
|
const [insertFlowId] = await u.db("o_imageFlow").insert({
|
||||||
flowData: JSON.stringify({ edges, nodes }),
|
flowData: JSON.stringify({ edges, nodes }),
|
||||||
});
|
});
|
||||||
|
|||||||
@ -10,10 +10,7 @@ export default router.post(
|
|||||||
validateFields({
|
validateFields({
|
||||||
edges: z.any(),
|
edges: z.any(),
|
||||||
nodes: z.any(),
|
nodes: z.any(),
|
||||||
id: z.number(),
|
|
||||||
imageUrl: z.string(),
|
|
||||||
flowId: z.number(),
|
flowId: z.number(),
|
||||||
episodesId: z.number(),
|
|
||||||
}),
|
}),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
const { edges, nodes, flowId } = req.body;
|
const { edges, nodes, flowId } = req.body;
|
||||||
@ -26,24 +23,6 @@ export default router.post(
|
|||||||
node.data.generatedImage = node.data.generatedImage ? u.replaceUrl(node.data.generatedImage) : "";
|
node.data.generatedImage = node.data.generatedImage ? u.replaceUrl(node.data.generatedImage) : "";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// let imagePath = "";
|
|
||||||
// try {
|
|
||||||
// imagePath = new URL(imageUrl).pathname;
|
|
||||||
// } catch (e) {}
|
|
||||||
// if (imagePath) {
|
|
||||||
// if (type == "storyboard") {
|
|
||||||
// await u.db("o_storyboard").where("id", id).update({
|
|
||||||
// filePath: imagePath,
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// const [imageId] = await u.db("o_image").insert({
|
|
||||||
// filePath: imagePath,
|
|
||||||
// assetsId: id,
|
|
||||||
// state: "已完成",
|
|
||||||
// });
|
|
||||||
// await u.db("o_assets").where("id", id).update({ imageId });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
await u
|
await u
|
||||||
.db("o_imageFlow")
|
.db("o_imageFlow")
|
||||||
|
|||||||
@ -116,6 +116,7 @@ export default router.post(
|
|||||||
prompt: item.prompt ?? "",
|
prompt: item.prompt ?? "",
|
||||||
desc: item.describe ?? "",
|
desc: item.describe ?? "",
|
||||||
src: item.filePath && (await u.oss.getFileUrl(item.filePath!)),
|
src: item.filePath && (await u.oss.getFileUrl(item.filePath!)),
|
||||||
|
flowId: item.flowId,
|
||||||
derive: await Promise.all(
|
derive: await Promise.all(
|
||||||
childAssetsData
|
childAssetsData
|
||||||
.filter((child) => child.assetsId === item.id)
|
.filter((child) => child.assetsId === item.id)
|
||||||
@ -129,6 +130,7 @@ export default router.post(
|
|||||||
src: child.filePath && (await u.oss.getFileUrl(child.filePath!)),
|
src: child.filePath && (await u.oss.getFileUrl(child.filePath!)),
|
||||||
state: child.state ?? "未生成",
|
state: child.state ?? "未生成",
|
||||||
errorReason: child?.errorReason ?? "",
|
errorReason: child?.errorReason ?? "",
|
||||||
|
flowId: child.flowId,
|
||||||
})),
|
})),
|
||||||
),
|
),
|
||||||
})),
|
})),
|
||||||
@ -145,6 +147,7 @@ export default router.post(
|
|||||||
videoDesc: i.videoDesc,
|
videoDesc: i.videoDesc,
|
||||||
shouldGenerateImage: i.shouldGenerateImage,
|
shouldGenerateImage: i.shouldGenerateImage,
|
||||||
reason: i?.reason ?? "",
|
reason: i?.reason ?? "",
|
||||||
|
flowId: i.flowId,
|
||||||
}))
|
}))
|
||||||
.sort((a, b) => (a.index ?? 0) - (b.index ?? 0));
|
.sort((a, b) => (a.index ?? 0) - (b.index ?? 0));
|
||||||
res.status(200).send(success(flowData));
|
res.status(200).send(success(flowData));
|
||||||
|
|||||||
67
src/types/database.d.ts
vendored
67
src/types/database.d.ts
vendored
@ -1,10 +1,60 @@
|
|||||||
<<<<<<< HEAD
|
// @db-hash 7af86e2bafe5cab7d175eb68cf76ed7a
|
||||||
// @db-hash 6fa5017e455bc367c9c902ba574d11b4
|
|
||||||
=======
|
|
||||||
// @db-hash 35cf00f711e9d4df398703de70511684
|
|
||||||
>>>>>>> c7be353ef92bb888df3af432bb21220b2fd35d7d
|
|
||||||
//该文件由脚本自动生成,请勿手动修改
|
//该文件由脚本自动生成,请勿手动修改
|
||||||
|
|
||||||
|
export interface _o_storyboard_old_20260402 {
|
||||||
|
'createTime'?: number | null;
|
||||||
|
'duration'?: string | null;
|
||||||
|
'filePath'?: string | null;
|
||||||
|
'flowId'?: number | null;
|
||||||
|
'id'?: number;
|
||||||
|
'index'?: number | null;
|
||||||
|
'projectId'?: number | null;
|
||||||
|
'prompt'?: string | null;
|
||||||
|
'reason'?: string | null;
|
||||||
|
'scriptId'?: number | null;
|
||||||
|
'state'?: string | null;
|
||||||
|
'trackId'?: number | null;
|
||||||
|
}
|
||||||
|
export interface _o_storyboard_old_20260402_1 {
|
||||||
|
'createTime'?: number | null;
|
||||||
|
'duration'?: string | null;
|
||||||
|
'filePath'?: string | null;
|
||||||
|
'flowId'?: number | null;
|
||||||
|
'id'?: number;
|
||||||
|
'index'?: number | null;
|
||||||
|
'projectId'?: number | null;
|
||||||
|
'prompt'?: string | null;
|
||||||
|
'reason'?: string | null;
|
||||||
|
'scriptId'?: number | null;
|
||||||
|
'shouldGenerateImage'?: number | null;
|
||||||
|
'state'?: string | null;
|
||||||
|
'track'?: string | null;
|
||||||
|
'trackId'?: number | null;
|
||||||
|
'videoPrompt'?: string | null;
|
||||||
|
}
|
||||||
|
export interface _o_vendorConfig_old_20260401 {
|
||||||
|
'author'?: string | null;
|
||||||
|
'code'?: string | null;
|
||||||
|
'createTime'?: number | null;
|
||||||
|
'description'?: string | null;
|
||||||
|
'enableEnglish'?: number | null;
|
||||||
|
'icon'?: string | null;
|
||||||
|
'id'?: string;
|
||||||
|
'inputs'?: string | null;
|
||||||
|
'inputValues'?: string | null;
|
||||||
|
'models'?: string | null;
|
||||||
|
'name'?: string | null;
|
||||||
|
}
|
||||||
|
export interface _o_videoTrack_old_20260402 {
|
||||||
|
'id'?: number;
|
||||||
|
'projectId'?: number | null;
|
||||||
|
'prompt'?: string | null;
|
||||||
|
'reason'?: string | null;
|
||||||
|
'scriptId'?: number | null;
|
||||||
|
'selectVideoId'?: number | null;
|
||||||
|
'state'?: string | null;
|
||||||
|
'videoId'?: number | null;
|
||||||
|
}
|
||||||
export interface memories {
|
export interface memories {
|
||||||
'content': string;
|
'content': string;
|
||||||
'createTime': number;
|
'createTime': number;
|
||||||
@ -80,6 +130,7 @@ export interface o_image {
|
|||||||
'filePath'?: string | null;
|
'filePath'?: string | null;
|
||||||
'id'?: number;
|
'id'?: number;
|
||||||
'model'?: string | null;
|
'model'?: string | null;
|
||||||
|
'reason'?: string | null;
|
||||||
'resolution'?: string | null;
|
'resolution'?: string | null;
|
||||||
'state'?: string | null;
|
'state'?: string | null;
|
||||||
'type'?: string | null;
|
'type'?: string | null;
|
||||||
@ -114,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;
|
||||||
@ -205,6 +255,7 @@ 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;
|
||||||
@ -234,6 +285,10 @@ export interface o_videoTrack {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface DB {
|
export interface DB {
|
||||||
|
"_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;
|
||||||
|
"_o_videoTrack_old_20260402": _o_videoTrack_old_20260402;
|
||||||
"memories": memories;
|
"memories": memories;
|
||||||
"o_agentDeploy": o_agentDeploy;
|
"o_agentDeploy": o_agentDeploy;
|
||||||
"o_agentWorkData": o_agentWorkData;
|
"o_agentWorkData": o_agentWorkData;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user