LaiTool/src/define/db/service/Book/bookTaskDetailService.ts

48 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-06-24 13:11:19 +08:00
import Realm from 'realm'
import path from 'path'
import { BaseService } from '../baseService.js'
import { define } from '../../../define.js'
import { BookTaskModel } from '../../model/Book/bookTask.js'
import { BookTaskStatus } from '../../../enum/bookEnum.js'
import { successMessage } from '../../../../main/generalTools.js'
import { BaseRealmService } from './bookBasic'
const { v4: uuidv4 } = require('uuid')
let dbPath = path.resolve(define.db_path, 'book.realm')
// 版本迁移
const migration = (oldRealm: Realm, newRealm: Realm) => {}
export class BookTaskDetailService extends BaseRealmService {
static instance: BookTaskDetailService | null = null
realm: Realm
private constructor() {
super()
}
/**
*
* @returns
*/
public static async getInstance() {
if (BookTaskDetailService.instance === null) {
BookTaskDetailService.instance = new BookTaskDetailService()
await super.getInstance()
}
return BookTaskDetailService.instance
}
/**
*
* @param BookTaskDetail
*/
public async AddBookTaskDetail(BookTaskDetail) {
try {
// 判断是不是又小说的ID
} catch (error) {
throw error
}
}
}