diff --git a/src/lib/initDB.ts b/src/lib/initDB.ts index f99bc23..d4c10b8 100644 --- a/src/lib/initDB.ts +++ b/src/lib/initDB.ts @@ -37,6 +37,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise => table.text("intro"); table.text("type"); table.text("artStyle"); + table.text("mode"); table.text("videoRatio"); table.integer("createTime"); table.integer("userId"); diff --git a/src/routes/project/addProject.ts b/src/routes/project/addProject.ts index fefeb69..c1a8748 100644 --- a/src/routes/project/addProject.ts +++ b/src/routes/project/addProject.ts @@ -17,11 +17,11 @@ export default router.post( videoRatio: z.string(), imageModel: z.string(), videoModel: z.string(), - imageQuality: z.string() - + imageQuality: z.string(), + mode: z.string(), }), async (req, res) => { - const { projectType, name, intro, type, artStyle, videoRatio, imageModel, videoModel,imageQuality } = req.body; + const { projectType, name, intro, type, artStyle, videoRatio, imageModel, videoModel, imageQuality, mode } = req.body; await u.db("o_project").insert({ projectType, @@ -34,7 +34,8 @@ export default router.post( imageModel, videoModel, createTime: Date.now(), - imageQuality + imageQuality, + mode, }); res.status(200).send(success({ message: "新增项目成功" })); diff --git a/src/routes/project/editProject.ts b/src/routes/project/editProject.ts index 52f8d84..e1ec46e 100644 --- a/src/routes/project/editProject.ts +++ b/src/routes/project/editProject.ts @@ -18,10 +18,11 @@ export default router.post( imageModel: z.string(), videoModel: z.string(), projectType: z.string(), - imageQuality: z.string() + imageQuality: z.string(), + mode: z.string(), }), async (req, res) => { - const { id, name, intro, type, artStyle, videoRatio, imageModel, videoModel,imageQuality, projectType } = req.body; + const { id, name, intro, type, artStyle, videoRatio, imageModel, videoModel, imageQuality, projectType, mode } = req.body; await u.db("o_project").where("id", id).update({ name, @@ -33,8 +34,9 @@ export default router.post( videoModel, imageQuality, projectType, + mode, }); - res.status(200).send(success({ message: "新增项目成功" })); + res.status(200).send(success({ message: "编辑项目成功" })); }, ); diff --git a/src/types/database.d.ts b/src/types/database.d.ts index 0aca397..4d73b78 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -1,6 +1,20 @@ -// @db-hash 6be0a80e9c8f541987a4c1e907736237 +// @db-hash 125ad64f9dc929a01dd6bfb955f16031 //该文件由脚本自动生成,请勿手动修改 +export interface _o_project_old_20260331 { + 'artStyle'?: string | null; + 'createTime'?: number | null; + 'id'?: number | null; + 'imageModel'?: string | null; + 'imageQuality'?: string | null; + 'intro'?: 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; @@ -113,6 +127,7 @@ export interface o_project { 'imageModel'?: string | null; 'imageQuality'?: string | null; 'intro'?: string | null; + 'mode'?: string | null; 'name'?: string | null; 'projectType'?: string | null; 'type'?: string | null; @@ -234,6 +249,7 @@ export interface o_videoConfig { } export interface DB { + "_o_project_old_20260331": _o_project_old_20260331; "memories": memories; "o_agentDeploy": o_agentDeploy; "o_agentWorkData": o_agentWorkData;