Merge branch '108' of https://github.com/HBAI-Ltd/Toonflow-app into 108
# Conflicts: # src/router.ts # src/types/database.d.ts
This commit is contained in:
commit
d5430d257c
@ -33,6 +33,12 @@ export const storyboardSchema = z.object({
|
|||||||
prompt: z.string().describe("生成提示词"),
|
prompt: z.string().describe("生成提示词"),
|
||||||
lines: z.string().nullable().describe("台词内容"),
|
lines: z.string().nullable().describe("台词内容"),
|
||||||
sound: z.string().nullable().describe("音效内容"),
|
sound: z.string().nullable().describe("音效内容"),
|
||||||
|
mode: z
|
||||||
|
.union([
|
||||||
|
z.enum(["singleImage", "multiImage", "gridImage", "startEndRequired", "endFrameOptional", "startFrameOptional", "text"]),
|
||||||
|
z.array(z.enum(["video", "image", "audio", "text"])),
|
||||||
|
])
|
||||||
|
.describe("视频模式"),
|
||||||
associateAssetsIds: z.array(z.number()).describe("关联资产ID列表"),
|
associateAssetsIds: z.array(z.number()).describe("关联资产ID列表"),
|
||||||
src: z.string().nullable().describe("分镜资源路径"),
|
src: z.string().nullable().describe("分镜资源路径"),
|
||||||
});
|
});
|
||||||
|
|||||||
@ -88,7 +88,6 @@ export default router.post(
|
|||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
const storyboardData = await u.db("o_storyboard").where("scriptId", episodesId);
|
const storyboardData = await u.db("o_storyboard").where("scriptId", episodesId);
|
||||||
console.log("%c Line:90 🍡 storyboardData", "background:#ed9ec7", storyboardData.length);
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
storyboardData.map(async (i) => {
|
storyboardData.map(async (i) => {
|
||||||
if (i.filePath) {
|
if (i.filePath) {
|
||||||
@ -165,6 +164,7 @@ export default router.post(
|
|||||||
const buildStoryboardItem = (i: (typeof storyboardData)[number], existing: any = {}) => ({
|
const buildStoryboardItem = (i: (typeof storyboardData)[number], existing: any = {}) => ({
|
||||||
...existing,
|
...existing,
|
||||||
id: i.id,
|
id: i.id,
|
||||||
|
index: i.index,
|
||||||
title: i.title,
|
title: i.title,
|
||||||
description: i.description,
|
description: i.description,
|
||||||
camera: i.camera,
|
camera: i.camera,
|
||||||
@ -199,8 +199,7 @@ export default router.post(
|
|||||||
orderedStoryboard.push(buildStoryboardItem(i));
|
orderedStoryboard.push(buildStoryboardItem(i));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
flowData.storyboard = orderedStoryboard.sort((a, b) => (a.index ?? 0) - (b.index ?? 0));
|
||||||
flowData.storyboard = orderedStoryboard;
|
|
||||||
res.status(200).send(success(flowData));
|
res.status(200).send(success(flowData));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
res.status(400).send(error());
|
res.status(400).send(error());
|
||||||
|
|||||||
@ -13,7 +13,7 @@ export default router.post(
|
|||||||
const { scriptId } = req.body;
|
const { scriptId } = req.body;
|
||||||
|
|
||||||
//查询分镜数据
|
//查询分镜数据
|
||||||
const storyboards = await u.db("o_storyboard").where("o_storyboard.scriptId", scriptId).select("*").orderBy("o_storyboard.createTime", "asc");
|
const storyboards = await u.db("o_storyboard").where("o_storyboard.scriptId", scriptId).select("*").orderBy("index", "asc");
|
||||||
|
|
||||||
const storyboardsList = await Promise.all(
|
const storyboardsList = await Promise.all(
|
||||||
storyboards.map(async (item) => {
|
storyboards.map(async (item) => {
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export default router.post(
|
|||||||
}),
|
}),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
const { scriptId } = req.body;
|
const { scriptId } = req.body;
|
||||||
const storyboardData = await u.db("o_storyboard").where({ scriptId });
|
const storyboardData = await u.db("o_storyboard").where({ scriptId }).orderBy("index", "asc");
|
||||||
const data = await Promise.all(
|
const data = await Promise.all(
|
||||||
storyboardData.map(async (i) => {
|
storyboardData.map(async (i) => {
|
||||||
return {
|
return {
|
||||||
@ -83,7 +83,6 @@ export default router.post(
|
|||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
res.status(200).send(success(result));
|
res.status(200).send(success(result));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user