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 connectType: ConnectType serviceName?: string | null sid?: string | null 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 connectType: ConnectType serviceName?: string | null sid?: string | null 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 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 } 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 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 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 {} export interface TaskPageData extends ResPage {} export interface BackupFilePageData extends ResPage {} }