From 22a236d7fbb77484321001deb5d4da0634040344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B8=85?= <2944435683> Date: Fri, 3 Apr 2026 02:24:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?toonflow=E5=B9=B3=E5=8F=B0=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=BC=96=E8=BE=91=E9=BB=98=E8=AE=A4=E5=90=AF=E7=94=A8?= =?UTF-8?q?=EF=BC=8C=E5=85=B6=E4=BB=96=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/setting/vendorConfig/addVendor.ts | 2 +- src/routes/setting/vendorConfig/updateCode.ts | 18 ++--- .../setting/vendorConfig/updateVendor.ts | 2 +- src/types/database.d.ts | 79 ++++++++++++++++++- 4 files changed, 84 insertions(+), 17 deletions(-) diff --git a/src/routes/setting/vendorConfig/addVendor.ts b/src/routes/setting/vendorConfig/addVendor.ts index 5ed265b..b1bfa8f 100644 --- a/src/routes/setting/vendorConfig/addVendor.ts +++ b/src/routes/setting/vendorConfig/addVendor.ts @@ -92,7 +92,7 @@ export default router.post( models: JSON.stringify(vendor.models ?? []), code: tsCode, createTime: Date.now(), - enable: 1, + enable: vendor.id == "toonflow" ? 1 : 0, }); res.status(200).send(success(result.data)); }, diff --git a/src/routes/setting/vendorConfig/updateCode.ts b/src/routes/setting/vendorConfig/updateCode.ts index 07333dc..838242f 100644 --- a/src/routes/setting/vendorConfig/updateCode.ts +++ b/src/routes/setting/vendorConfig/updateCode.ts @@ -36,7 +36,7 @@ const vendorConfigSchema = z.object({ modelName: z.string(), type: z.literal("image"), mode: z.array(z.enum(["text", "singleImage", "multiReference"])), - associationSkills:z.string().optional(), + associationSkills: z.string().optional(), }), z.object({ name: z.string(), @@ -44,19 +44,11 @@ const vendorConfigSchema = z.object({ type: z.literal("video"), mode: z.array( z.union([ - z.enum([ - "singleImage", - "startEndRequired", - "endFrameOptional", - "startFrameOptional", - "text", - "audioReference", - "videoReference", - ]), - z.array(z.enum(["audioReference", "videoReference", "textReference", "imageReference"])), + z.enum(["singleImage", "startEndRequired", "endFrameOptional", "startFrameOptional", "text", "audioReference", "videoReference"]), + z.array(z.enum(["audioReference", "videoReference", "textReference", "imageReference"])), ]), ), - associationSkills:z.string().optional(), + associationSkills: z.string().optional(), audio: z.union([z.literal("optional"), z.boolean()]), durationResolutionMap: z.array( z.object({ @@ -103,7 +95,7 @@ export default router.post( inputValues: JSON.stringify(vendor.inputValues ?? {}), models: JSON.stringify(vendor.models ?? []), code: tsCode, - enable: 0, + enable: vendor.id == "toonflow" ? 1 : 0, createTime: Date.now(), }); res.status(200).send(success(result.data)); diff --git a/src/routes/setting/vendorConfig/updateVendor.ts b/src/routes/setting/vendorConfig/updateVendor.ts index 788b327..6313450 100644 --- a/src/routes/setting/vendorConfig/updateVendor.ts +++ b/src/routes/setting/vendorConfig/updateVendor.ts @@ -67,7 +67,7 @@ export default router.post( inputs: JSON.stringify(inputs), inputValues: JSON.stringify(inputValues), models: JSON.stringify(models), - enable: 0, + enable: id == "toonflow" ? 1 : 0, }); res.status(200).send(success("更新成功")); }, diff --git a/src/types/database.d.ts b/src/types/database.d.ts index 1af96b9..62a13d9 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -1,6 +1,75 @@ -// @db-hash 6fa5017e455bc367c9c902ba574d11b4 +// @db-hash 35cf00f711e9d4df398703de70511684 //该文件由脚本自动生成,请勿手动修改 +export interface _o_project_old_20260402 { + 'artStyle'?: string | null; + 'createTime'?: number | null; + 'id'?: number | null; + 'imageModel'?: string | null; + 'imageQuality'?: string | null; + 'intro'?: string | null; + 'mode'?: string | null; + 'name'?: string | null; + 'projectType'?: string | null; + 'type'?: string | null; + 'userId'?: number | null; + 'videoModel'?: string | null; + 'videoRatio'?: string | null; +} +export interface _o_storyboard_old_20260402 { + 'createTime'?: number | null; + 'duration'?: string | null; + 'filePath'?: string | null; + 'flowId'?: number | null; + 'id'?: number; + 'index'?: number | null; + 'projectId'?: number | null; + 'prompt'?: string | null; + 'reason'?: string | null; + 'scriptId'?: number | null; + 'state'?: string | null; + 'trackId'?: number | null; +} +export interface _o_storyboard_old_20260402_1 { + 'createTime'?: number | null; + 'duration'?: string | null; + 'filePath'?: string | null; + 'flowId'?: number | null; + 'id'?: number; + 'index'?: number | null; + 'projectId'?: number | null; + 'prompt'?: string | null; + 'reason'?: string | null; + 'scriptId'?: number | null; + 'shouldGenerateImage'?: number | null; + 'state'?: string | null; + 'track'?: string | null; + 'trackId'?: number | null; + 'videoPrompt'?: string | null; +} +export interface _o_vendorConfig_old_20260401 { + 'author'?: string | null; + 'code'?: string | null; + 'createTime'?: number | null; + 'description'?: string | null; + 'enableEnglish'?: number | null; + 'icon'?: string | null; + 'id'?: string; + 'inputs'?: string | null; + 'inputValues'?: string | null; + 'models'?: string | null; + 'name'?: string | null; +} +export interface _o_videoTrack_old_20260402 { + 'id'?: number; + 'projectId'?: number | null; + 'prompt'?: string | null; + 'reason'?: string | null; + 'scriptId'?: number | null; + 'selectVideoId'?: number | null; + 'state'?: string | null; + 'videoId'?: number | null; +} export interface memories { 'content': string; 'createTime': number; @@ -76,6 +145,7 @@ export interface o_image { 'filePath'?: string | null; 'id'?: number; 'model'?: string | null; + 'reason'?: string | null; 'resolution'?: string | null; 'state'?: string | null; 'type'?: string | null; @@ -201,6 +271,7 @@ export interface o_vendorConfig { 'createTime'?: number | null; 'description'?: string | null; 'enable'?: number | null; + 'enableEnglish'?: number | null; 'icon'?: string | null; 'id'?: string; 'inputs'?: string | null; @@ -225,12 +296,16 @@ export interface o_videoTrack { 'prompt'?: string | null; 'reason'?: string | null; 'scriptId'?: number | null; - 'selectVideoId'?: number | null; 'state'?: string | null; 'videoId'?: number | null; } export interface DB { + "_o_project_old_20260402": _o_project_old_20260402; + "_o_storyboard_old_20260402": _o_storyboard_old_20260402; + "_o_storyboard_old_20260402_1": _o_storyboard_old_20260402_1; + "_o_vendorConfig_old_20260401": _o_vendorConfig_old_20260401; + "_o_videoTrack_old_20260402": _o_videoTrack_old_20260402; "memories": memories; "o_agentDeploy": o_agentDeploy; "o_agentWorkData": o_agentWorkData; From 2711ac171923aacae5232fdea3aae81f041f5aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B8=85?= <2944435683> Date: Fri, 3 Apr 2026 02:29:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E5=B7=B2=E5=AD=98=E5=9C=A8=E6=98=BE=E7=A4=BA=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/setting/vendorConfig/addVendor.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/routes/setting/vendorConfig/addVendor.ts b/src/routes/setting/vendorConfig/addVendor.ts index b1bfa8f..19797cd 100644 --- a/src/routes/setting/vendorConfig/addVendor.ts +++ b/src/routes/setting/vendorConfig/addVendor.ts @@ -81,6 +81,8 @@ export default router.post( } if ((vendor.id as string).includes(":")) return res.status(400).send(error("id不能包含英文冒号")); + const data = await u.db("o_vendorConfig").where("id", vendor.id).first(); + if (data) return res.status(500).send(error("供应商id已存在")); await u.db("o_vendorConfig").insert({ id: vendor.id, author: vendor.author,