2026-05-29 15:10:14 +08:00
|
|
|
import type { ReqPage, ResPage } from '@/api/interface'
|
|
|
|
|
|
|
|
|
|
export namespace Dbms {
|
|
|
|
|
export type DbType = 'ORACLE' | 'MYSQL'
|
|
|
|
|
export type ConnectType = 'SERVICE_NAME' | 'SID'
|
|
|
|
|
export type BackupStrategy = 'DATA_PUMP' | 'JDBC_EXPORT'
|
|
|
|
|
export type BackupMode = 'FULL_TABLE' | 'TIME_RANGE' | 'SIZE_SPLIT'
|
|
|
|
|
export type OperationType = 'BACKUP' | 'RESTORE'
|
|
|
|
|
export type TaskStatus = 'WAITING' | 'RUNNING' | 'SUCCESS' | 'FAIL' | 'FAILED' | 'CANCELLED'
|
|
|
|
|
export type RestoreMode = 'SKIP' | 'APPEND' | 'TRUNCATE' | 'REPLACE'
|
|
|
|
|
|
|
|
|
|
export interface Overview {
|
|
|
|
|
menuName: string
|
|
|
|
|
menuCode: string
|
|
|
|
|
path: string
|
|
|
|
|
status: string
|
|
|
|
|
description: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ConnectionListParams extends ReqPage {
|
|
|
|
|
connectionName?: string
|
|
|
|
|
dbType?: DbType
|
|
|
|
|
schemaName?: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ConnectionRecord {
|
|
|
|
|
id: string
|
|
|
|
|
connectionName: string
|
|
|
|
|
dbType: DbType
|
|
|
|
|
host: string
|
|
|
|
|
port: number
|
2026-06-09 13:16:11 +08:00
|
|
|
connectType?: ConnectType | null
|
2026-05-29 15:10:14 +08:00
|
|
|
serviceName?: string | null
|
|
|
|
|
sid?: string | null
|
2026-06-09 13:16:11 +08:00
|
|
|
databaseName?: string | null
|
2026-05-29 15:10:14 +08:00
|
|
|
schemaName?: string | null
|
|
|
|
|
username: string
|
|
|
|
|
savePassword: 0 | 1
|
|
|
|
|
directoryName?: string | null
|
|
|
|
|
directoryPath?: string | null
|
|
|
|
|
extraConfigJson?: string | null
|
|
|
|
|
remark?: string | null
|
|
|
|
|
lastTestStatus?: string | null
|
|
|
|
|
lastTestMessage?: string | null
|
|
|
|
|
lastTestTime?: string | null
|
|
|
|
|
state?: number
|
|
|
|
|
createTime?: string
|
|
|
|
|
updateTime?: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ConnectionPayload {
|
|
|
|
|
id?: string
|
|
|
|
|
connectionName: string
|
|
|
|
|
dbType: DbType
|
|
|
|
|
host: string
|
|
|
|
|
port: number
|
2026-06-09 13:16:11 +08:00
|
|
|
connectType?: ConnectType | null
|
2026-05-29 15:10:14 +08:00
|
|
|
serviceName?: string | null
|
|
|
|
|
sid?: string | null
|
2026-06-09 13:16:11 +08:00
|
|
|
databaseName?: string | null
|
2026-05-29 15:10:14 +08:00
|
|
|
schemaName?: string | null
|
|
|
|
|
username: string
|
|
|
|
|
password?: string | null
|
|
|
|
|
savePassword: 0 | 1
|
|
|
|
|
directoryName?: string | null
|
|
|
|
|
directoryPath?: string | null
|
|
|
|
|
extraConfigJson?: string | null
|
|
|
|
|
remark?: string | null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface DeleteConnectionParams {
|
|
|
|
|
id: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface TestConnectionParams {
|
|
|
|
|
connectionId?: string
|
|
|
|
|
connection?: ConnectionPayload
|
|
|
|
|
temporaryPassword?: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface TestConnectionResult {
|
|
|
|
|
success: boolean
|
|
|
|
|
message: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface TableListParams {
|
|
|
|
|
connectionId: string
|
|
|
|
|
temporaryPassword?: string
|
|
|
|
|
schemaName?: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface TableRecord {
|
|
|
|
|
owner: string
|
|
|
|
|
tableName: string
|
2026-06-09 13:16:11 +08:00
|
|
|
autoIncrement?: number | string | null
|
|
|
|
|
updateTime?: string | null
|
|
|
|
|
dataLength?: number | string | null
|
|
|
|
|
engine?: string | null
|
|
|
|
|
tableRows?: number | string | null
|
2026-05-29 15:10:14 +08:00
|
|
|
comments?: string | null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface CreateBackupParams {
|
|
|
|
|
connectionId: string
|
|
|
|
|
backupStrategy?: BackupStrategy
|
|
|
|
|
schemaName?: string
|
|
|
|
|
targetNames?: string[]
|
|
|
|
|
backupMode?: BackupMode
|
|
|
|
|
timeColumn?: string | null
|
|
|
|
|
startTime?: string | null
|
|
|
|
|
endTime?: string | null
|
|
|
|
|
maxFileSizeMb?: number | null
|
|
|
|
|
directoryName?: string | null
|
|
|
|
|
temporaryPassword?: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface CreateRestoreParams {
|
|
|
|
|
connectionId: string
|
|
|
|
|
backupFileId: string
|
|
|
|
|
restoreMode?: RestoreMode
|
|
|
|
|
targetSchemaName?: string
|
|
|
|
|
temporaryPassword?: string
|
|
|
|
|
overwriteConfirmText?: string | null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface TaskCreateResult {
|
|
|
|
|
taskId: string
|
|
|
|
|
taskNo: string
|
|
|
|
|
taskStatus: TaskStatus
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-09 13:16:11 +08:00
|
|
|
export interface StopBackupTaskParams {
|
|
|
|
|
taskId: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface RestartBackupTaskParams {
|
|
|
|
|
taskId: string
|
|
|
|
|
temporaryPassword?: string
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-29 15:10:14 +08:00
|
|
|
export interface TaskListParams extends ReqPage {
|
|
|
|
|
connectionId?: string
|
|
|
|
|
taskStatus?: TaskStatus | ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface TaskRecord {
|
|
|
|
|
id: string
|
|
|
|
|
taskNo: string
|
|
|
|
|
connectionId: string
|
|
|
|
|
dbType: DbType
|
|
|
|
|
operationType: OperationType
|
|
|
|
|
backupStrategy?: BackupStrategy | null
|
2026-06-09 13:16:11 +08:00
|
|
|
restoreMode?: RestoreMode | null
|
2026-05-29 15:10:14 +08:00
|
|
|
taskStatus: TaskStatus
|
|
|
|
|
schemaName?: string | null
|
|
|
|
|
targetNamesJson?: string | null
|
|
|
|
|
resultMessage?: string | null
|
|
|
|
|
progressPercent?: number | null
|
|
|
|
|
startedAt?: string | null
|
|
|
|
|
finishedAt?: string | null
|
|
|
|
|
createTime?: string
|
|
|
|
|
updateTime?: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface FileListParams extends ReqPage {
|
|
|
|
|
connectionId?: string
|
|
|
|
|
taskId?: string
|
|
|
|
|
backupStrategy?: BackupStrategy | ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface BackupFileRecord {
|
|
|
|
|
id: string
|
|
|
|
|
taskId: string
|
|
|
|
|
connectionId: string
|
|
|
|
|
dbType: DbType
|
|
|
|
|
backupStrategy: BackupStrategy
|
|
|
|
|
fileFormat?: string | null
|
|
|
|
|
schemaName?: string | null
|
|
|
|
|
targetNamesJson?: string | null
|
|
|
|
|
backupMode?: BackupMode | null
|
|
|
|
|
fileName: string
|
|
|
|
|
filePath?: string | null
|
2026-06-09 13:16:11 +08:00
|
|
|
metadataFilePath?: string | null
|
2026-05-29 15:10:14 +08:00
|
|
|
logFileName?: string | null
|
|
|
|
|
logFilePath?: string | null
|
|
|
|
|
fileSize?: number | null
|
|
|
|
|
checksum?: string | null
|
|
|
|
|
state?: number
|
|
|
|
|
createTime?: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface DeleteBackupFileParams {
|
|
|
|
|
backupFileId: string
|
|
|
|
|
confirmText: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface DeleteTaskParams {
|
|
|
|
|
taskId: string
|
|
|
|
|
confirmText: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ConnectionPageData extends ResPage<ConnectionRecord> {}
|
|
|
|
|
export interface TaskPageData extends ResPage<TaskRecord> {}
|
|
|
|
|
export interface BackupFilePageData extends ResPage<BackupFileRecord> {}
|
|
|
|
|
}
|