添加项目加入模式
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("type");
|
||||
table.text("artStyle");
|
||||
table.text("mode");
|
||||
table.text("videoRatio");
|
||||
table.integer("createTime");
|
||||
table.integer("userId");
|
||||
|
||||
@ -17,11 +17,11 @@ export default router.post(
|
||||
videoRatio: z.string(),
|
||||
imageModel: z.string(),
|
||||
videoModel: z.string(),
|
||||
imageQuality: z.string()
|
||||
|
||||
imageQuality: z.string(),
|
||||
mode: z.string(),
|
||||
}),
|
||||
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({
|
||||
projectType,
|
||||
@ -34,7 +34,8 @@ export default router.post(
|
||||
imageModel,
|
||||
videoModel,
|
||||
createTime: Date.now(),
|
||||
imageQuality
|
||||
imageQuality,
|
||||
mode,
|
||||
});
|
||||
|
||||
res.status(200).send(success({ message: "新增项目成功" }));
|
||||
|
||||
@ -18,10 +18,11 @@ export default router.post(
|
||||
imageModel: z.string(),
|
||||
videoModel: z.string(),
|
||||
projectType: z.string(),
|
||||
imageQuality: z.string()
|
||||
imageQuality: z.string(),
|
||||
mode: z.string(),
|
||||
}),
|
||||
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({
|
||||
name,
|
||||
@ -33,8 +34,9 @@ export default router.post(
|
||||
videoModel,
|
||||
imageQuality,
|
||||
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 {
|
||||
'content': string;
|
||||
'createTime': number;
|
||||
@ -113,6 +127,7 @@ export interface o_project {
|
||||
'imageModel'?: string | null;
|
||||
'imageQuality'?: string | null;
|
||||
'intro'?: string | null;
|
||||
'mode'?: string | null;
|
||||
'name'?: string | null;
|
||||
'projectType'?: string | null;
|
||||
'type'?: string | null;
|
||||
@ -234,6 +249,7 @@ export interface o_videoConfig {
|
||||
}
|
||||
|
||||
export interface DB {
|
||||
"_o_project_old_20260331": _o_project_old_20260331;
|
||||
"memories": memories;
|
||||
"o_agentDeploy": o_agentDeploy;
|
||||
"o_agentWorkData": o_agentWorkData;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user