创建项目添加项目类型
This commit is contained in:
parent
3153b2b79d
commit
3d3a1b4a41
@ -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");
|
||||
|
||||
@ -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: "新增项目成功" }));
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
3
src/types/database.d.ts
vendored
3
src/types/database.d.ts
vendored
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user