import Realm, { ObjectSchema } from 'realm' import { BookBackTaskStatus, BookBackTaskType, TaskExecuteType } from '@/define/enum/bookEnum' export class TaskListModel extends Realm.Object { 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 messageName?: string taskId?: string // 任务ID,可能是视频生成任务的ID taskMessage?: string // 任务消息,可能是视频生成任务的消息 static schema: ObjectSchema = { name: 'TaskList', 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', messageName: 'string?', taskId: 'string?', // 任务ID,可能是视频生成任务的ID taskMessage: 'string?' // 任务消息,可能是视频生成任务的消息 }, primaryKey: 'id' } }