From 3d3a1b4a41e4cee3e30cd1526ebd75f1be6429f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B8=85?= <2944435683> Date: Tue, 3 Mar 2026 11:47:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=A1=B9=E7=9B=AE=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=A1=B9=E7=9B=AE=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/initDB.ts | 1 + src/routes/project/addProject.ts | 6 ++++-- src/types/database.d.ts | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/initDB.ts b/src/lib/initDB.ts index 385cac1..3c1d951 100644 --- a/src/lib/initDB.ts +++ b/src/lib/initDB.ts @@ -97,6 +97,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise => name: "t_project", builder: (table) => { table.integer("id"); + table.string("projectType"); table.text("name"); table.text("intro"); table.text("type"); diff --git a/src/routes/project/addProject.ts b/src/routes/project/addProject.ts index c004500..9c81870 100644 --- a/src/routes/project/addProject.ts +++ b/src/routes/project/addProject.ts @@ -9,6 +9,7 @@ const router = express.Router(); export default router.post( "/", validateFields({ + projectType: z.string(), name: z.string(), intro: z.string(), type: z.string(), @@ -16,9 +17,10 @@ export default router.post( videoRatio: z.string(), }), async (req, res) => { - const { name, intro, type, artStyle, videoRatio } = req.body; + const { projectType, name, intro, type, artStyle, videoRatio } = req.body; await u.db("t_project").insert({ + projectType, name, intro, type, @@ -29,5 +31,5 @@ export default router.post( }); res.status(200).send(success({ message: "新增项目成功" })); - } + }, ); diff --git a/src/types/database.d.ts b/src/types/database.d.ts index 5afeacc..de87fc0 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -1,4 +1,4 @@ -// @db-hash 4073740ecb78a07f69489a53512e9b4d +// @db-hash dc7a91d1bfdbd1024a03543cfd93dfb9 //该文件由脚本自动生成,请勿手动修改 export interface t_aiModelMap { @@ -95,6 +95,7 @@ export interface t_project { 'id'?: number | null; 'intro'?: string | null; 'name'?: string | null; + 'projectType'?: string | null; 'type'?: string | null; 'userId'?: number | null; 'videoRatio'?: string | null;