LaiTool_PRO/src/define/db/model/taskList.ts

45 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Realm, { ObjectSchema } from 'realm'
import { BookBackTaskStatus, BookBackTaskType, TaskExecuteType } from '@/define/enum/bookEnum'
export class TaskListModel extends Realm.Object<TaskListModel> {
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'
}
}