添加和编辑项目添加选择视频模型和图片模型
This commit is contained in:
parent
e118d75340
commit
83266fb14d
@ -28,7 +28,8 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
|
|||||||
builder: (table) => {
|
builder: (table) => {
|
||||||
table.integer("id");
|
table.integer("id");
|
||||||
table.string("projectType");
|
table.string("projectType");
|
||||||
table.string("model");
|
table.string("imageModel");
|
||||||
|
table.string("videoModel");
|
||||||
table.text("name");
|
table.text("name");
|
||||||
table.text("intro");
|
table.text("intro");
|
||||||
table.text("type");
|
table.text("type");
|
||||||
|
|||||||
@ -15,10 +15,11 @@ export default router.post(
|
|||||||
type: z.string(),
|
type: z.string(),
|
||||||
artStyle: z.string(),
|
artStyle: z.string(),
|
||||||
videoRatio: z.string(),
|
videoRatio: z.string(),
|
||||||
model: z.string(),
|
imageModel: z.string(),
|
||||||
|
videoModel: z.string(),
|
||||||
}),
|
}),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
const { projectType, name, intro, type, artStyle, videoRatio, model } = req.body;
|
const { projectType, name, intro, type, artStyle, videoRatio, imageModel, videoModel } = req.body;
|
||||||
|
|
||||||
await u.db("o_project").insert({
|
await u.db("o_project").insert({
|
||||||
projectType,
|
projectType,
|
||||||
@ -28,7 +29,8 @@ export default router.post(
|
|||||||
artStyle,
|
artStyle,
|
||||||
videoRatio,
|
videoRatio,
|
||||||
userId: 1,
|
userId: 1,
|
||||||
model,
|
imageModel,
|
||||||
|
videoModel,
|
||||||
createTime: Date.now(),
|
createTime: Date.now(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -15,10 +15,11 @@ export default router.post(
|
|||||||
type: z.string(),
|
type: z.string(),
|
||||||
artStyle: z.string(),
|
artStyle: z.string(),
|
||||||
videoRatio: z.string(),
|
videoRatio: z.string(),
|
||||||
model: z.string(),
|
imageModel: z.string(),
|
||||||
|
videoModel: z.string(),
|
||||||
}),
|
}),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
const { id, name, intro, type, artStyle, videoRatio, model } = req.body;
|
const { id, name, intro, type, artStyle, videoRatio, imageModel, videoModel } = req.body;
|
||||||
|
|
||||||
await u.db("o_project").where("id", id).update({
|
await u.db("o_project").where("id", id).update({
|
||||||
name,
|
name,
|
||||||
@ -26,7 +27,8 @@ export default router.post(
|
|||||||
type,
|
type,
|
||||||
artStyle,
|
artStyle,
|
||||||
videoRatio,
|
videoRatio,
|
||||||
model,
|
imageModel,
|
||||||
|
videoModel,
|
||||||
});
|
});
|
||||||
|
|
||||||
res.status(200).send(success({ message: "新增项目成功" }));
|
res.status(200).send(success({ message: "新增项目成功" }));
|
||||||
|
|||||||
5
src/types/database.d.ts
vendored
5
src/types/database.d.ts
vendored
@ -1,4 +1,4 @@
|
|||||||
// @db-hash 2b2f9f6242d2d20e89412ba5117415df
|
// @db-hash da56883d099bca97e0ea97a1ee5d3b15
|
||||||
//该文件由脚本自动生成,请勿手动修改
|
//该文件由脚本自动生成,请勿手动修改
|
||||||
|
|
||||||
export interface memories {
|
export interface memories {
|
||||||
@ -108,12 +108,13 @@ export interface o_project {
|
|||||||
'artStyle'?: string | null;
|
'artStyle'?: string | null;
|
||||||
'createTime'?: number | null;
|
'createTime'?: number | null;
|
||||||
'id'?: number | null;
|
'id'?: number | null;
|
||||||
|
'imageModel'?: string | null;
|
||||||
'intro'?: string | null;
|
'intro'?: string | null;
|
||||||
'model'?: string | null;
|
|
||||||
'name'?: string | null;
|
'name'?: string | null;
|
||||||
'projectType'?: string | null;
|
'projectType'?: string | null;
|
||||||
'type'?: string | null;
|
'type'?: string | null;
|
||||||
'userId'?: number | null;
|
'userId'?: number | null;
|
||||||
|
'videoModel'?: string | null;
|
||||||
'videoRatio'?: string | null;
|
'videoRatio'?: string | null;
|
||||||
}
|
}
|
||||||
export interface o_script {
|
export interface o_script {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user