docs: add harness coding documentation
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
# 方法地图
|
||||
|
||||
> 维护者查找入口时先看这里,再进入具体文件。
|
||||
|
||||
## 应用启动
|
||||
|
||||
| 文件 | 方法 / 内容 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `main.go` | `main()` | 创建 Wails app、注册服务、嵌入资源、启动应用 |
|
||||
| `internal/services/appservice.go` | `ConfigureAppService` | 配置窗口、托盘、语言资源和生命周期 |
|
||||
|
||||
## 存储
|
||||
|
||||
| 文件 | 方法 / 内容 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `internal/services/store.go` | `NewSuiStore` | 打开 SQLite 并执行初始化 |
|
||||
| `internal/services/store.go` | migration / CRUD 方法 | 初始化 `hotkeys`、`appconfig` 并提供基础读写 |
|
||||
| `internal/services/store_test.go` | store 测试 | 覆盖存储初始化和关键读写 |
|
||||
|
||||
## 配置
|
||||
|
||||
| 文件 | 方法 / 内容 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `internal/services/appconfig_service.go` | `GetAppConfig` / `SetAppConfig` | 前端配置读写入口 |
|
||||
| `internal/services/appconfig_service.go` | `GetLanguage` / `SetLanguage` | 语言配置读写入口 |
|
||||
|
||||
## 热键
|
||||
|
||||
| 文件 | 方法 / 内容 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `internal/services/hotkey_service.go` | `GetHotkeys` | 返回当前热键配置 |
|
||||
| `internal/services/hotkey_service.go` | `UpHotkey` | 更新热键并重新注册 |
|
||||
| `platform/hotkey_windows.go` | Windows 热键实现 | Windows 平台注册逻辑 |
|
||||
| `platform/hotkey_darwin.go` | macOS 热键实现 | macOS 平台注册逻辑 |
|
||||
|
||||
## 前端
|
||||
|
||||
| 文件 | 方法 / 内容 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `frontend/src/main.ts` | Vue 入口 | 注册应用、路由和国际化 |
|
||||
| `frontend/src/router/index.ts` | routes | `#/` 和 `#/second` 路由 |
|
||||
| `frontend/src/components/Main/Index.vue` | 主窗口入口 | 设置页面总布局 |
|
||||
| `frontend/src/pages/Home/Index.vue` | 第二窗口入口 | OCR 示例页面 |
|
||||
| `frontend/src/utils/ThemeManager.ts` | 主题工具 | 主题切换和持久化协作 |
|
||||
| `frontend/src/utils/i18n.ts` | 国际化工具 | 语言资源和切换 |
|
||||
Reference in New Issue
Block a user