Files
Frobot-OTA-Server/README.md
2026-04-23 14:23:42 +08:00

43 lines
1.3 KiB
Markdown
Raw Permalink 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.

# 云端 OTA Server
这是一个基于 `Spring Boot 3.2.1 + Maven + JDK 17 + MySQL + MyBatis-Plus` 的最小可用云端 OTA 管理服务面向“云端发布、车端检测、安卓提示、人工确认、Docker 执行”的半自动升级模式。
## 当前能力
- 发布 OTA 版本清单
- 注册车辆
- 为指定车辆分配可见版本
- 提供 Agent 心跳、检查更新、结果上报接口
- 维护任务状态:`AVAILABLE``WAITING_CONFIRM``UPGRADING``SUCCESS``FAILED``ROLLED_BACK``SKIPPED`
- 数据持久化到 MySQL
## 启动前准备
1. 安装 JDK 17、Maven、MySQL 8.x
2. 创建数据库并执行初始化脚本:`src/main/resources/schema.sql`
3. 按实际环境修改 `src/main/resources/application.yml` 中的数据库连接
## 启动方式
1. 在项目根目录运行:
`mvn spring-boot:run`
2. 默认端口:`8080`
## 鉴权
Agent 侧接口要求请求头:
- `X-OTA-TOKEN: dev-token`
可在 `src/main/resources/application.yml` 中修改。
## 管理端接口
- `POST /api/admin/releases`
- `GET /api/admin/releases`
- `POST /api/admin/vehicles`
- `GET /api/admin/vehicles`
- `POST /api/admin/assignments`
- `GET /api/admin/assignments`
## Agent 接口
- `POST /api/agent/heartbeat`
- `POST /api/agent/update-check`
- `POST /api/agent/report`
- `POST /api/agent/confirm`
- `POST /api/agent/postpone`