39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import Realm, { ObjectSchema } from 'realm'
|
|
import { BookBackTaskStatus, BookBackTaskType, TaskExecuteType } from '../../../enum/bookEnum'
|
|
|
|
export class BookBackTaskList extends Realm.Object<BookBackTaskList> {
|
|
id: string
|
|
bookId: string
|
|
bookTaskId: string
|
|
bookTaskDetailId: string
|
|
name: string // 任务名称,小说名+批次名+分镜名
|
|
type: BookBackTaskType
|
|
status: BookBackTaskStatus
|
|
errorMessage: string | null
|
|
executeType: TaskExecuteType // 任务执行类型,手动还是自动
|
|
createTime: Date
|
|
updateTime: Date
|
|
startTime: number
|
|
endTime: number
|
|
|
|
static schema: ObjectSchema = {
|
|
name: 'BookBackTaskList',
|
|
properties: {
|
|
id: 'string',
|
|
bookId: { type: 'string', indexed: true },
|
|
bookTaskId: { type: 'string', indexed: true },
|
|
bookTaskDetailId: { type: 'string', indexed: true },
|
|
name: 'string',
|
|
type: 'string',
|
|
status: 'string',
|
|
errorMessage: 'string?',
|
|
executeType: { type: 'string', default: TaskExecuteType.AUTO },
|
|
createTime: 'date',
|
|
updateTime: 'date',
|
|
startTime: 'int',
|
|
endTime: 'int'
|
|
},
|
|
primaryKey: 'id'
|
|
}
|
|
}
|