refactor(arch): decouple private imports, enforce contracts and comply with cordis architecture

This commit is contained in:
ryan
2026-09-03 10:40:02 +08:00
parent dbcf485d8a
commit 953a224245
107 changed files with 2028 additions and 1263 deletions
+1
View File
@@ -16,6 +16,7 @@ sidebar: false
- Handler 把「记录不存在 → 404、其它错误 → 400」的分支改走上游 `response.AbortNotFoundIfMissing` / `AbortBadRequestOnError`,不再在 OpenFlare 里各写一份。
- 控制面 `server` 插件按限界上下文重排目录:去掉 `openflare/` 与 `router/v1` 嵌套;业务在 `domain/`(site/fleet/pages 等),共享内核在 `kernel/`(model/repository 与适配器),HTTP 装配在 `httpapi`。接口路径与表结构不变。
- `server` 插件把 stamp、of_* SQL 与 ClickHouse 迁入单一 `migrate/` 包,updater 提到 `server/updater/`;删除已停用的 76 条历史迁移。全新安装会写入 OpenFlare 定时任务与产品配置默认值,已 stamp 的升级库不重插。
- 彻底治理跨组件调用与规约违例:严格遵循 Cordis 插件分层与单一表所有者原则,全面消除业务对上游内部实现的私有 import,统一面向 `backend/core/contracts` 编程;将契约 DTO 持久化解耦并增强通用标准库序列化支持回流 Wavelet 上游,全量架构规约检查与下游测试通过率达 100%。
### 💄 其他/体验
+71 -71
View File
@@ -2668,7 +2668,7 @@
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Schedule"
"$ref": "#/definitions/model.Schedule"
}
}
}
@@ -2730,7 +2730,7 @@
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Schedule"
"$ref": "#/definitions/model.Schedule"
}
}
}
@@ -2812,7 +2812,7 @@
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Schedule"
"$ref": "#/definitions/model.Schedule"
}
}
}
@@ -3001,7 +3001,7 @@
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Template"
"$ref": "#/definitions/model.Template"
}
}
}
@@ -3139,7 +3139,7 @@
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Template"
"$ref": "#/definitions/model.Template"
}
}
}
@@ -3219,7 +3219,7 @@
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Template"
"$ref": "#/definitions/model.Template"
}
}
}
@@ -15233,36 +15233,6 @@
}
}
},
"Wavelet_plugins_domain_admin_model.Schedule": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"cron": {
"type": "string"
},
"id": {
"type": "string",
"example": "0"
},
"is_active": {
"type": "boolean"
},
"name": {
"type": "string"
},
"payload": {
"type": "string"
},
"task_type": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"Wavelet_plugins_domain_admin_model.SystemConfig": {
"type": "object",
"properties": {
@@ -15349,41 +15319,6 @@
}
}
},
"Wavelet_plugins_domain_admin_model.Template": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"description": {
"type": "string"
},
"id": {
"type": "integer"
},
"is_system": {
"type": "boolean"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"subject": {
"type": "string"
},
"type": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"agent.ActiveConfigMeta": {
"type": "object",
"properties": {
@@ -17859,6 +17794,36 @@
}
}
},
"model.Schedule": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"cron": {
"type": "string"
},
"id": {
"type": "string",
"example": "0"
},
"is_active": {
"type": "boolean"
},
"name": {
"type": "string"
},
"payload": {
"type": "string"
},
"task_type": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"model.SystemStatusResponse": {
"type": "object",
"properties": {
@@ -18028,6 +17993,41 @@
"TaskExecutionStatusFailed"
]
},
"model.Template": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"description": {
"type": "string"
},
"id": {
"type": "integer"
},
"is_system": {
"type": "boolean"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"subject": {
"type": "string"
},
"type": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"model.TestSMTPRequest": {
"type": "object",
"required": [
+49 -49
View File
@@ -156,26 +156,6 @@ definitions:
type:
type: string
type: object
Wavelet_plugins_domain_admin_model.Schedule:
properties:
created_at:
type: string
cron:
type: string
id:
example: "0"
type: string
is_active:
type: boolean
name:
type: string
payload:
type: string
task_type:
type: string
updated_at:
type: string
type: object
Wavelet_plugins_domain_admin_model.SystemConfig:
properties:
created_at:
@@ -233,29 +213,6 @@ definitions:
updated_at:
type: string
type: object
Wavelet_plugins_domain_admin_model.Template:
properties:
content:
type: string
created_at:
type: string
description:
type: string
id:
type: integer
is_system:
type: boolean
key:
type: string
name:
type: string
subject:
type: string
type:
type: string
updated_at:
type: string
type: object
agent.ActiveConfigMeta:
properties:
checksum:
@@ -1890,6 +1847,26 @@ definitions:
value:
type: string
type: object
model.Schedule:
properties:
created_at:
type: string
cron:
type: string
id:
example: "0"
type: string
is_active:
type: boolean
name:
type: string
payload:
type: string
task_type:
type: string
updated_at:
type: string
type: object
model.SystemStatusResponse:
properties:
alloc:
@@ -2004,6 +1981,29 @@ definitions:
- TaskExecutionStatusRunning
- TaskExecutionStatusSucceeded
- TaskExecutionStatusFailed
model.Template:
properties:
content:
type: string
created_at:
type: string
description:
type: string
id:
type: integer
is_system:
type: boolean
key:
type: string
name:
type: string
subject:
type: string
type:
type: string
updated_at:
type: string
type: object
model.TestSMTPRequest:
properties:
smtp_host:
@@ -5873,7 +5873,7 @@ paths:
- properties:
data:
items:
$ref: '#/definitions/Wavelet_plugins_domain_admin_model.Schedule'
$ref: '#/definitions/model.Schedule'
type: array
type: object
"401":
@@ -5910,7 +5910,7 @@ paths:
- $ref: '#/definitions/response.Any'
- properties:
data:
$ref: '#/definitions/Wavelet_plugins_domain_admin_model.Schedule'
$ref: '#/definitions/model.Schedule'
type: object
"400":
description: Cron 表达式无效、异步任务类型不存在或参数错误
@@ -6001,7 +6001,7 @@ paths:
- $ref: '#/definitions/response.Any'
- properties:
data:
$ref: '#/definitions/Wavelet_plugins_domain_admin_model.Schedule'
$ref: '#/definitions/model.Schedule'
type: object
"400":
description: Cron 表达式无效、参数错误
@@ -6072,7 +6072,7 @@ paths:
- properties:
data:
items:
$ref: '#/definitions/Wavelet_plugins_domain_admin_model.Template'
$ref: '#/definitions/model.Template'
type: array
type: object
"401":
@@ -6200,7 +6200,7 @@ paths:
- $ref: '#/definitions/response.Any'
- properties:
data:
$ref: '#/definitions/Wavelet_plugins_domain_admin_model.Template'
$ref: '#/definitions/model.Template'
type: object
"401":
description: 未登录
@@ -6249,7 +6249,7 @@ paths:
- $ref: '#/definitions/response.Any'
- properties:
data:
$ref: '#/definitions/Wavelet_plugins_domain_admin_model.Template'
$ref: '#/definitions/model.Template'
type: object
"400":
description: 参数错误