增加表结构
This commit is contained in:
parent
16274e7957
commit
ea84c548e7
@ -493,6 +493,7 @@ description: 专注于从剧本内容中提取所使用的资产(角色、场
|
|||||||
table.text("sound");
|
table.text("sound");
|
||||||
table.text("lines");
|
table.text("lines");
|
||||||
table.text("state");
|
table.text("state");
|
||||||
|
table.text("group");
|
||||||
table.text("reason");
|
table.text("reason");
|
||||||
table.integer("index");
|
table.integer("index");
|
||||||
table.integer("createTime");
|
table.integer("createTime");
|
||||||
|
|||||||
@ -12,6 +12,7 @@ export default router.post(
|
|||||||
"/",
|
"/",
|
||||||
validateFields({
|
validateFields({
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
|
title: z.string(),
|
||||||
images: z.array(z.string()),
|
images: z.array(z.string()),
|
||||||
data: z.array(
|
data: z.array(
|
||||||
z.object({
|
z.object({
|
||||||
@ -23,8 +24,9 @@ export default router.post(
|
|||||||
}),
|
}),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const { name, images, data } = req.body as {
|
const { name, title, images, data } = req.body as {
|
||||||
name: string;
|
name: string;
|
||||||
|
title: string;
|
||||||
images: string[];
|
images: string[];
|
||||||
data: { label: string; value: string; data: string }[];
|
data: { label: string; value: string; data: string }[];
|
||||||
};
|
};
|
||||||
@ -72,7 +74,8 @@ export default router.post(
|
|||||||
if (!fs.existsSync(fileDir)) {
|
if (!fs.existsSync(fileDir)) {
|
||||||
fs.mkdirSync(fileDir, { recursive: true });
|
fs.mkdirSync(fileDir, { recursive: true });
|
||||||
}
|
}
|
||||||
fs.writeFileSync(filePath, item.data, "utf-8");
|
const content = item.value === "README" ? `# ${title}\n${item.data}` : item.data;
|
||||||
|
fs.writeFileSync(filePath, content, "utf-8");
|
||||||
}
|
}
|
||||||
const ossImagesDir = u.getPath(["oss", name]);
|
const ossImagesDir = u.getPath(["oss", name]);
|
||||||
|
|
||||||
|
|||||||
@ -205,7 +205,7 @@ export default router.post(
|
|||||||
try {
|
try {
|
||||||
const data = await u.db("o_prompt").where("type", "scriptAssetExtraction").first("data");
|
const data = await u.db("o_prompt").where("type", "scriptAssetExtraction").first("data");
|
||||||
const existingHint = existingAssetsList
|
const existingHint = existingAssetsList
|
||||||
? `\n\n【已有资产列表】:${existingAssetsList}\n对于已有资产,如果在剧本中出现,只需在 existingAssetRefs 中给出资产名称和对应的 scriptIds 数组即可,无需重复生成 prompt/desc/type。对于新发现的资产(不在已有列表中),请在 newAssets 中给出完整信息。`
|
? `\n\n【已有资产列表】:${existingAssetsList}\n对于已有资产,如果在剧本中出现,只需在 existingAssetRefs 中给出资产名称和对应的 scriptIds 数组即可,无需重复生成 desc/type。对于新发现的资产(不在已有列表中),请在 newAssets 中给出完整信息。`
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
const output = await intansce.invoke({
|
const output = await intansce.invoke({
|
||||||
|
|||||||
5
src/types/database.d.ts
vendored
5
src/types/database.d.ts
vendored
@ -1,4 +1,4 @@
|
|||||||
// @db-hash 93b2462070c45c2b449e9a18c4e88763
|
// @db-hash d1fbadf1691063f5a730337685fd85b1
|
||||||
//该文件由脚本自动生成,请勿手动修改
|
//该文件由脚本自动生成,请勿手动修改
|
||||||
|
|
||||||
export interface memories {
|
export interface memories {
|
||||||
@ -73,6 +73,7 @@ export interface o_image {
|
|||||||
'filePath'?: string | null;
|
'filePath'?: string | null;
|
||||||
'id'?: number;
|
'id'?: number;
|
||||||
'model'?: string | null;
|
'model'?: string | null;
|
||||||
|
'reason'?: string | null;
|
||||||
'resolution'?: string | null;
|
'resolution'?: string | null;
|
||||||
'state'?: string | null;
|
'state'?: string | null;
|
||||||
'type'?: string | null;
|
'type'?: string | null;
|
||||||
@ -178,6 +179,7 @@ export interface o_storyboard {
|
|||||||
'sound'?: string | null;
|
'sound'?: string | null;
|
||||||
'state'?: string | null;
|
'state'?: string | null;
|
||||||
'title'?: string | null;
|
'title'?: string | null;
|
||||||
|
'videoPrompt'?: string | null;
|
||||||
}
|
}
|
||||||
export interface o_tasks {
|
export interface o_tasks {
|
||||||
'describe'?: string | null;
|
'describe'?: string | null;
|
||||||
@ -211,6 +213,7 @@ export interface o_video {
|
|||||||
'errorReason'?: string | null;
|
'errorReason'?: string | null;
|
||||||
'filePath'?: string | null;
|
'filePath'?: string | null;
|
||||||
'id'?: number;
|
'id'?: number;
|
||||||
|
'projectId'?: number | null;
|
||||||
'scriptId'?: number | null;
|
'scriptId'?: number | null;
|
||||||
'state'?: string | null;
|
'state'?: string | null;
|
||||||
'storyboardId'?: number | null;
|
'storyboardId'?: number | null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user