diff --git a/src/lib/initDB.ts b/src/lib/initDB.ts index ec76a3f..b0f1b74 100644 --- a/src/lib/initDB.ts +++ b/src/lib/initDB.ts @@ -28,7 +28,8 @@ export default async (knex: Knex, forceInit: boolean = false): Promise => builder: (table) => { table.integer("id"); table.string("projectType"); - table.string("model"); + table.string("imageModel"); + table.string("videoModel"); table.text("name"); table.text("intro"); table.text("type"); diff --git a/src/routes/project/addProject.ts b/src/routes/project/addProject.ts index d3f33c3..65f15d9 100644 --- a/src/routes/project/addProject.ts +++ b/src/routes/project/addProject.ts @@ -15,10 +15,11 @@ export default router.post( type: z.string(), artStyle: z.string(), videoRatio: z.string(), - model: z.string(), + imageModel: z.string(), + videoModel: z.string(), }), async (req, res) => { - const { projectType, name, intro, type, artStyle, videoRatio, model } = req.body; + const { projectType, name, intro, type, artStyle, videoRatio, imageModel, videoModel } = req.body; await u.db("o_project").insert({ projectType, @@ -28,7 +29,8 @@ export default router.post( artStyle, videoRatio, userId: 1, - model, + imageModel, + videoModel, createTime: Date.now(), }); diff --git a/src/routes/project/editProject.ts b/src/routes/project/editProject.ts index 64f224f..eb4fc8e 100644 --- a/src/routes/project/editProject.ts +++ b/src/routes/project/editProject.ts @@ -15,10 +15,11 @@ export default router.post( type: z.string(), artStyle: z.string(), videoRatio: z.string(), - model: z.string(), + imageModel: z.string(), + videoModel: z.string(), }), async (req, res) => { - const { id, name, intro, type, artStyle, videoRatio, model } = req.body; + const { id, name, intro, type, artStyle, videoRatio, imageModel, videoModel } = req.body; await u.db("o_project").where("id", id).update({ name, @@ -26,7 +27,8 @@ export default router.post( type, artStyle, videoRatio, - model, + imageModel, + videoModel, }); res.status(200).send(success({ message: "新增项目成功" })); diff --git a/src/types/database.d.ts b/src/types/database.d.ts index 69946ae..94fc14e 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -1,4 +1,4 @@ -// @db-hash 2b2f9f6242d2d20e89412ba5117415df +// @db-hash da56883d099bca97e0ea97a1ee5d3b15 //该文件由脚本自动生成,请勿手动修改 export interface memories { @@ -108,12 +108,13 @@ export interface o_project { 'artStyle'?: string | null; 'createTime'?: number | null; 'id'?: number | null; + 'imageModel'?: string | null; 'intro'?: string | null; - 'model'?: string | null; 'name'?: string | null; 'projectType'?: string | null; 'type'?: string | null; 'userId'?: number | null; + 'videoModel'?: string | null; 'videoRatio'?: string | null; } export interface o_script {