Merge branch '108' of https://github.com/HBAI-Ltd/Toonflow-app into 108
# Conflicts: # src/lib/initDB.ts # src/types/database.d.ts
This commit is contained in:
commit
4e2553d32d
@ -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"]);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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([]));
|
||||
|
||||
@ -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!) : "",
|
||||
};
|
||||
}),
|
||||
);
|
||||
|
||||
6
src/types/database.d.ts
vendored
6
src/types/database.d.ts
vendored
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user