From a753cacccb6a505a8d5c6b47e1f94eb88878e184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B8=85?= <2944435683> Date: Fri, 20 Mar 2026 11:13:31 +0800 Subject: [PATCH 1/5] no message --- src/types/database.d.ts | 76 +++-------------------------------------- 1 file changed, 5 insertions(+), 71 deletions(-) diff --git a/src/types/database.d.ts b/src/types/database.d.ts index ffaa589..e3a7e5f 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -1,9 +1,9 @@ -// @db-hash 2f9e6a9e9145cead00652858cafb9159 +// @db-hash 04e1150a9773602183de5f660a52b092 //该文件由脚本自动生成,请勿手动修改 export interface memories { 'content': string; - 'createdAt': number; + 'createTime': number; 'embedding'?: string | null; 'id'?: string; 'isolationKey': string; @@ -35,18 +35,12 @@ export interface o_assets { 'projectId'?: number | null; 'prompt'?: string | null; 'remark'?: string | null; + 'scriptId'?: number | null; 'sonId'?: number | null; 'startTime'?: number | null; 'state'?: string | null; 'type'?: string | null; } -export interface o_chatHistory { - 'data'?: string | null; - 'id'?: number; - 'novel'?: string | null; - 'projectId'?: number | null; - 'type'?: string | null; -} export interface o_event { 'createTime'?: number | null; 'detail'?: string | null; @@ -67,33 +61,10 @@ export interface o_image { 'assetsId'?: number | null; 'filePath'?: string | null; 'id'?: number; - 'projectId'?: number | null; - 'scriptId'?: number | null; + 'model'?: string | null; + 'resolution'?: string | null; 'state'?: string | null; 'type'?: string | null; - 'videoId'?: number | null; -} -export interface o_model { - 'apiKey'?: string | null; - 'baseUrl'?: string | null; - 'createTime'?: number | null; - 'id'?: number; - 'index'?: number | null; - 'manufacturer'?: string | null; - 'model'?: string | null; - 'modelType'?: string | null; - 'type'?: string | null; -} -export interface o_myTasks { - 'describe'?: string | null; - 'id'?: number; - 'model'?: string | null; - 'projectId'?: number | null; - 'reason'?: string | null; - 'relatedObjects'?: string | null; - 'startTime'?: number | null; - 'state'?: string | null; - 'taskClass'?: string | null; } export interface o_novel { 'chapter'?: string | null; @@ -126,15 +97,6 @@ export interface o_project { 'userId'?: number | null; 'videoRatio'?: string | null; } -export interface o_prompts { - 'code'?: string | null; - 'customValue'?: string | null; - 'defaultValue'?: string | null; - 'id'?: number; - 'name'?: string | null; - 'parentCode'?: string | null; - 'type'?: string | null; -} export interface o_script { 'content'?: string | null; 'createTime'?: number | null; @@ -142,35 +104,15 @@ export interface o_script { 'name'?: string | null; 'projectId'?: number | null; } -export interface o_scriptAssets { - 'assetsId'?: number | null; - 'id'?: number; - 'scriptId'?: number | null; -} -export interface o_scriptOutline { - 'id'?: number; - 'outlineId'?: number | null; - 'scriptId'?: number | null; -} export interface o_setting { 'key'?: string | null; 'value'?: string | null; } -export interface o_skills { - 'id'?: number; - 'name'?: string | null; - 'startTime'?: number | null; -} export interface o_storyboard { 'createTime'?: number | null; 'id'?: number; 'name'?: string | null; } -export interface o_storyboardScript { - 'id'?: number; - 'scriptId'?: number | null; - 'storyboardId'?: number | null; -} export interface o_tasks { 'describe'?: string | null; 'id'?: number; @@ -236,25 +178,17 @@ export interface DB { "o_agentDeploy": o_agentDeploy; "o_artStyle": o_artStyle; "o_assets": o_assets; - "o_chatHistory": o_chatHistory; "o_event": o_event; "o_eventChapter": o_eventChapter; "o_flowData": o_flowData; "o_image": o_image; - "o_model": o_model; - "o_myTasks": o_myTasks; "o_novel": o_novel; "o_outline": o_outline; "o_outlineNovel": o_outlineNovel; "o_project": o_project; - "o_prompts": o_prompts; "o_script": o_script; - "o_scriptAssets": o_scriptAssets; - "o_scriptOutline": o_scriptOutline; "o_setting": o_setting; - "o_skills": o_skills; "o_storyboard": o_storyboard; - "o_storyboardScript": o_storyboardScript; "o_tasks": o_tasks; "o_user": o_user; "o_vendorConfig": o_vendorConfig; From 1eb86764631f59ec78035b33bb86b7063e60391c Mon Sep 17 00:00:00 2001 From: zhishi <1951671751@qq.com> Date: Fri, 20 Mar 2026 11:46:12 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/ai.ts | 95 +++++++++++++++++++++++++++++++------------------ 1 file changed, 61 insertions(+), 34 deletions(-) diff --git a/src/utils/ai.ts b/src/utils/ai.ts index 87db692..148dcff 100644 --- a/src/utils/ai.ts +++ b/src/utils/ai.ts @@ -4,25 +4,26 @@ import axios from "axios"; import { transform } from "sucrase"; import u from "@/utils"; -type AiType = "scriptAgent" | "productionAgent" | "assetsAi" | "polishingAi" | "ttsDubbing" | "eventExtractAi"; +type AiType = "scriptAgent" | "productionAgent" | "assetsAi" | "polishingAi" | "eventExtractAi" | "ttsDubbing" | "test"; type FnName = "textRequest" | "imageRequest" | "videoRequest" | "ttsRequest"; -const AiTypeValues: AiType[] = ["scriptAgent", "productionAgent", "assetsAi", "polishingAi", "ttsDubbing", "eventExtractAi"]; -async function getVendorTemplateFn(fnName: FnName, value: AiType | `${number}:${string}`) { - let id, modelName; - const isAgent = AiTypeValues.includes(value as AiType); - if (isAgent) { +const AiTypeValues: AiType[] = ["scriptAgent", "productionAgent", "assetsAi", "polishingAi", "eventExtractAi", "ttsDubbing"]; +async function resolveModelName(value: AiType | `${number}:${string}`): Promise<`${number}:${string}`> { + if (AiTypeValues.includes(value as AiType)) { const agentDeployData = await u.db("o_agentDeploy").where("key", value).first(); if (!agentDeployData?.modelName) throw new Error(`${value}模型未配置`); - [id, modelName] = agentDeployData.modelName.split(":"); - } else { - [id, modelName] = value.split(":"); + return agentDeployData.modelName as `${number}:${string}`; } + return value as `${number}:${string}`; +} + +async function getVendorTemplateFn(fnName: FnName, modelName: `${number}:${string}`) { + const [id, name] = modelName.split(":"); const vendorConfigData = await u.db("o_vendorConfig").where("id", id).first(); if (!vendorConfigData) throw new Error(`未找到供应商配置 id=${id}`); const modelList = JSON.parse(vendorConfigData.models ?? "[]"); - const selectedModel = modelList.find((i: any) => i.modelName == modelName); - if (!selectedModel) throw new Error(`未找到模型 ${modelName} id=${id}`); + const selectedModel = modelList.find((i: any) => i.modelName == name); + if (!selectedModel) throw new Error(`未找到模型 ${name} id=${id}`); const jsCode = transform(vendorConfigData.code!, { transforms: ["typescript"] }).code; const fn = u.vm(jsCode)[fnName]; if (!fn) throw new Error(`未找到供应商配置中的函数 ${fnName} id=${id}`); @@ -30,6 +31,23 @@ async function getVendorTemplateFn(fnName: FnName, value: AiType | `${number}:${ else return (input: T) => fn(input, selectedModel); } +async function withTaskRecord( + modelKey: AiType | `${number}:${string}`, + taskClass: string, + fn: (modelName: `${number}:${string}`) => Promise, +): Promise { + const modelName = await resolveModelName(modelKey); + const taskRecord = await u.task(1, taskClass, modelName, { describe: "", content: "" }); + try { + const result = await fn(modelName); + taskRecord(1); + return result; + } catch (e) { + taskRecord(-1, u.error(e).message); + throw e; + } +} + async function urlToBase64(url: string): Promise { const res = await axios.get(url, { responseType: "arraybuffer" }); const base64 = Buffer.from(res.data).toString("base64"); @@ -42,18 +60,22 @@ class AiText { this.AiType = AiType; } async invoke(input: Omit[0], "model">) { - return generateText({ - ...(input.tools && { stopWhen: stepCountIs(Object.keys(input.tools).length * 5) }), - ...input, - model: await getVendorTemplateFn("textRequest", this.AiType), - } as Parameters[0]); + return withTaskRecord(this.AiType, "TaskClass", async (modelName) => + generateText({ + ...(input.tools && { stopWhen: stepCountIs(Object.keys(input.tools).length * 5) }), + ...input, + model: await getVendorTemplateFn("textRequest", modelName), + } as Parameters[0]), + ); } async stream(input: Omit[0], "model">) { - return streamText({ - ...(input.tools && { stopWhen: stepCountIs(Object.keys(input.tools).length * 5) }), - ...input, - model: await getVendorTemplateFn("textRequest", this.AiType), - } as Parameters[0]); + return withTaskRecord(this.AiType, "TaskClass", async (modelName) => + streamText({ + ...(input.tools && { stopWhen: stepCountIs(Object.keys(input.tools).length * 5) }), + ...input, + model: await getVendorTemplateFn("textRequest", modelName), + } as Parameters[0]), + ); } } @@ -72,11 +94,12 @@ class AiImage { this.key = key; } async run(input: ImageConfig) { - const fn = await getVendorTemplateFn("imageRequest", this.key); - this.result = await fn(input); - if (this.result.startsWith("http")) this.result = await urlToBase64(this.result); - - return this; + return withTaskRecord(this.key, "TaskClass", async (modelName) => { + const fn = await getVendorTemplateFn("imageRequest", modelName); + this.result = await fn(input); + if (this.result.startsWith("http")) this.result = await urlToBase64(this.result); + return this; + }); } async save(path: string) { await u.oss.writeFile(path, this.result); @@ -90,10 +113,12 @@ class AiVideo { this.key = key; } async run(input: ImageConfig) { - const fn = await getVendorTemplateFn("videoRequest", this.key); - this.result = await fn(input); - if (this.result.startsWith("http")) this.result = await urlToBase64(this.result); - return this; + return withTaskRecord(this.key, "TaskClass", async (modelName) => { + const fn = await getVendorTemplateFn("videoRequest", modelName); + this.result = await fn(input); + if (this.result.startsWith("http")) this.result = await urlToBase64(this.result); + return this; + }); } async save(path: string) { await u.oss.writeFile(path, this.result); @@ -107,10 +132,12 @@ class AiAudio { this.key = key; } async run(input: ImageConfig) { - const fn = await getVendorTemplateFn("ttsRequest", this.key); - this.result = await fn(input); - if (this.result.startsWith("http")) this.result = await urlToBase64(this.result); - return this; + return withTaskRecord(this.key, "TaskClass", async (modelName) => { + const fn = await getVendorTemplateFn("ttsRequest", modelName); + this.result = await fn(input); + if (this.result.startsWith("http")) this.result = await urlToBase64(this.result); + return this; + }); } async save(path: string) { await u.oss.writeFile(path, this.result); From 6a74cf168c1d2871477fb6a4bf5e52a24818cf57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B8=85?= <2944435683> Date: Fri, 20 Mar 2026 14:54:45 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/initDB.ts | 6 +- src/routes/assetsGenerate/generateAssets.ts | 24 +++++++ src/types/database.d.ts | 74 ++------------------- src/utils/ai.ts | 42 +++++++----- 4 files changed, 55 insertions(+), 91 deletions(-) diff --git a/src/lib/initDB.ts b/src/lib/initDB.ts index d8a70f6..ada4c87 100644 --- a/src/lib/initDB.ts +++ b/src/lib/initDB.ts @@ -90,7 +90,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise => modelName: "", vendorId: null, key: "assetsAi", - name: "资产AI", + name: "资产Agent", desc: "根据角色和场景要素,生成精准的素材提示词", disabled: false, }, @@ -99,7 +99,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise => modelName: "", vendorId: null, key: "polishingAi", - name: "润色AI", + name: "润色Agent", desc: "将大纲扩展为完整剧本脚本,包含对话和场景描写", disabled: false, }, @@ -108,7 +108,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise => modelName: "", vendorId: null, key: "eventExtractAi", - name: "事件提取AI", + name: "事件提取Agent", desc: "从小说原文中提取事件,生成事件列表和事件关系", disabled: false, }, diff --git a/src/routes/assetsGenerate/generateAssets.ts b/src/routes/assetsGenerate/generateAssets.ts index 6283434..3e1001f 100644 --- a/src/routes/assetsGenerate/generateAssets.ts +++ b/src/routes/assetsGenerate/generateAssets.ts @@ -87,18 +87,38 @@ export default router.post( try { let imagePath; let insertType; + let describe; + let relatedObjects = {}; if (type == "role") { insertType = "role"; imagePath = `/${projectId}/role/${uuidv4()}.jpg`; + describe = `生成角色图,名称:${name},提示词:${prompt}`; + relatedObjects = { + id: id, + projectId, + type: "角色", + }; } if (type == "scene") { insertType = "scene"; imagePath = `/${projectId}/scene/${uuidv4()}.jpg`; + describe = `生成场景图,名称:${name},提示词:${prompt}`; + relatedObjects = { + id: id, + projectId, + type: "场景", + }; } if (type == "tool") { insertType = "tool"; imagePath = `/${projectId}/props/${uuidv4()}.jpg`; + describe = `生成道具图,名称:${name},提示词:${prompt}`; + relatedObjects = { + id: id, + projectId, + type: "道具", + }; } const aiImage = u.Ai.Image(model); @@ -108,6 +128,10 @@ export default router.post( imageBase64: base64 ? [base64] : [], size: resolution, aspectRatio: "16:9", + taskClass, + describe: describe ?? "", // 描述 + projectId, + relatedObjects: JSON.stringify(relatedObjects), // 相关对象信息,便于后续分析和追踪 }); aiImage.save(imagePath!); const imageData = await u.db("o_image").where("id", imageId).select("*").first(); diff --git a/src/types/database.d.ts b/src/types/database.d.ts index 4c3b490..e3a7e5f 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -1,4 +1,4 @@ -// @db-hash feca77a2c2ec5b6a2989347f982558d5 +// @db-hash 04e1150a9773602183de5f660a52b092 //该文件由脚本自动生成,请勿手动修改 export interface memories { @@ -35,18 +35,12 @@ export interface o_assets { 'projectId'?: number | null; 'prompt'?: string | null; 'remark'?: string | null; + 'scriptId'?: number | null; 'sonId'?: number | null; 'startTime'?: number | null; 'state'?: string | null; 'type'?: string | null; } -export interface o_chatHistory { - 'data'?: string | null; - 'id'?: number; - 'novel'?: string | null; - 'projectId'?: number | null; - 'type'?: string | null; -} export interface o_event { 'createTime'?: number | null; 'detail'?: string | null; @@ -67,33 +61,10 @@ export interface o_image { 'assetsId'?: number | null; 'filePath'?: string | null; 'id'?: number; - 'projectId'?: number | null; - 'scriptId'?: number | null; + 'model'?: string | null; + 'resolution'?: string | null; 'state'?: string | null; 'type'?: string | null; - 'videoId'?: number | null; -} -export interface o_model { - 'apiKey'?: string | null; - 'baseUrl'?: string | null; - 'createTime'?: number | null; - 'id'?: number; - 'index'?: number | null; - 'manufacturer'?: string | null; - 'model'?: string | null; - 'modelType'?: string | null; - 'type'?: string | null; -} -export interface o_myTasks { - 'describe'?: string | null; - 'id'?: number; - 'model'?: string | null; - 'projectId'?: number | null; - 'reason'?: string | null; - 'relatedObjects'?: string | null; - 'startTime'?: number | null; - 'state'?: string | null; - 'taskClass'?: string | null; } export interface o_novel { 'chapter'?: string | null; @@ -126,15 +97,6 @@ export interface o_project { 'userId'?: number | null; 'videoRatio'?: string | null; } -export interface o_prompts { - 'code'?: string | null; - 'customValue'?: string | null; - 'defaultValue'?: string | null; - 'id'?: number; - 'name'?: string | null; - 'parentCode'?: string | null; - 'type'?: string | null; -} export interface o_script { 'content'?: string | null; 'createTime'?: number | null; @@ -142,35 +104,15 @@ export interface o_script { 'name'?: string | null; 'projectId'?: number | null; } -export interface o_scriptAssets { - 'assetsId'?: number | null; - 'id'?: number; - 'scriptId'?: number | null; -} -export interface o_scriptOutline { - 'id'?: number; - 'outlineId'?: number | null; - 'scriptId'?: number | null; -} export interface o_setting { 'key'?: string | null; 'value'?: string | null; } -export interface o_skills { - 'id'?: number; - 'name'?: string | null; - 'startTime'?: number | null; -} export interface o_storyboard { 'createTime'?: number | null; 'id'?: number; 'name'?: string | null; } -export interface o_storyboardScript { - 'id'?: number; - 'scriptId'?: number | null; - 'storyboardId'?: number | null; -} export interface o_tasks { 'describe'?: string | null; 'id'?: number; @@ -236,25 +178,17 @@ export interface DB { "o_agentDeploy": o_agentDeploy; "o_artStyle": o_artStyle; "o_assets": o_assets; - "o_chatHistory": o_chatHistory; "o_event": o_event; "o_eventChapter": o_eventChapter; "o_flowData": o_flowData; "o_image": o_image; - "o_model": o_model; - "o_myTasks": o_myTasks; "o_novel": o_novel; "o_outline": o_outline; "o_outlineNovel": o_outlineNovel; "o_project": o_project; - "o_prompts": o_prompts; "o_script": o_script; - "o_scriptAssets": o_scriptAssets; - "o_scriptOutline": o_scriptOutline; "o_setting": o_setting; - "o_skills": o_skills; "o_storyboard": o_storyboard; - "o_storyboardScript": o_storyboardScript; "o_tasks": o_tasks; "o_user": o_user; "o_vendorConfig": o_vendorConfig; diff --git a/src/utils/ai.ts b/src/utils/ai.ts index 148dcff..e3be26b 100644 --- a/src/utils/ai.ts +++ b/src/utils/ai.ts @@ -34,10 +34,14 @@ async function getVendorTemplateFn(fnName: FnName, modelName: `${number}:${strin async function withTaskRecord( modelKey: AiType | `${number}:${string}`, taskClass: string, + describe: string, + relatedObjects: string, + projectId: number, fn: (modelName: `${number}:${string}`) => Promise, ): Promise { const modelName = await resolveModelName(modelKey); - const taskRecord = await u.task(1, taskClass, modelName, { describe: "", content: "" }); + const [id, model] = modelName.split(":"); + const taskRecord = await u.task(projectId, taskClass, model, { describe: describe, content: relatedObjects }); try { const result = await fn(modelName); taskRecord(1); @@ -60,22 +64,20 @@ class AiText { this.AiType = AiType; } async invoke(input: Omit[0], "model">) { - return withTaskRecord(this.AiType, "TaskClass", async (modelName) => - generateText({ - ...(input.tools && { stopWhen: stepCountIs(Object.keys(input.tools).length * 5) }), - ...input, - model: await getVendorTemplateFn("textRequest", modelName), - } as Parameters[0]), - ); + const modelName = await resolveModelName(this.AiType); + return generateText({ + ...(input.tools && { stopWhen: stepCountIs(Object.keys(input.tools).length * 5) }), + ...input, + model: await getVendorTemplateFn("textRequest", modelName), + } as Parameters[0]); } async stream(input: Omit[0], "model">) { - return withTaskRecord(this.AiType, "TaskClass", async (modelName) => - streamText({ - ...(input.tools && { stopWhen: stepCountIs(Object.keys(input.tools).length * 5) }), - ...input, - model: await getVendorTemplateFn("textRequest", modelName), - } as Parameters[0]), - ); + const modelName = await resolveModelName(this.AiType); + return streamText({ + ...(input.tools && { stopWhen: stepCountIs(Object.keys(input.tools).length * 5) }), + ...input, + model: await getVendorTemplateFn("textRequest", modelName), + } as Parameters[0]); } } @@ -85,6 +87,10 @@ interface ImageConfig { imageBase64: string[]; //输入的图片提示词 size: "1K" | "2K" | "4K"; // 图片尺寸 aspectRatio: `${number}:${number}`; // 长宽比 + taskClass: string; // 任务分类 + describe: string; // 任务描述 + relatedObjects: string; // 相关对象信息,便于后续分析和追踪 + projectId: number; // 项目ID } class AiImage { @@ -94,7 +100,7 @@ class AiImage { this.key = key; } async run(input: ImageConfig) { - return withTaskRecord(this.key, "TaskClass", async (modelName) => { + return withTaskRecord(this.key, input.taskClass, input.describe, input.relatedObjects, input.projectId, async (modelName) => { const fn = await getVendorTemplateFn("imageRequest", modelName); this.result = await fn(input); if (this.result.startsWith("http")) this.result = await urlToBase64(this.result); @@ -113,7 +119,7 @@ class AiVideo { this.key = key; } async run(input: ImageConfig) { - return withTaskRecord(this.key, "TaskClass", async (modelName) => { + return withTaskRecord(this.key, input.taskClass, input.describe, input.relatedObjects, input.projectId, async (modelName) => { const fn = await getVendorTemplateFn("videoRequest", modelName); this.result = await fn(input); if (this.result.startsWith("http")) this.result = await urlToBase64(this.result); @@ -132,7 +138,7 @@ class AiAudio { this.key = key; } async run(input: ImageConfig) { - return withTaskRecord(this.key, "TaskClass", async (modelName) => { + return withTaskRecord(this.key, input.taskClass, input.describe, input.relatedObjects, input.projectId, async (modelName) => { const fn = await getVendorTemplateFn("ttsRequest", modelName); this.result = await fn(input); if (this.result.startsWith("http")) this.result = await urlToBase64(this.result); From 08bbc001e0d0e4a4b3560438fc13c556130b0c8a Mon Sep 17 00:00:00 2001 From: zhishi <1951671751@qq.com> Date: Fri, 20 Mar 2026 15:03:57 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workbench/getVideoModelDetail.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/routes/production/workbench/getVideoModelDetail.ts diff --git a/src/routes/production/workbench/getVideoModelDetail.ts b/src/routes/production/workbench/getVideoModelDetail.ts new file mode 100644 index 0000000..fdf11f2 --- /dev/null +++ b/src/routes/production/workbench/getVideoModelDetail.ts @@ -0,0 +1,20 @@ +import express from "express"; +import u from "@/utils"; +import { z } from "zod"; +import { success } from "@/lib/responseFormat"; +import { validateFields } from "@/middleware/middleware"; +const router = express.Router(); + +export default router.post("/", async (req, res) => { + const { type } = req.body; + const vendorData = await u.db("o_vendorConfig").select("id", "models", "name"); + if (!vendorData) { + return res.status(404).send({ error: "模型未找到" }); + } + for (const item of vendorData) { + const modelsData = JSON.parse(item.models! ?? "[]"); + const filterData = modelsData.filter((item: { type: string }) => item.type === type); + if (filterData.length > 0) { + } + } +}); From b3f742f09f6bd6361cdb72ad39b4162512ae00bb Mon Sep 17 00:00:00 2001 From: zhishi <1951671751@qq.com> Date: Fri, 20 Mar 2026 15:04:17 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router.ts | 108 ++++++++++++++++++++-------------------- src/types/database.d.ts | 4 +- 2 files changed, 57 insertions(+), 55 deletions(-) diff --git a/src/router.ts b/src/router.ts index 7fe2681..bddd2d8 100644 --- a/src/router.ts +++ b/src/router.ts @@ -1,4 +1,4 @@ -// @routes-hash dbac61c96fe5d9d9a361d24721d77197 +// @routes-hash 45e23a536a13265ff62fe92b1cb71fe3 import { Express } from "express"; import route1 from "./routes/agents/clearMemory"; @@ -36,32 +36,33 @@ import route32 from "./routes/novel/updateNovel"; import route33 from "./routes/other/deleteAllData"; import route34 from "./routes/other/getCaptcha"; import route35 from "./routes/production/getProductionData"; -import route36 from "./routes/project/addProject"; -import route37 from "./routes/project/delProject"; -import route38 from "./routes/project/editProject"; -import route39 from "./routes/project/getProject"; -import route40 from "./routes/script/addScript"; -import route41 from "./routes/script/delScript"; -import route42 from "./routes/script/getScrptApi"; -import route43 from "./routes/script/updateScript"; -import route44 from "./routes/setting/agentDeploy/deployAgentModel"; -import route45 from "./routes/setting/agentDeploy/getAgentDeploy"; -import route46 from "./routes/setting/agentDeploy/updateKey"; -import route47 from "./routes/setting/dbConfig/clearData"; -import route48 from "./routes/setting/getTextModel"; -import route49 from "./routes/setting/loginConfig/getUser"; -import route50 from "./routes/setting/loginConfig/updateUserPwd"; -import route51 from "./routes/setting/memoryConfig/getMemory"; -import route52 from "./routes/setting/memoryConfig/sureMemory"; -import route53 from "./routes/setting/vendorConfig/addVendor"; -import route54 from "./routes/setting/vendorConfig/deleteVendor"; -import route55 from "./routes/setting/vendorConfig/getVendorList"; -import route56 from "./routes/setting/vendorConfig/modelTest"; -import route57 from "./routes/setting/vendorConfig/updateVendor"; -import route58 from "./routes/task/getMyTaskApi"; -import route59 from "./routes/task/getTaskCategories"; -import route60 from "./routes/task/taskDetails"; -import route61 from "./routes/test/test"; +import route36 from "./routes/production/workbench/getVideoModelDetail"; +import route37 from "./routes/project/addProject"; +import route38 from "./routes/project/delProject"; +import route39 from "./routes/project/editProject"; +import route40 from "./routes/project/getProject"; +import route41 from "./routes/script/addScript"; +import route42 from "./routes/script/delScript"; +import route43 from "./routes/script/getScrptApi"; +import route44 from "./routes/script/updateScript"; +import route45 from "./routes/setting/agentDeploy/deployAgentModel"; +import route46 from "./routes/setting/agentDeploy/getAgentDeploy"; +import route47 from "./routes/setting/agentDeploy/updateKey"; +import route48 from "./routes/setting/dbConfig/clearData"; +import route49 from "./routes/setting/getTextModel"; +import route50 from "./routes/setting/loginConfig/getUser"; +import route51 from "./routes/setting/loginConfig/updateUserPwd"; +import route52 from "./routes/setting/memoryConfig/getMemory"; +import route53 from "./routes/setting/memoryConfig/sureMemory"; +import route54 from "./routes/setting/vendorConfig/addVendor"; +import route55 from "./routes/setting/vendorConfig/deleteVendor"; +import route56 from "./routes/setting/vendorConfig/getVendorList"; +import route57 from "./routes/setting/vendorConfig/modelTest"; +import route58 from "./routes/setting/vendorConfig/updateVendor"; +import route59 from "./routes/task/getMyTaskApi"; +import route60 from "./routes/task/getTaskCategories"; +import route61 from "./routes/task/taskDetails"; +import route62 from "./routes/test/test"; export default async (app: Express) => { app.use("/api/agents/clearMemory", route1); @@ -99,30 +100,31 @@ export default async (app: Express) => { app.use("/api/other/deleteAllData", route33); app.use("/api/other/getCaptcha", route34); app.use("/api/production/getProductionData", route35); - app.use("/api/project/addProject", route36); - app.use("/api/project/delProject", route37); - app.use("/api/project/editProject", route38); - app.use("/api/project/getProject", route39); - app.use("/api/script/addScript", route40); - app.use("/api/script/delScript", route41); - app.use("/api/script/getScrptApi", route42); - app.use("/api/script/updateScript", route43); - app.use("/api/setting/agentDeploy/deployAgentModel", route44); - app.use("/api/setting/agentDeploy/getAgentDeploy", route45); - app.use("/api/setting/agentDeploy/updateKey", route46); - app.use("/api/setting/dbConfig/clearData", route47); - app.use("/api/setting/getTextModel", route48); - app.use("/api/setting/loginConfig/getUser", route49); - app.use("/api/setting/loginConfig/updateUserPwd", route50); - app.use("/api/setting/memoryConfig/getMemory", route51); - app.use("/api/setting/memoryConfig/sureMemory", route52); - app.use("/api/setting/vendorConfig/addVendor", route53); - app.use("/api/setting/vendorConfig/deleteVendor", route54); - app.use("/api/setting/vendorConfig/getVendorList", route55); - app.use("/api/setting/vendorConfig/modelTest", route56); - app.use("/api/setting/vendorConfig/updateVendor", route57); - app.use("/api/task/getMyTaskApi", route58); - app.use("/api/task/getTaskCategories", route59); - app.use("/api/task/taskDetails", route60); - app.use("/api/test/test", route61); + app.use("/api/production/workbench/getVideoModelDetail", route36); + app.use("/api/project/addProject", route37); + app.use("/api/project/delProject", route38); + app.use("/api/project/editProject", route39); + app.use("/api/project/getProject", route40); + app.use("/api/script/addScript", route41); + app.use("/api/script/delScript", route42); + app.use("/api/script/getScrptApi", route43); + app.use("/api/script/updateScript", route44); + app.use("/api/setting/agentDeploy/deployAgentModel", route45); + app.use("/api/setting/agentDeploy/getAgentDeploy", route46); + app.use("/api/setting/agentDeploy/updateKey", route47); + app.use("/api/setting/dbConfig/clearData", route48); + app.use("/api/setting/getTextModel", route49); + app.use("/api/setting/loginConfig/getUser", route50); + app.use("/api/setting/loginConfig/updateUserPwd", route51); + app.use("/api/setting/memoryConfig/getMemory", route52); + app.use("/api/setting/memoryConfig/sureMemory", route53); + app.use("/api/setting/vendorConfig/addVendor", route54); + app.use("/api/setting/vendorConfig/deleteVendor", route55); + app.use("/api/setting/vendorConfig/getVendorList", route56); + app.use("/api/setting/vendorConfig/modelTest", route57); + app.use("/api/setting/vendorConfig/updateVendor", route58); + app.use("/api/task/getMyTaskApi", route59); + app.use("/api/task/getTaskCategories", route60); + app.use("/api/task/taskDetails", route61); + app.use("/api/test/test", route62); } diff --git a/src/types/database.d.ts b/src/types/database.d.ts index 4c3b490..ffaa589 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -1,9 +1,9 @@ -// @db-hash feca77a2c2ec5b6a2989347f982558d5 +// @db-hash 2f9e6a9e9145cead00652858cafb9159 //该文件由脚本自动生成,请勿手动修改 export interface memories { 'content': string; - 'createTime': number; + 'createdAt': number; 'embedding'?: string | null; 'id'?: string; 'isolationKey': string;