LaiTool/src/define/db/model/Book/BookBackTaskListModel.ts

35 lines
1.0 KiB
TypeScript
Raw Normal View History

2024-06-24 13:11:19 +08:00
import Realm, { ObjectSchema } from 'realm'
2024-07-13 15:44:13 +08:00
import { BookBackTaskStatus, BookBackTaskType, TaskExecuteType } from '../../../enum/bookEnum'
2024-06-24 13:11:19 +08:00
export class BookBackTaskList extends Realm.Object<BookBackTaskList> {
id: string
bookId: string
bookTaskId: string
2024-07-13 15:44:13 +08:00
bookTaskDetailId: string
2024-06-27 16:24:41 +08:00
name: string // 任务名称,小说名+批次名+分镜名
2024-06-24 13:11:19 +08:00
type: BookBackTaskType
status: BookBackTaskStatus
2024-07-13 15:44:13 +08:00
errorMessage: string | null
executeType: TaskExecuteType // 任务执行类型,手动还是自动
2024-06-24 13:11:19 +08:00
createTime: Date
updateTime: Date
static schema: ObjectSchema = {
name: 'BookBackTaskList',
properties: {
id: 'string',
bookId: { type: 'string', indexed: true },
bookTaskId: { type: 'string', indexed: true },
2024-07-13 15:44:13 +08:00
bookTaskDetailId: { type: 'string', indexed: true },
2024-06-24 13:11:19 +08:00
name: 'string',
type: 'string',
status: 'string',
2024-07-13 15:44:13 +08:00
errorMessage: 'string?',
executeType: { type: 'string', default: TaskExecuteType.AUTO },
2024-06-24 13:11:19 +08:00
createTime: 'date',
updateTime: 'date'
},
primaryKey: 'id'
}
}