🚧 Refactor backup service

This commit is contained in:
2025-12-14 23:48:52 +08:00
parent cc4c2189dc
commit 67d35626cb
47 changed files with 2184 additions and 489 deletions

View File

@@ -19,37 +19,45 @@ export class Document {
"id"?: number;
/**
* 创建时间
* UUID for cross-device sync (UUIDv7)
*/
"uuid": string;
/**
* creation time
*/
"created_at": string;
/**
* 最后更新时间
* update time
*/
"updated_at": string;
/**
* 删除时间NULL表示未删除
* deleted at
*/
"deleted_at"?: string | null;
/**
* 文档标题
* document title
*/
"title": string;
/**
* 文档内容
* document content
*/
"content": string;
/**
* 是否锁定
* document locked status
*/
"locked": boolean;
/** Creates a new Document instance. */
constructor($$source: Partial<Document> = {}) {
if (!("uuid" in $$source)) {
this["uuid"] = "";
}
if (!("created_at" in $$source)) {
this["created_at"] = "";
}
@@ -88,37 +96,45 @@ export class Extension {
"id"?: number;
/**
* 创建时间
* UUID for cross-device sync (UUIDv7)
*/
"uuid": string;
/**
* creation time
*/
"created_at": string;
/**
* 最后更新时间
* update time
*/
"updated_at": string;
/**
* 删除时间NULL表示未删除
* deleted at
*/
"deleted_at"?: string | null;
/**
* 扩展标识符
* extension key
*/
"key": string;
/**
* 是否启用
* extension enabled or not
*/
"enabled": boolean;
/**
* 扩展配置
* extension config
*/
"config": { [_: string]: any };
/** Creates a new Extension instance. */
constructor($$source: Partial<Extension> = {}) {
if (!("uuid" in $$source)) {
this["uuid"] = "";
}
if (!("created_at" in $$source)) {
this["created_at"] = "";
}
@@ -142,10 +158,10 @@ export class Extension {
* Creates a new Extension instance from a string or object.
*/
static createFrom($$source: any = {}): Extension {
const $$createField6_0 = $$createType0;
const $$createField7_0 = $$createType0;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("config" in $$parsedSource) {
$$parsedSource["config"] = $$createField6_0($$parsedSource["config"]);
$$parsedSource["config"] = $$createField7_0($$parsedSource["config"]);
}
return new Extension($$parsedSource as Partial<Extension>);
}
@@ -161,42 +177,50 @@ export class KeyBinding {
"id"?: number;
/**
* 创建时间
* UUID for cross-device sync (UUIDv7)
*/
"uuid": string;
/**
* creation time
*/
"created_at": string;
/**
* 最后更新时间
* update time
*/
"updated_at": string;
/**
* 删除时间NULL表示未删除
* deleted at
*/
"deleted_at"?: string | null;
/**
* 快捷键标识符
* key binding key
*/
"key": string;
/**
* 快捷键命令
* key binding command
*/
"command": string;
/**
* 所属扩展标识符
* key binding extension
*/
"extension"?: string;
/**
* 是否启用
* key binding enabled
*/
"enabled": boolean;
/** Creates a new KeyBinding instance. */
constructor($$source: Partial<KeyBinding> = {}) {
if (!("uuid" in $$source)) {
this["uuid"] = "";
}
if (!("created_at" in $$source)) {
this["created_at"] = "";
}
@@ -235,37 +259,45 @@ export class Theme {
"id"?: number;
/**
* 创建时间
* UUID for cross-device sync (UUIDv7)
*/
"uuid": string;
/**
* creation time
*/
"created_at": string;
/**
* 最后更新时间
* update time
*/
"updated_at": string;
/**
* 删除时间NULL表示未删除
* deleted at
*/
"deleted_at"?: string | null;
/**
* 主题标识符
* theme key
*/
"key": string;
/**
* 主题类型
* theme type
*/
"type": theme$0.Type;
/**
* 主题颜色配置
* theme colors
*/
"colors": { [_: string]: any };
/** Creates a new Theme instance. */
constructor($$source: Partial<Theme> = {}) {
if (!("uuid" in $$source)) {
this["uuid"] = "";
}
if (!("created_at" in $$source)) {
this["created_at"] = "";
}
@@ -289,10 +321,10 @@ export class Theme {
* Creates a new Theme instance from a string or object.
*/
static createFrom($$source: any = {}): Theme {
const $$createField6_0 = $$createType0;
const $$createField7_0 = $$createType0;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("colors" in $$parsedSource) {
$$parsedSource["colors"] = $$createField6_0($$parsedSource["colors"]);
$$parsedSource["colors"] = $$createField7_0($$parsedSource["colors"]);
}
return new Theme($$parsedSource as Partial<Theme>);
}

View File

@@ -2,7 +2,7 @@
// This file is automatically generated. DO NOT EDIT
/**
* BackupService 提供基于Git的备份功能
* BackupService 提供基于Git的备份同步功能
* @module
*/
@@ -18,7 +18,7 @@ import * as application$0 from "../../../github.com/wailsapp/wails/v3/pkg/applic
import * as models$0 from "../models/models.js";
/**
* HandleConfigChange 处理备份配置变更
* HandleConfigChange 处理配置变更
*/
export function HandleConfigChange(config: models$0.GitBackupConfig | null): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(395287784, config) as any;
@@ -34,15 +34,7 @@ export function Initialize(): Promise<void> & { cancel(): void } {
}
/**
* PushToRemote 推送本地更改到远程仓库
*/
export function PushToRemote(): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(262644139) as any;
return $resultPromise;
}
/**
* Reinitialize 重新初始化备份服务,用于响应配置变更
* Reinitialize 重新初始化
*/
export function Reinitialize(): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(301562543) as any;
@@ -50,7 +42,7 @@ export function Reinitialize(): Promise<void> & { cancel(): void } {
}
/**
* ServiceShutdown 服务关闭时的清理工作
* ServiceShutdown 服务关闭
*/
export function ServiceShutdown(): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(422131801) as any;
@@ -63,7 +55,7 @@ export function ServiceStartup(options: application$0.ServiceOptions): Promise<v
}
/**
* StartAutoBackup 启动自动备份定时器
* StartAutoBackup 启动自动备份
*/
export function StartAutoBackup(): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(3035755449) as any;
@@ -77,3 +69,11 @@ export function StopAutoBackup(): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(2641894021) as any;
return $resultPromise;
}
/**
* Sync 执行完整的同步流程:导出 -> commit -> pull -> 解决冲突 -> push -> 导入
*/
export function Sync(): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(3420383211) as any;
return $resultPromise;
}