Merge branch 'develop' of https://github.com/HBAI-Ltd/Toonflow-app into develop

This commit is contained in:
ACT丶流星雨 2026-04-03 23:40:33 +08:00
commit a78a9a1b6a
24 changed files with 40 additions and 31 deletions

View File

@ -14,6 +14,7 @@ export default router.post(
const { id } = req.body;
const assetsData = await u.db("o_image").where("assetsId", id);
await Promise.all(assetsData.map((i) => i.filePath && u.oss.deleteFile(i.filePath)));
await u.db("o_image").where({ assetsId: id }).delete();
await u.db("o_assets").where({ id }).delete();
res.status(200).send(success({ message: "删除资产成功" }));
},

View File

@ -13,6 +13,9 @@ export default router.post(
async (req, res) => {
const { id } = req.body;
await u.db("o_video").where("id", id).delete();
await u.db("o_videoTrack").where("videoId", id).update({
videoId: null,
});
res.status(200).send(success({ message: "视频删除成功" }));
},
);

View File

@ -76,9 +76,7 @@ export default router.post(
const projectData = await u.db("o_project").select("*").where({ id: projectId }).first();
const videoPrompt = await u.db("o_prompt").where("type", "videoPromptGeneration").first();
const artStyle = projectData?.artStyle || "无";
const data = projectData?.directorManual || "无";
const visualManual = u.getArtPrompt(artStyle, "art_skills", "art_storyboard_video");
const directorManual = u.getArtPrompt(data, "story_skills", "narrative_sweet_romance");
const content = `
****${modelData},
****):${assets.map((i) => `[id:${i.id},type:${i.type},name:${i.name}]`).join("")},
@ -99,7 +97,7 @@ export default router.post(
messages: [
{
role: "assistant",
content: `${visualManual}\n${directorManual}`,
content: `${visualManual}`,
},
{
role: "user",

View File

@ -50,10 +50,10 @@ export default router.post(
{ value: "art_prop_derivative", subDir: "art_prompt" },
{ value: "art_scene", subDir: "art_prompt" },
{ value: "art_scene_derivative", subDir: "art_prompt" },
{ value: "art_storyboard", subDir: "art_prompt" },
{ value: "director_storyboard", subDir: "driector_skills" },
{ value: "art_storyboard_video", subDir: "art_prompt" },
{ value: "director_planning", subDir: "driector_skills" },
{ value: "director_storyboard_table", subDir: "driector_skills" },
{ value: "director_planning_style", subDir: "driector_skills" },
{ value: "director_storyboard_table_style", subDir: "driector_skills" },
];
// 根据 DATA_MAP 构建 value -> subDir 的映射

View File

@ -13,27 +13,35 @@ export default router.post(
}),
async (req, res) => {
const { id } = req.body;
const scriptData = await u.db("o_script").where("projectId", id).select("id");
const scriptIds = scriptData.map((item: any) => item.id);
//删除项目
await u.db("o_project").where("id", id).delete();
//删除项目下的原文
await u.db("o_novel").where("projectId", id).delete();
// 删除项目下的剧本信息
await u.db("o_script").where("projectId", id).delete();
await u.db("o_outline").where("projectId", id).delete();
// 删除项目下的任务
await u.db("o_tasks").where("projectId", id).delete();
// 删除项目下的分镜
await u.db("o_storyboard").where("projectId", id).delete();
// 删除项目下的资产
await u.db("o_assets").where("projectId", id).delete();
//删除需要删除资产的归属图片
const assetsData = await u.db("o_assets").where("projectId", id).select("id");
const assetsIds = assetsData.map((item: any) => item.id);
await u.db("o_project").where("id", id).delete();
await u.db("o_novel").where("projectId", id).delete();
await u.db("o_outline").where("projectId", id).delete();
await u.db("o_tasks").where("projectId", id).delete();
await u.db("o_script").where("projectId", id).delete();
await u.db("o_assets").where("projectId", id).delete();
if (assetsIds.length > 0) {
await u.db("o_image").where("projectId", id).orWhereIn("assetsId", assetsIds).delete();
await u.db("o_image").orWhereIn("assetsId", assetsIds).delete();
}
await u.db("o_video").whereIn("scriptId", scriptIds).delete();
//删除项目下的视频
const videoData = await u.db("o_video").where("projectId", id).select("id");
const videoIds = videoData.map((item: any) => item.id);
if (videoIds.length > 0) {
await u.db("o_videoTrack").whereIn("videoId", videoIds).update({
videoId: null,
});
}
await u.db("o_video").where("projectId", id).delete();
//删除项目下的资源
try {
await u.oss.deleteDirectory(`${id}/`);
console.log(`项目 ${id} 的OSS文件夹删除成功`);

View File

@ -51,10 +51,10 @@ export default router.post(
{ value: "art_prop_derivative", subDir: "art_prompt" },
{ value: "art_scene", subDir: "art_prompt" },
{ value: "art_scene_derivative", subDir: "art_prompt" },
{ value: "art_storyboard", subDir: "art_prompt" },
{ value: "director_storyboard", subDir: "driector_skills" },
{ value: "art_storyboard_video", subDir: "art_prompt" },
{ value: "director_planning", subDir: "driector_skills" },
{ value: "director_storyboard_table", subDir: "driector_skills" },
{ value: "director_planning_style", subDir: "driector_skills" },
{ value: "director_storyboard_table_style", subDir: "driector_skills" },
];
// 根据 DATA_MAP 构建 value -> subDir 的映射

View File

@ -15,10 +15,10 @@ const DATA_MAP: { label: string; value: string; subDir?: string }[] = [
{ label: "道具衍生", value: "art_prop_derivative", subDir: "art_prompt" },
{ label: "场景", value: "art_scene", subDir: "art_prompt" },
{ label: "场景衍生", value: "art_scene_derivative", subDir: "art_prompt" },
{ label: "分镜", value: "art_storyboard", subDir: "art_prompt" },
{ label: "分镜", value: "director_storyboard", subDir: "driector_skills" },
{ label: "分镜视频", value: "art_storyboard_video", subDir: "art_prompt" },
{ label: "技法-导演规划", value: "director_planning", subDir: "driector_skills" },
{ label: "技法-分镜表设计", value: "director_storyboard_table", subDir: "driector_skills" },
{ label: "技法-导演规划", value: "director_planning_style", subDir: "driector_skills" },
{ label: "技法-分镜表设计", value: "director_storyboard_table_style", subDir: "driector_skills" },
];
// 读取 md 文件内容,文件不存在时返回空字符串

View File

@ -8,6 +8,7 @@ export default router.post(
"/",
validateFields({
id: z.string(),
enable: z.number(),
}),
async (req, res) => {
const { id, enable } = req.body;

View File

@ -95,7 +95,6 @@ export default router.post(
inputValues: JSON.stringify(vendor.inputValues ?? {}),
models: JSON.stringify(vendor.models ?? []),
code: tsCode,
enable: 0,
createTime: Date.now(),
});
res.status(200).send(success(result.data));

View File

@ -67,7 +67,6 @@ export default router.post(
inputs: JSON.stringify(inputs),
inputValues: JSON.stringify(inputValues),
models: JSON.stringify(models),
enable: id == "toonflow" ? 1 : 0,
});
res.status(200).send(success("更新成功"));
},