创建项目添加项目类型

This commit is contained in:
小帅 2026-03-03 11:47:36 +08:00
parent 3153b2b79d
commit 3d3a1b4a41
3 changed files with 7 additions and 3 deletions

View File

@ -97,6 +97,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
name: "t_project",
builder: (table) => {
table.integer("id");
table.string("projectType");
table.text("name");
table.text("intro");
table.text("type");

View File

@ -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: "新增项目成功" }));
}
},
);

View File

@ -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;