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

This commit is contained in:
ACT丶流星雨 2026-04-04 01:04:11 +08:00
commit d2271954b8

View File

@ -15,31 +15,43 @@ export default router.post(
const { id } = req.body;
//删除项目
await u.db("o_project").where("id", id).delete();
await u.db("o_agentWorkData").where("projectId", id).delete();
const novelData = await u.db("o_novel").where("projectId", id).select("id");
const novelId = novelData.map((item: any) => item.id);
if (novelId.length > 0) {
await u.db("o_outlineNovel").whereIn("novelId", novelId).delete();
}
//删除项目下的原文
await u.db("o_novel").where("projectId", id).delete();
// 删除项目下的剧本信息
const scriptData = await u.db("o_script").where("projectId", id).select("id");
const scriptIds = scriptData.map((item: any) => item.id);
if (scriptIds.length > 0) {
await u.db("o_scriptAssets").whereIn("scriptId", scriptIds).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();
// 删除项目下的分镜
const storyboardData = await u.db("o_storyboard").where("projectId", id).select("id");
const storyboardIds = storyboardData.map((item: any) => item.id);
if (storyboardIds.length > 0) {
await u.db("o_assets2Storyboard").whereIn("storyboardId", storyboardIds).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);
if (assetsIds.length > 0) {
await u.db("o_image").orWhereIn("assetsId", assetsIds).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,
});
// 先将 o_assets.imageId 置空,解除对 o_image 的外键引用
await u.db("o_assets").whereIn("id", assetsIds).update({ imageId: null });
await u.db("o_image").whereIn("assetsId", assetsIds).delete();
}
// 删除项目下的资产
await u.db("o_assets").where("projectId", id).delete();
//删除项目下的视频轨道和视频
await u.db("o_videoTrack").where("projectId", id).delete();
await u.db("o_video").where("projectId", id).delete();
//删除项目下的资源
try {