refactor: rename iot client to stateless gateway

This commit is contained in:
2026-08-03 14:43:39 +08:00
parent 5edca1524f
commit aaede08f88
26 changed files with 92 additions and 111 deletions

View File

@@ -13,7 +13,7 @@
- 验收范围:`docs/12-验收与迭代规划.md`
2. 检查 `git status`,保留用户已有改动;不要顺手格式化、重写或删除无关文件。
3. 区分三类内容:
- `frontend/platform_admin``backend/{api,worker,iot-client,iot-server}` 是当前业务实现。
- `frontend/platform_admin``backend/{api,worker,iot-gateway,iot-server}` 是当前业务实现。
- `docs/10-技术实现规划.md` 中尚不存在的目录和系统属于规划,不得为完成局部任务擅自创建空壳工程。
4. 需求不明确时以文档中的系统主责、数据主责和安全规则为边界;不得把标为“待确认”的事项自行固化为政策。
5. 文档之间出现冲突时按以下顺序处理:
@@ -29,7 +29,7 @@
- `backend/api`Gin HTTP API/BFF、鉴权、同步业务事务、数据库事实和审计。
- `backend/worker`Outbox 投递、Redis Streams 消费、告警、派单、通知、对账和超时任务。当前主要是 Mock 边界,未确定持久化消息契约前不要伪造完整实现。
- `backend/iot-client`:管理系统/App 的设备上下行 HTTP 边界;不得绕过 API 的业务鉴权和安全状态校验。
- `backend/iot-gateway`API/Worker 与 IoT Server 的无状态上下行 HTTP 轻网关;不得保存业务事实或绕过 API 的业务鉴权和安全状态校验。
- `backend/iot-server`:内嵌 Mochi MQTT Broker、厂商协议、遥测、设备命令和回执本地配置不代表已完成真实设备联调。
- `frontend/platform_admin`:平台级治理、运营、财务、安全、主数据和审计界面;后端资源契约是其资源和操作能力的依据。
- `docs`:产品和技术基线;涉及业务口径、实体、状态、权限或跨端流程的变更必须同步更新相应文档。
@@ -60,7 +60,7 @@ platforms/
backend/
api/ # 当前:同步 HTTP API/BFF
worker/ # 当前:异步任务和事件消费
iot-client/ # 当前:管理系统/App 的设备上下行接口
iot-gateway/ # 当前:API/Worker 与 IoT Server 的无状态上下行网关
iot-server/ # 当前MQTT 与设备协议边界
contracts/
openapi/ # 规划HTTP 契约
@@ -147,7 +147,7 @@ go build ./cmd/main/main.go
# Worker / IoT改动对应模块时
cd backend/worker && go test ./... && go build ./cmd/main/main.go
cd backend/iot-client && go test ./... && go build ./cmd/main/main.go
cd backend/iot-gateway && go test ./... && go build ./cmd/main/main.go
cd backend/iot-server && go test ./... && go build ./cmd/main/main.go
# 平台总后台