Files
LaiTool/src/define/db/model/Book/book.ts
T

40 lines
900 B
TypeScript
Raw Normal View History

2024-06-24 13:11:19 +08:00
import Realm, { ObjectSchema } from 'realm'
import { BookType } from '../../../enum/bookEnum'
export class BookModel extends Realm.Object<BookModel> {
id: string
no: number
name: string
bookFolderPath: string
imageFolder: string | null
type: BookType
oldVideoPath: string | null
srtPath: string | null
audioPath: string | null
updateTime: Date
createTime: Date
2024-07-13 15:44:13 +08:00
version: string
subtitlePosition: string | null
2024-06-24 13:11:19 +08:00
static schema: ObjectSchema = {
name: 'Book',
properties: {
id: 'string',
no: 'int',
name: 'string',
bookFolderPath: 'string',
type: 'string',
oldVideoPath: 'string?',
srtPath: 'string?',
audioPath: 'string?',
imageFolder: 'string?',
updateTime: 'date',
createTime: 'date',
2024-07-13 15:44:13 +08:00
version: 'string',
subtitlePosition: 'string?'
2024-06-24 13:11:19 +08:00
},
// 主键为_id
primaryKey: 'id'
}
}