# Conflicts:
#	src/lib/initDB.ts
#	src/types/database.d.ts
This commit is contained in:
小帅 2026-03-23 10:30:07 +08:00
commit 4e2553d32d
6 changed files with 13 additions and 18 deletions

View File

@ -315,6 +315,10 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
table.text("mode");
table.text("duration");
table.text("resolution");
table.text("frameType");
table.text("camera");
table.text("sound");
table.text("associateAssetsIds");
table.integer("createTime");
table.primary(["id"]);
table.unique(["id"]);

View File

@ -12,7 +12,6 @@ export default router.post(
}),
async (req, res) => {
const { id } = req.body;
console.log("%c Line:15 🥤 id", "background:#e41a6a", id);
const storyboardFlowData = await u.db("o_storyboardFlow").where("stroryboardId", id).first();
if (storyboardFlowData?.flowData) {
const parseFlow = JSON.parse(storyboardFlowData.flowData);

View File

@ -27,6 +27,7 @@ export default router.post(
});
const [id] = await u.db("o_storyboard").insert({
filePath: new URL(imageUrl).pathname,
createTime: Date.now(),
});
await u.db("o_storyboardFlow").insert({
stroryboardId: id,

View File

@ -13,20 +13,7 @@ export default router.post(
const { scriptId } = req.body;
// 1. 查出该剧本下所有分镜
const storyboards = await u
.db("o_storyboard")
.where("o_storyboard.scriptId", scriptId)
.select(
"o_storyboard.id",
"o_storyboard.name",
"o_storyboard.detail",
"o_storyboard.prompt",
"o_storyboard.seconds",
"o_storyboard.filePath",
"o_storyboard.frameType",
"o_storyboard.scriptId",
)
.orderBy("o_storyboard.createTime", "asc");
const storyboards = await u.db("o_storyboard").where("o_storyboard.scriptId", scriptId).select("*").orderBy("o_storyboard.createTime", "asc");
if (storyboards.length === 0) {
return res.status(200).send(success([]));

View File

@ -13,12 +13,12 @@ export default router.post(
async (req, res) => {
const { projectId } = req.body;
const storyboardData = await u.db("o_storyboard");
console.log("%c Line:16 🍖 storyboardData", "background:#ed9ec7", storyboardData);
const data = await Promise.all(
storyboardData.map(async (i) => {
return {
...i,
image: i.filePath ? await u.oss.getFileUrl(i.filePath!) : "",
title: i.name,
src: i.filePath ? await u.oss.getFileUrl(i.filePath!) : "",
};
}),
);

View File

@ -1,4 +1,4 @@
// @db-hash 18bcc156a22196f0e296ee2b33700879
// @db-hash bea1bd617996a9e12ad951edcce03880
//该文件由脚本自动生成,请勿手动修改
export interface memories {
@ -109,9 +109,12 @@ export interface o_setting {
'value'?: string | null;
}
export interface o_storyboard {
'associateAssetsIds'?: string | null;
'camera'?: string | null;
'createTime'?: number | null;
'duration'?: string | null;
'filePath'?: string | null;
'frameType'?: string | null;
'id'?: number;
'mode'?: string | null;
'model'?: string | null;
@ -119,6 +122,7 @@ export interface o_storyboard {
'prompt'?: string | null;
'resolution'?: string | null;
'scriptId'?: number | null;
'sound'?: string | null;
}
export interface o_storyboardFlow {
'flowData': string;