Files
IoT-OpenApi/README.md
T

14 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# IOT-open-gateway 统一开放平台网关
基于 Spring Boot 3.2.11 + Java 17 研发的独立开放网关服务,与主业务后端 `IOT-backend` 完全物理隔离解耦,专门负责:
1. **OAuth 2.0 授权服务器 (Client Credentials)**:客户端通过 `/oauth2/token` 凭借 `client_id` + `client_secret` 申请并获取强绑定租户的 JWT 访问令牌;
2. **MCP Server 协议适配层 (面向 AI 智能体生态)**:提供标准 HTTP+SSE 端点 `/mcp/sse` 与 `/mcp/messages`,对外暴露 `iot_device_list`、`iot_telemetry_latest`、`iot_device_control`、`iot_alarm_query` 工业级物联能力;
3. **REST OpenAPI 业务适配层 (面向传统三方企业系统)**:对外暴露 `/open/v1/devices/**`、`/open/v1/telemetry/**`、`/open/v1/commands`、`/open/v1/alarms`;
4. **三方双向集成与 Webhook 调度**:支持向企业微信、钉钉、飞书群机器人主动推送告警与事件,支持接收外部系统事件回调;
5. **解耦高可用保活**:主后端 `IOT-backend` 发版重启期间,网关与外部所有的 MCP 长连接会话保持不中断。
## 启动与运行
- 本地开发:端口 `8082`
- 生产环境:端口 `18082`(激活 `prod` profile)
- Swagger 接口文档:`http://localhost:8082/swagger-ui.html`