diff --git a/src/routes/assets/getMaterialData.ts b/src/routes/assets/getMaterialData.ts new file mode 100644 index 0000000..119bb3e --- /dev/null +++ b/src/routes/assets/getMaterialData.ts @@ -0,0 +1,16 @@ +import express from "express"; +import u from "@/utils"; +import { success } from "@/lib/responseFormat"; +const router = express.Router(); + +// 获取生成图片 +export default router.post("/", async (req, res) => { + const list = await u.db("o_assets").leftJoin("o_image", "o_assets.id", "=", "o_image.assetsId").where("o_assets.type", "clip").select("*"); + const data = await Promise.all( + list.map(async (item) => ({ + ...item, + filePath: item.filePath ? await u.oss.getFileUrl(item.filePath) : "", + })), + ); + res.status(200).send(success(data)); +}); diff --git a/src/routes/production/workbench/generateVideo.ts b/src/routes/production/workbench/generateVideo.ts index 576b32d..50c377c 100644 --- a/src/routes/production/workbench/generateVideo.ts +++ b/src/routes/production/workbench/generateVideo.ts @@ -104,9 +104,7 @@ export default router.post( const aiVideo = u.Ai.Video(model); await aiVideo.run({ - systemPrompt, projectId, - storyboardId, prompt, imageBase64: base64.filter((item) => item !== null) as string[], mode, diff --git a/src/utils/ai.ts b/src/utils/ai.ts index 7a94a8e..bccc1cb 100644 --- a/src/utils/ai.ts +++ b/src/utils/ai.ts @@ -116,8 +116,6 @@ class AiImage { } interface VideoConfig { projectId: number; // 项目ID - storyboardId: number; // 关联的分镜ID - systemPrompt?: string; // 系统提示词 prompt: string; //视频提示词 imageBase64: string[]; //输入的图片提示词 mode: string; //模式