refactor(terminology): 统一术语标准并优化代码类型安全
- 将B2B统一为TOB术语 - 将状态值统一为大写格式 - 优化类型声明,避免使用any - 将float类型替换为decimal以提高精度 - 新增术语标准化文档 - 优化路由结构和菜单分类 - 添加TypeORM实体类 - 增强加密模块安全性 - 重构前端路由结构 - 完善任务模板和验收标准
This commit is contained in:
126
docs/00_Business/tasks/backend/26_settings.md
Normal file
126
docs/00_Business/tasks/backend/26_settings.md
Normal file
@@ -0,0 +1,126 @@
|
||||
# 远程桌面与任务中心后端任务
|
||||
|
||||
## 任务列表
|
||||
|
||||
| Task ID | 闭环关联 | 任务描述 | 输入 | 输出 | 触发条件 | 状态 | 优先级 | 依赖 | 预计耗时 | 负责人 | 完成时间 |
|
||||
| ------- | ------- | ------- | ---- | ---- | ------- | ---- | ------ | ---- | ------- | ------ | ------- |
|
||||
| BE-WN001 | 远程桌面体系闭环 | WinNode服务实现 | 节点配置 | 节点管理API | 前端调用 | ✅ completed | P1 | - | 3h | AI-Backend-1 | 2026-03-20 |
|
||||
| BE-WN002 | 远程桌面体系闭环 | WinNode心跳与状态监控 | 节点ID, 状态数据 | 状态更新 | 定时心跳 | ✅ completed | P1 | BE-WN001 | 2h | AI-Backend-1 | 2026-03-20 |
|
||||
| BE-WN003 | 远程桌面体系闭环 | WinNode连接测试与重启 | 节点ID | 测试结果 | 手动触发 | ✅ completed | P1 | BE-WN001 | 1.5h | AI-Backend-1 | 2026-03-20 |
|
||||
| BE-TC001 | 任务中心闭环 | TaskCenter服务实现 | 任务配置 | 任务管理API | 前端调用 | ✅ completed | P1 | - | 3h | AI-Backend-1 | 2026-03-20 |
|
||||
| BE-TC002 | 任务中心闭环 | 任务状态流转与进度更新 | 任务ID, 状态 | 状态更新 | 任务执行 | ✅ completed | P1 | BE-TC001 | 2h | AI-Backend-1 | 2026-03-20 |
|
||||
| BE-TC003 | 任务中心闭环 | 任务统计与查询接口 | 租户ID | 统计数据 | 前端调用 | ✅ completed | P1 | BE-TC001 | 1.5h | AI-Backend-1 | 2026-03-20 |
|
||||
| BE-IS001 | 独立站管理闭环 | IndependentSite服务实现 | 站点配置 | 站点管理API | 前端调用 | ✅ completed | P1 | - | 3h | AI-Backend-1 | 2026-03-20 |
|
||||
| BE-IS002 | 独立站管理闭环 | 站点产品同步接口 | 站点ID, 产品ID列表 | 同步状态 | 手动触发 | ✅ completed | P1 | BE-IS001 | 2h | AI-Backend-1 | 2026-03-20 |
|
||||
| BE-IS003 | 独立站管理闭环 | 站点订单与数据分析接口 | 站点ID, 时间范围 | 分析报告 | 前端调用 | ✅ completed | P1 | BE-IS001 | 2h | AI-Backend-1 | 2026-03-20 |
|
||||
| BE-SET001 | 设置管理闭环 | Settings路由与控制器 | API请求 | API响应 | HTTP请求 | ✅ completed | P1 | BE-WN001, BE-TC001, BE-IS001 | 2h | AI-Backend-1 | 2026-03-20 |
|
||||
|
||||
## 相关闭环
|
||||
|
||||
- 远程桌面体系闭环
|
||||
- 任务中心闭环
|
||||
- 独立站管理闭环
|
||||
- 设置管理闭环
|
||||
|
||||
## 依赖关系
|
||||
|
||||
```
|
||||
BE-WN001 ─┬─► BE-WN002
|
||||
└─► BE-WN003
|
||||
|
||||
BE-TC001 ─┬─► BE-TC002
|
||||
└─► BE-TC003
|
||||
|
||||
BE-IS001 ─┬─► BE-IS002
|
||||
└─► BE-IS003
|
||||
|
||||
BE-WN001 ─┐
|
||||
BE-TC001 ─┼─► BE-SET001
|
||||
BE-IS001 ─┘
|
||||
```
|
||||
|
||||
## 数据库表结构
|
||||
|
||||
### cf_win_node
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ---- | ---- | ---- |
|
||||
| id | string | 节点ID |
|
||||
| tenant_id | string | 租户ID |
|
||||
| name | string | 节点名称 |
|
||||
| host | string | 主机地址 |
|
||||
| port | number | 端口号 |
|
||||
| status | enum | ONLINE/OFFLINE/BUSY/ERROR |
|
||||
| shop_id | string | 关联店铺ID |
|
||||
| profile_dir | string | 浏览器配置目录 |
|
||||
| proxy | string | 代理配置 |
|
||||
| fingerprint_policy | enum | STANDARD/STEALTH/RANDOM/CUSTOM |
|
||||
| max_concurrent | number | 最大并发数 |
|
||||
| current_tasks | number | 当前任务数 |
|
||||
| cpu_usage | decimal | CPU使用率 |
|
||||
| memory_usage | decimal | 内存使用率 |
|
||||
| last_heartbeat | timestamp | 最后心跳时间 |
|
||||
|
||||
### cf_task_center
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ---- | ---- | ---- |
|
||||
| id | string | 任务ID |
|
||||
| tenant_id | string | 租户ID |
|
||||
| shop_id | string | 店铺ID |
|
||||
| task_type | string | 任务类型 |
|
||||
| task_name | string | 任务名称 |
|
||||
| status | enum | PENDING/RUNNING/COMPLETED/FAILED/CANCELLED |
|
||||
| priority | enum | LOW/MEDIUM/HIGH/URGENT |
|
||||
| progress | number | 进度百分比 |
|
||||
| input | json | 输入参数 |
|
||||
| output | json | 输出结果 |
|
||||
| error | text | 错误信息 |
|
||||
| trace_id | string | 追踪ID |
|
||||
|
||||
### cf_independent_site
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ---- | ---- | ---- |
|
||||
| id | string | 站点ID |
|
||||
| tenant_id | string | 租户ID |
|
||||
| name | string | 站点名称 |
|
||||
| domain | string | 域名 |
|
||||
| platform | enum | SHOPIFY/WOOCOMMERCE/MAGENTO/CUSTOM |
|
||||
| status | enum | ACTIVE/INACTIVE/MAINTENANCE/ERROR |
|
||||
| config | json | 站点配置 |
|
||||
| theme | json | 主题配置 |
|
||||
| payment_gateways | json | 支付网关 |
|
||||
| shipping_methods | json | 配送方式 |
|
||||
| analytics | json | 分析配置 |
|
||||
| seo_config | json | SEO配置 |
|
||||
|
||||
## API端点
|
||||
|
||||
### WinNode API
|
||||
- `GET /api/settings/winnode` - 获取节点列表
|
||||
- `GET /api/settings/winnode/:id` - 获取节点详情
|
||||
- `POST /api/settings/winnode` - 创建节点
|
||||
- `PUT /api/settings/winnode/:id` - 更新节点
|
||||
- `DELETE /api/settings/winnode/:id` - 删除节点
|
||||
- `POST /api/settings/winnode/:id/test` - 测试连接
|
||||
- `POST /api/settings/winnode/:id/restart` - 重启节点
|
||||
- `POST /api/settings/winnode/:id/heartbeat` - 心跳上报
|
||||
- `GET /api/settings/winnode/stats` - 获取统计
|
||||
|
||||
### TaskCenter API
|
||||
- `GET /api/settings/taskcenter` - 获取任务列表
|
||||
- `GET /api/settings/taskcenter/:id` - 获取任务详情
|
||||
- `POST /api/settings/taskcenter` - 创建任务
|
||||
- `PUT /api/settings/taskcenter/:id/status` - 更新状态
|
||||
- `POST /api/settings/taskcenter/:id/cancel` - 取消任务
|
||||
- `POST /api/settings/taskcenter/:id/retry` - 重试任务
|
||||
- `GET /api/settings/taskcenter/stats` - 获取统计
|
||||
|
||||
### IndependentSite API
|
||||
- `GET /api/settings/independent-site` - 获取站点列表
|
||||
- `GET /api/settings/independent-site/:id` - 获取站点详情
|
||||
- `POST /api/settings/independent-site` - 创建站点
|
||||
- `PUT /api/settings/independent-site/:id` - 更新站点
|
||||
- `DELETE /api/settings/independent-site/:id` - 删除站点
|
||||
- `POST /api/settings/independent-site/:id/sync-products` - 同步产品
|
||||
- `GET /api/settings/independent-site/:id/products` - 获取产品
|
||||
- `GET /api/settings/independent-site/:id/orders` - 获取订单
|
||||
- `GET /api/settings/independent-site/:id/analytics` - 获取分析
|
||||
Reference in New Issue
Block a user