添加项目加入模型选项
This commit is contained in:
parent
95dfc38f3a
commit
3b9d9a7a8a
2
env/.env.dev
vendored
2
env/.env.dev
vendored
@ -1,4 +1,4 @@
|
||||
NODE_ENV=dev
|
||||
PORT=10588
|
||||
OSSURL=http://192.168.0.74:10588/
|
||||
OSSURL=http://127.0.0.1:10588/
|
||||
|
||||
|
||||
@ -28,6 +28,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
|
||||
builder: (table) => {
|
||||
table.integer("id");
|
||||
table.string("projectType");
|
||||
table.string("model");
|
||||
table.text("name");
|
||||
table.text("intro");
|
||||
table.text("type");
|
||||
|
||||
@ -38,7 +38,6 @@ export default router.post(
|
||||
.where("o_assets.projectId", projectId)
|
||||
.where("o_assets.id", "in", assetIds)
|
||||
.whereNotNull("o_assets.assetsId");
|
||||
console.log("%c Line:35 🥚 childAssetsData", "background:#f5ce50", childAssetsData);
|
||||
|
||||
if (!sqlData) {
|
||||
const flowData: FlowData = {
|
||||
|
||||
@ -15,9 +15,10 @@ export default router.post(
|
||||
type: z.string(),
|
||||
artStyle: z.string(),
|
||||
videoRatio: z.string(),
|
||||
model: z.string(),
|
||||
}),
|
||||
async (req, res) => {
|
||||
const { projectType, name, intro, type, artStyle, videoRatio } = req.body;
|
||||
const { projectType, name, intro, type, artStyle, videoRatio, model } = req.body;
|
||||
|
||||
await u.db("o_project").insert({
|
||||
projectType,
|
||||
@ -27,6 +28,7 @@ export default router.post(
|
||||
artStyle,
|
||||
videoRatio,
|
||||
userId: 1,
|
||||
model,
|
||||
createTime: Date.now(),
|
||||
});
|
||||
|
||||
|
||||
@ -15,9 +15,10 @@ export default router.post(
|
||||
type: z.string(),
|
||||
artStyle: z.string(),
|
||||
videoRatio: z.string(),
|
||||
model: z.string(),
|
||||
}),
|
||||
async (req, res) => {
|
||||
const { id, name, intro, type, artStyle, videoRatio } = req.body;
|
||||
const { id, name, intro, type, artStyle, videoRatio, model } = req.body;
|
||||
|
||||
await u.db("o_project").where("id", id).update({
|
||||
name,
|
||||
@ -25,6 +26,7 @@ export default router.post(
|
||||
type,
|
||||
artStyle,
|
||||
videoRatio,
|
||||
model,
|
||||
});
|
||||
|
||||
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 a3673cf3a1d1c9cbf22ae3cfff196a71
|
||||
// @db-hash 2b2f9f6242d2d20e89412ba5117415df
|
||||
//该文件由脚本自动生成,请勿手动修改
|
||||
|
||||
export interface memories {
|
||||
@ -109,6 +109,7 @@ export interface o_project {
|
||||
'createTime'?: number | null;
|
||||
'id'?: number | null;
|
||||
'intro'?: string | null;
|
||||
'model'?: string | null;
|
||||
'name'?: string | null;
|
||||
'projectType'?: string | null;
|
||||
'type'?: string | null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user