feat: 模块化命令框架 + runbook 严格断言与查询结果回传
- core/module: 命令模板、门控(feature flag/confirm/dry-run)、ecode 错误标签、ResultFormatter - runbook executor: http.get/http.post/assert.json(expect_success 严格断言)、目标主机管理、任务落库、最终 stdout 直接回传 - cf 模块: /cf dns list 支持域名自动解析 zone_id;dns list/zones/workers list 格式化回传;API success:false 判真失败 - 全部 CF/CPA runbook 接入严格断言,杜绝假阳性 success - 新增 cpa/cfdav/mail/sub 模块与 runbooks;QQ 订阅到期提醒调度 - Web 后台: 模块设置(CF/CPA/cfdav/AI)、OPS 任务、渠道管理、审计页
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
# API Response Convention
|
||||
|
||||
统一响应格式(JSON 接口):
|
||||
|
||||
- 成功:
|
||||
```json
|
||||
{
|
||||
"code": "OK",
|
||||
"message": "ok|success|...",
|
||||
"data": { }
|
||||
}
|
||||
```
|
||||
|
||||
- 失败:
|
||||
```json
|
||||
{
|
||||
"code": "ERR_...",
|
||||
"message": "..."
|
||||
}
|
||||
```
|
||||
|
||||
## 约定
|
||||
|
||||
1. 所有 `/api/v1/*` JSON 接口使用统一结构。
|
||||
2. 文件流接口(如 CSV 导出)成功时返回文件内容;失败时返回统一错误 JSON。
|
||||
3. 权限失败统一 `ERR_PERMISSION_DENIED`。
|
||||
4. 执行失败统一至少返回一个业务错误码(例如 `ERR_STEP_FAILED`)。
|
||||
5. `message` 用于人类可读,`code` 用于前端逻辑分支。
|
||||
|
||||
## 已接入范围(2026-03-10)
|
||||
|
||||
- Ops: jobs/list/detail/cancel/retry
|
||||
- Flags: list/patch
|
||||
- Channels: list/patch/publish/reload/enable/disable/disable-all/test/apply
|
||||
- Records: list/delete
|
||||
- Audit: list
|
||||
Reference in New Issue
Block a user