添加项目加入模式
This commit is contained in:
parent
2c6938ea22
commit
ada80ff47a
@ -37,6 +37,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
|
|||||||
table.text("intro");
|
table.text("intro");
|
||||||
table.text("type");
|
table.text("type");
|
||||||
table.text("artStyle");
|
table.text("artStyle");
|
||||||
|
table.text("mode");
|
||||||
table.text("videoRatio");
|
table.text("videoRatio");
|
||||||
table.integer("createTime");
|
table.integer("createTime");
|
||||||
table.integer("userId");
|
table.integer("userId");
|
||||||
|
|||||||
@ -17,11 +17,11 @@ export default router.post(
|
|||||||
videoRatio: z.string(),
|
videoRatio: z.string(),
|
||||||
imageModel: z.string(),
|
imageModel: z.string(),
|
||||||
videoModel: z.string(),
|
videoModel: z.string(),
|
||||||
imageQuality: z.string()
|
imageQuality: z.string(),
|
||||||
|
mode: z.string(),
|
||||||
}),
|
}),
|
||||||
async (req, res) => {
|
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({
|
await u.db("o_project").insert({
|
||||||
projectType,
|
projectType,
|
||||||
@ -34,7 +34,8 @@ export default router.post(
|
|||||||
imageModel,
|
imageModel,
|
||||||
videoModel,
|
videoModel,
|
||||||
createTime: Date.now(),
|
createTime: Date.now(),
|
||||||
imageQuality
|
imageQuality,
|
||||||
|
mode,
|
||||||
});
|
});
|
||||||
|
|
||||||
res.status(200).send(success({ message: "新增项目成功" }));
|
res.status(200).send(success({ message: "新增项目成功" }));
|
||||||
|
|||||||
@ -18,10 +18,11 @@ export default router.post(
|
|||||||
imageModel: z.string(),
|
imageModel: z.string(),
|
||||||
videoModel: z.string(),
|
videoModel: z.string(),
|
||||||
projectType: z.string(),
|
projectType: z.string(),
|
||||||
imageQuality: z.string()
|
imageQuality: z.string(),
|
||||||
|
mode: z.string(),
|
||||||
}),
|
}),
|
||||||
async (req, res) => {
|
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({
|
await u.db("o_project").where("id", id).update({
|
||||||
name,
|
name,
|
||||||
@ -33,8 +34,9 @@ export default router.post(
|
|||||||
videoModel,
|
videoModel,
|
||||||
imageQuality,
|
imageQuality,
|
||||||
projectType,
|
projectType,
|
||||||
|
mode,
|
||||||
});
|
});
|
||||||
|
|
||||||
res.status(200).send(success({ message: "新增项目成功" }));
|
res.status(200).send(success({ message: "编辑项目成功" }));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
18
src/types/database.d.ts
vendored
18
src/types/database.d.ts
vendored
@ -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 {
|
export interface memories {
|
||||||
'content': string;
|
'content': string;
|
||||||
'createTime': number;
|
'createTime': number;
|
||||||
@ -113,6 +127,7 @@ export interface o_project {
|
|||||||
'imageModel'?: string | null;
|
'imageModel'?: string | null;
|
||||||
'imageQuality'?: string | null;
|
'imageQuality'?: string | null;
|
||||||
'intro'?: string | null;
|
'intro'?: string | null;
|
||||||
|
'mode'?: string | null;
|
||||||
'name'?: string | null;
|
'name'?: string | null;
|
||||||
'projectType'?: string | null;
|
'projectType'?: string | null;
|
||||||
'type'?: string | null;
|
'type'?: string | null;
|
||||||
@ -234,6 +249,7 @@ export interface o_videoConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface DB {
|
export interface DB {
|
||||||
|
"_o_project_old_20260331": _o_project_old_20260331;
|
||||||
"memories": memories;
|
"memories": memories;
|
||||||
"o_agentDeploy": o_agentDeploy;
|
"o_agentDeploy": o_agentDeploy;
|
||||||
"o_agentWorkData": o_agentWorkData;
|
"o_agentWorkData": o_agentWorkData;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user