V 3.2.3
1.优化文案处理逻辑,重构界面 2.修复批量导出草稿只能导出一个的bug 3.添加自动 推理人物 场景 方便快速生成标签 4.(聚合推文) 修复删除数据bug 5.新增推理国内转发接口(包括翻译) 6.新增文案导入时导入SRT后可手动校验一遍时间数据,简化简单过程 7.语音服务那边添加字符不生效,格式化不生效 8.优化语音服务(数据结构优化,可设置合成超时时间)
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
*/
|
||||
export function ValidateJson(str: string): boolean {
|
||||
try {
|
||||
if (str == null) {
|
||||
return false;
|
||||
}
|
||||
JSON.parse(str);
|
||||
return true
|
||||
} catch (e) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import { OtherData } from '../../../enum/softwareEnum.js'
|
||||
import { BookBackTaskList } from '../../model/Book/BookBackTaskListModel.js'
|
||||
import { Book } from '../../../../model/book/book.js'
|
||||
import { GeneralResponse } from '../../../../model/generalResponse.js'
|
||||
import { TaskModal } from '@/model/task.js'
|
||||
const { v4: uuidv4 } = require('uuid')
|
||||
|
||||
export class BookBackTaskListService extends BaseRealmService {
|
||||
|
||||
@@ -232,7 +232,8 @@ export class BookService extends BaseRealmService {
|
||||
updateTime: new Date(),
|
||||
createTime: new Date(),
|
||||
version: version,
|
||||
imageCategory: imageCategory
|
||||
imageCategory: imageCategory,
|
||||
openVideoGenerate: false
|
||||
}
|
||||
|
||||
// 添加任务
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
import Realm from 'realm'
|
||||
import { isEmpty, cloneDeep } from 'lodash'
|
||||
import { OptionType } from '@/define/enum/option'
|
||||
import { BaseSoftWareService } from './softwareBasic'
|
||||
import { OptionModel } from '@/model/option/option'
|
||||
|
||||
export class OptionRealmService extends BaseSoftWareService {
|
||||
static instance: OptionRealmService | null = null
|
||||
declare realm: Realm
|
||||
private constructor() {
|
||||
super()
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前实例对象,为空则创建一个新的
|
||||
* @returns
|
||||
*/
|
||||
public static async getInstance() {
|
||||
if (OptionRealmService.instance === null) {
|
||||
OptionRealmService.instance = new OptionRealmService()
|
||||
await super.getInstance()
|
||||
}
|
||||
await OptionRealmService.instance.open()
|
||||
return OptionRealmService.instance
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定的Option,通过key,不存在返回null
|
||||
* @param key
|
||||
* @returns
|
||||
*/
|
||||
public GetOptionByKey(key: string): OptionModel.OptionItem | null {
|
||||
if (isEmpty(key)) {
|
||||
return null
|
||||
}
|
||||
let res = this.realm.objects('Options').filtered(`key = "${key}"`);
|
||||
|
||||
if (res.length > 0) {
|
||||
let resData = Array.from(res).map((item) => {
|
||||
let resObj = {
|
||||
...item
|
||||
}
|
||||
return cloneDeep(resObj)
|
||||
})
|
||||
return resData[0] as OptionModel.OptionItem
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改指定的Option,通过key,不存在则创建
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
public ModifyOptionByKey(key: string, value: string, type: OptionType = OptionType.STRING) {
|
||||
if (isEmpty(key)) {
|
||||
return false
|
||||
}
|
||||
let option = this.realm.objectForPrimaryKey('Options', key);
|
||||
if (option) {
|
||||
this.realm.write(() => {
|
||||
option.value = value;
|
||||
option.type = type;
|
||||
})
|
||||
} else {
|
||||
this.realm.write(() => {
|
||||
this.realm.create('Options', {
|
||||
key: key,
|
||||
value: value,
|
||||
type: type
|
||||
})
|
||||
})
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import SETTING from "./settingDefineString"
|
||||
import BOOK from "./bookDefineString"
|
||||
import WRITE from "./writeDefineString"
|
||||
import DB from "./dbDefineString"
|
||||
import OPTIONS from "./optionsDefineString"
|
||||
|
||||
export const DEFINE_STRING = {
|
||||
SYSTEM: SYSTEM,
|
||||
@@ -14,6 +15,7 @@ export const DEFINE_STRING = {
|
||||
SETTING: SETTING,
|
||||
WRITE: WRITE,
|
||||
DB: DB,
|
||||
OPTIONS:OPTIONS,
|
||||
SHOW_GLOBAL_MESSAGE: "SHOW_GLOBAL_MESSAGE",
|
||||
SHOW_GLOBAL_MAIN_NOTIFICATION: 'SHOW_GLOBAL_MAIN_NOTIFICATION',
|
||||
OPEN_DEV_TOOLS_PASSWORD: 'OPEN_DEV_TOOLS_PASSWORD',
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
const OPTIONS = {
|
||||
|
||||
/**
|
||||
* 获取指定的Option,通过key,不存在返回null
|
||||
*/
|
||||
GET_OPTION_BY_KEY: 'GET_OPTION_BY_KEY',
|
||||
|
||||
/**
|
||||
* 修改指定的Option,通过key,不存在则创建
|
||||
*/
|
||||
MODIFY_OPTION_BY_KEY: 'MODIFY_OPTION_BY_KEY',
|
||||
|
||||
/**
|
||||
* 同步文案处理中的AI设置旧数据到新的数据表中
|
||||
*/
|
||||
INIT_COPY_WRITING_AI_SETTING: "INIT_COPY_WRITING_AI_SETTING"
|
||||
}
|
||||
|
||||
export default OPTIONS
|
||||
@@ -1,7 +1,6 @@
|
||||
const WRITE = {
|
||||
GET_WRITE_CONFIG: 'GET_WRITE_CONFIG',
|
||||
SAVE_WRITE_CONFIG: 'SAVE_WRITE_CONFIG',
|
||||
ACTION_START: 'ACTION_START',
|
||||
GET_SUBTITLE_SETTING: "GET_SUBTITLE_SETTING",
|
||||
RESET_SUBTITLE_SETTING: "RESET_SUBTITLE_SETTING",
|
||||
SAVE_SUBTITLE_SETTING: "SAVE_SUBTITLE_SETTING",
|
||||
@@ -9,7 +8,16 @@ const WRITE = {
|
||||
/** 生成洗稿后文案 */
|
||||
GENERATE_AFTER_GPT_WORD: "GENERATE_AFTER_GPT_WORD",
|
||||
/** 生成洗稿后文案返回数据,前端接收 */
|
||||
GENERATE_AFTER_GPT_WORD_RESPONSE: "GENERATE_AFTER_GPT_WORD_RESPONSE"
|
||||
GENERATE_AFTER_GPT_WORD_RESPONSE: "GENERATE_AFTER_GPT_WORD_RESPONSE",
|
||||
|
||||
//#region 文案改写
|
||||
|
||||
/**
|
||||
* AI处理文案
|
||||
*/
|
||||
COPY_WRITING_AI_GENERATION: "COPY_WRITING_AI_GENERATION",
|
||||
|
||||
//#endregion
|
||||
}
|
||||
|
||||
export default WRITE
|
||||
@@ -1,7 +1,40 @@
|
||||
/** option 中的type的类型 */
|
||||
/**
|
||||
* Option Value的数据类型,用于数据的格式化
|
||||
*/
|
||||
export enum OptionType {
|
||||
STRING = 'string',
|
||||
NUMBER = 'number',
|
||||
BOOLEAN = 'boolean',
|
||||
JOSN = 'json'
|
||||
}
|
||||
|
||||
export enum OptionKeyName {
|
||||
|
||||
//#region 文案处理
|
||||
|
||||
/**
|
||||
* 文案处理的AI设置
|
||||
*/
|
||||
CW_AISetting = 'CW_AISetting',
|
||||
|
||||
/**
|
||||
* 文案处理数据界面数据
|
||||
*/
|
||||
CW_AISimpleSetting = 'CW_AISimpleSetting',
|
||||
|
||||
/**
|
||||
* 格式化的特殊字符数据
|
||||
*/
|
||||
CW_FormatSpecialChar = 'CW_FormatSpecialChar',
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region TTS
|
||||
|
||||
/**
|
||||
* TTS界面视图数据
|
||||
*/
|
||||
TTS_GlobalSetting = 'TTS_GlobalSetting',
|
||||
|
||||
//#endregion
|
||||
}
|
||||
+14
-1
@@ -8,7 +8,20 @@ import { apiUrl } from './api/apiUrlDefine'
|
||||
export const gptDefine = {
|
||||
// Add properties and methods to the shared object
|
||||
characterSystemContent: `{textContent}\r查看上面的文本,然后扮演一个文本编辑来回答问题。`,
|
||||
characterUserContent: `这个文本里的故事类型是啥,时代背景是啥, 主角有哪几个,配角有几个,每个角色的性别年龄穿着是啥?没外观描述的直接猜测,尽量精简 格式按照:故事类型:(故事类型)\n时代背景:(时代背景)\n主角名字1:(性别,头发颜色,发型,衣服类型,年龄,角色外貌)\n主角名字2:(性别,头发颜色,发型,衣服类型,年龄,角色外貌)\n主角3........\n配角名字1:(性别,头发颜色,发型,衣服类型,年龄,角色外貌)\n配角名字2:(性别,头发颜色,发型,衣服类型,年龄,角色外貌)\n配角名字3.... ,不知道的直接猜测设定,不能出不详和未知这两个词,150字内,中文回答。`,
|
||||
characterUserContent: `这个文本里的故事类型是什么,时代背景是什么, 上面文本中存在哪些场景,主角有哪几个,配角有几个,每个角色的性别年龄穿着是啥?没外观描述的直接猜测,尽量精简
|
||||
格式按照:
|
||||
故事类型:(故事类型)
|
||||
时代背景:(时代背景)
|
||||
主角名字1:(性别,头发颜色,发型,衣服类型,年龄,角色外貌,若未提及则合理推测)
|
||||
主角名字2:(性别,头发颜色,发型,衣服类型,年龄,角色外貌,若未提及则合理推测)
|
||||
主角3........
|
||||
配角名字1:(性别,头发颜色,发型,衣服类型,年龄,角色外貌,若未提及则合理推测)
|
||||
配角名字2:(性别,头发颜色,发型,衣服类型,年龄,角色外貌,若未提及则合理推测)
|
||||
配角名字3.... ,
|
||||
场景1:(地点,环境状况,光线条件,氛围特点,所处时间,若无明确信息则合理推测)
|
||||
场景2:(地点,环境状况,光线条件,氛围特点,所处时间,若无明确信息则合理推测)
|
||||
场景3......
|
||||
不知道的直接猜测设定,不能出不详和未知这两个词,250字内,中文回答。`,
|
||||
|
||||
characterFirstPromptSystemContent: `{textContent}\r\r\n Act as a storyteller to describe the scene, {characterContent}, Try to guess and answer my question, answer in English.`,
|
||||
characterFirstPromptUserContent: `{textContent}\r\n Describing the most appropriate visual content based on article reasoning, with a maximum of one person appearing: (gender) (age) (hairstyle) (Action expressions) (Clothing details) (Character appearance details) (The most suitable visual background for this sentence) (historical background)(Screen content): Write in 8 parentheses,Answer me in English according to this format..{wordCount}words`,
|
||||
|
||||
Reference in New Issue
Block a user