139 lines
3.1 KiB
TypeScript
139 lines
3.1 KiB
TypeScript
import Realm, { ObjectSchema } from 'realm'
|
|
import { LoggerStatus, LoggerType } from '../../../enum/softwareEnum'
|
|
import { MJImageType, MJRobotType } from '../../../enum/mjEnum'
|
|
|
|
export class BrowserMJModel extends Realm.Object<BrowserMJModel> {
|
|
id: string
|
|
serviceId: string
|
|
channelId: string
|
|
mjBotId: string
|
|
nijBotId: string
|
|
token: string
|
|
userAgent: string
|
|
userAgentCustom: boolean
|
|
createTime: Date
|
|
updateTime: Date
|
|
version: string
|
|
static schema: ObjectSchema = {
|
|
name: 'BrowserMJ',
|
|
properties: {
|
|
id: 'string',
|
|
serviceId: 'string',
|
|
channelId: 'string',
|
|
mjBotId: 'string?',
|
|
nijBotId: 'string?',
|
|
token: 'string',
|
|
userAgent: 'string',
|
|
userAgentCustom: 'bool',
|
|
createTime: 'date',
|
|
updateTime: 'date',
|
|
version: 'string'
|
|
},
|
|
// 主键为_id
|
|
primaryKey: 'id'
|
|
}
|
|
}
|
|
|
|
export class RemoteMJModel extends Realm.Object<RemoteMJModel> {
|
|
id: string
|
|
accountId: string | null
|
|
channelId: string
|
|
coreSize: number
|
|
guildId: string
|
|
enable: boolean // 是否启用
|
|
mjBotChannelId: string | null
|
|
nijiBotChannelId: string | null
|
|
queueSize: number
|
|
remark: string
|
|
remixAutoSubmit: boolean
|
|
timeoutMinutes: number
|
|
userAgent: string
|
|
userToken: string
|
|
createTime: Date
|
|
updateTime: Date
|
|
version: string
|
|
static schema: ObjectSchema = {
|
|
name: 'RemoteMJ',
|
|
properties: {
|
|
id: 'string',
|
|
accountId: 'string?',
|
|
channelId: 'string',
|
|
coreSize: 'int',
|
|
guildId: 'string',
|
|
enable: 'bool',
|
|
mjBotChannelId: 'string?',
|
|
nijiBotChannelId: 'string?',
|
|
queueSize: 'int',
|
|
remark: 'string',
|
|
remixAutoSubmit: 'bool',
|
|
timeoutMinutes: 'int',
|
|
userAgent: 'string',
|
|
userToken: 'string',
|
|
createTime: 'date',
|
|
updateTime: 'date',
|
|
version: 'string'
|
|
},
|
|
// 主键为_id
|
|
primaryKey: 'id'
|
|
}
|
|
}
|
|
|
|
export class APIMjModel extends Realm.Object<APIMjModel> {
|
|
id: string
|
|
mjApiUrl: string
|
|
mjSpeed: string // MJ出图的速度模式
|
|
apiKey: string
|
|
createTime: Date
|
|
updateTime: Date
|
|
version: string
|
|
static schema: ObjectSchema = {
|
|
name: 'APIMj',
|
|
properties: {
|
|
id: 'string',
|
|
mjApiUrl: 'string',
|
|
mjSpeed: 'string',
|
|
apiKey: 'string',
|
|
createTime: 'date',
|
|
updateTime: 'date',
|
|
version: 'string'
|
|
},
|
|
// 主键为_id
|
|
primaryKey: 'id'
|
|
}
|
|
}
|
|
|
|
export class MjSettingModel extends Realm.Object<MjSettingModel> {
|
|
id: string
|
|
type: MJImageType
|
|
requestModel: MJImageType
|
|
selectRobot: MJRobotType
|
|
imageScale: string
|
|
imageModel: string
|
|
imageSuffix: string
|
|
taskCount: number
|
|
spaceTime: number
|
|
createTime: Date
|
|
updateTime: Date
|
|
version: string
|
|
|
|
static schema: ObjectSchema = {
|
|
name: 'MjSetting',
|
|
properties: {
|
|
id: 'string',
|
|
type: 'string',
|
|
requestModel: 'string',
|
|
selectRobot: 'string',
|
|
imageScale: 'string',
|
|
imageModel: 'string',
|
|
imageSuffix: 'string',
|
|
taskCount: 'int',
|
|
spaceTime: 'int',
|
|
createTime: 'date',
|
|
updateTime: 'date',
|
|
version: 'string'
|
|
},
|
|
// 主键为_id
|
|
primaryKey: 'id'
|
|
}
|
|
}
|