mirror of
https://github.com/HBAI-Ltd/Toonflow-app.git
synced 2026-06-07 23:45:24 +08:00
添加错误返回,项目表添加自增id
This commit is contained in:
@@ -43,6 +43,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
|
||||
table.integer("createTime");
|
||||
table.integer("userId");
|
||||
table.primary(["id"]);
|
||||
table.unique(["id"]);
|
||||
},
|
||||
},
|
||||
//风格表
|
||||
|
||||
@@ -92,22 +92,26 @@ export default router.post(
|
||||
)},
|
||||
`;
|
||||
|
||||
const { text } = await u.Ai.Text("universalAi").invoke({
|
||||
system: videoPrompt?.data!,
|
||||
messages: [
|
||||
{
|
||||
role: "assistant",
|
||||
content: `${visualManual}`,
|
||||
},
|
||||
{
|
||||
role: "user",
|
||||
content: content,
|
||||
},
|
||||
],
|
||||
});
|
||||
await u.db("o_videoTrack").where({ id: trackId }).update({
|
||||
prompt: text,
|
||||
});
|
||||
res.status(200).send(success(text));
|
||||
try {
|
||||
const { text } = await u.Ai.Text("universalAi").invoke({
|
||||
system: videoPrompt?.data!,
|
||||
messages: [
|
||||
{
|
||||
role: "assistant",
|
||||
content: `${visualManual}`,
|
||||
},
|
||||
{
|
||||
role: "user",
|
||||
content: content,
|
||||
},
|
||||
],
|
||||
});
|
||||
await u.db("o_videoTrack").where({ id: trackId }).update({
|
||||
prompt: text,
|
||||
});
|
||||
res.status(200).send(success(text));
|
||||
} catch (error) {
|
||||
res.status(500).send(error);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
19
src/types/database.d.ts
vendored
19
src/types/database.d.ts
vendored
@@ -1,6 +1,22 @@
|
||||
// @db-hash 6fa5017e455bc367c9c902ba574d11b4
|
||||
// @db-hash 19c726e36479d905346c772cfa8007ba
|
||||
//该文件由脚本自动生成,请勿手动修改
|
||||
|
||||
export interface _o_project_old_20260404 {
|
||||
'artStyle'?: string | null;
|
||||
'createTime'?: number | null;
|
||||
'directorManual'?: string | null;
|
||||
'id'?: number | null;
|
||||
'imageModel'?: string | null;
|
||||
'imageQuality'?: string | null;
|
||||
'intro'?: string | null;
|
||||
'mode'?: string | null;
|
||||
'name'?: string | null;
|
||||
'projectType'?: string | null;
|
||||
'type'?: string | null;
|
||||
'userId'?: number | null;
|
||||
'videoModel'?: string | null;
|
||||
'videoRatio'?: string | null;
|
||||
}
|
||||
export interface memories {
|
||||
'content': string;
|
||||
'createTime': number;
|
||||
@@ -231,6 +247,7 @@ export interface o_videoTrack {
|
||||
}
|
||||
|
||||
export interface DB {
|
||||
"_o_project_old_20260404": _o_project_old_20260404;
|
||||
"memories": memories;
|
||||
"o_agentDeploy": o_agentDeploy;
|
||||
"o_agentWorkData": o_agentWorkData;
|
||||
|
||||
Reference in New Issue
Block a user