2024-08-03 12:46:12 +08:00
|
|
|
import { ipcRenderer } from 'electron'
|
|
|
|
|
import { DEFINE_STRING } from '../define/define_string'
|
2024-11-09 16:46:06 +08:00
|
|
|
import { Book } from '../model/book/book'
|
2024-08-03 12:46:12 +08:00
|
|
|
|
|
|
|
|
const db = {
|
|
|
|
|
//#region 小说相关的修改
|
|
|
|
|
|
2024-08-08 16:24:47 +08:00
|
|
|
// 修改小说数据
|
|
|
|
|
UpdateBookData: async (bookId: string, data: Book.SelectBook) => {
|
|
|
|
|
return await ipcRenderer.invoke(DEFINE_STRING.DB.UPDATE_BOOK_DATA, bookId, data)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 修改小说任务的数据
|
2024-08-03 12:46:12 +08:00
|
|
|
UpdateBookTaskData: async (bookTaskId: string, data: Book.SelectBookTask) => {
|
|
|
|
|
return await ipcRenderer.invoke(DEFINE_STRING.DB.UPDATE_BOOK_TASK_DATA, bookTaskId, data)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 修改小说详细任务的数据
|
|
|
|
|
UpdateBookTaskDetailData: async (bookTaskDetailId: string, data: Book.SelectBookTaskDetail) => {
|
|
|
|
|
return await ipcRenderer.invoke(DEFINE_STRING.DB.UPDATE_BOOK_TASK_DETAIL_DATA, bookTaskDetailId, data)
|
2024-09-12 14:13:09 +08:00
|
|
|
},
|
2024-08-03 12:46:12 +08:00
|
|
|
|
|
|
|
|
//endregion
|
2024-09-12 14:13:09 +08:00
|
|
|
|
|
|
|
|
//#region 软件设置的修改
|
|
|
|
|
|
|
|
|
|
// 修改软件通用设置
|
|
|
|
|
UpdateSoftwareSetting: async (software: SoftwareSettingModel.SoftwareSetting) => {
|
|
|
|
|
return await ipcRenderer.invoke(DEFINE_STRING.DB.UPDATE_SOFTWARE_SETTING, software)
|
|
|
|
|
},
|
2024-08-03 12:46:12 +08:00
|
|
|
}
|
2024-09-12 14:13:09 +08:00
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
2024-08-03 12:46:12 +08:00
|
|
|
export { db }
|