基址 http://localhost:8080/api。除鉴权外,所有接口需携带 Authorization: Bearer <token>,请求/响应均为 application/json。错误统一返回 { error, message },状态码 400/401/404/500。
鉴权与账号
登录
POST /api/auth/login
{ "username": "admin", "password": "admin" }
→ { "token": "<jwt>", "role": "ADMIN", "username": "admin" }与会话
| 方法 | 路径 | 说明 |
|---|
| POST | /api/auth/login | 登录,返回 JWT token |
| POST | /api/auth/logout | 登出 |
| POST | /api/auth/seed | 演示账号种子 |
| POST | /api/auth/change-password | 修改密码 |
| GET | /api/users | 用户列表(RBAC 5 角色) |
| GET | /api/audit-logs | 全量审计日志 |
车辆 / 告警 / AI
车辆与运营
| 方法 | 路径 | 说明 |
|---|
| GET | /api/vehicles | 车辆列表(全量字段) |
| GET | /api/vehicles/{vin} | 单车档案详情 |
| GET | /api/vehicles/{vin}/residual | 单车残值评估(PK-04 残值曲线) |
| GET | /api/vehicles/{vin}/passport | 电池护照 |
| GET | /api/chargers | 充电桩列表 |
| GET | /api/range-trend | 续航趋势 |
| GET | /api/dispatch-conflicts | 调度冲突 |
| GET | /api/kpis | 运营 KPI 总览 |
| GET | /api/subsidy/ledger | 补贴台账 |
告警
| 方法 | 路径 | 说明 |
|---|
| GET | /api/alarms | 告警列表(分页/筛选) |
| GET | /api/alarms/{id} | 告警详情 |
| POST | /api/alarms/{id}/transition | 告警流转(状态机,非法流转拦截) |
| GET | /api/alarms/stats | 告警统计 |
| GET | /api/alarms/notifications | 通知路由 |
AI 与增值
| 方法 | 路径 | 说明 |
|---|
| GET | /api/ai/models | 模型列表 |
| POST | /api/ai/infer | 推理 |
| GET | /api/ai/scheduler | AI 排班调度 |
| GET | /api/ai/edge-tier | 边缘智能层 |
| POST | /api/ai/edge-tier | 边缘层落库 |
| GET | /api/value-add/driver-behaviors | 驾驶行为 AI 优化 |
| GET | /api/value-add/ai-suggestions | AI 建议 |
| GET | /api/value-add/vehicle-components | 部件预测维保 |
| GET | /api/value-add/driverless-fleet | 智能驾驶辅助(演示) |
储能(徐汇临港项目)
储能簇与安全边界
| 方法 | 路径 | 说明 |
|---|
| GET | /api/storage/clusters | 储能簇列表 |
| GET | /api/storage/clusters/{no} | 单簇详情 |
| GET | /api/storage/boundaries | 每簇安全功率边界(硬约束) |
| GET | /api/storage/summary | 储能总览 |
| GET | /api/storage/strategy | 24h 充放计划(边界内) |
| GET | /api/storage/island | 孤网运行状态 |
| GET | /api/storage/island/available | 孤网可用判定 |
PCS 降级与指令
| 方法 | 路径 | 说明 |
|---|
| GET | /api/storage/pcs/status | PCS 写权限/降级态 |
| POST | /api/storage/pcs/mode | 切换降级/闭环态 |
| POST | /api/storage/pcs/issue | 下发/建议指令(全审计) |
| POST | /api/storage/pcs/{id}/confirm | 降级建议人工确认 |
| GET | /api/storage/pcs/log | PCS 指令日志 |
电价 / 逆功率 / 收益
| 方法 | 路径 | 说明 |
|---|
| GET | /api/storage/price-templates | 分时电价模板 |
| GET | /api/storage/price-templates/{code}/h24 | 模板 24h 曲线 |
| GET | /api/storage/reverse-power | 逆功率保护状态 |
| POST | /api/storage/reverse-power/limit | 设置逆功率阈值 |
| POST | /api/storage/reverse-power/simulate | 注入逆功率场景 |
| GET | /api/storage/financial | 收益测算(IRR/回收期) |
| POST | /api/storage/financial/calculate | 自定义收益测算 |
| GET | /api/storage/strategy-templates | 充放策略模板 |
| GET | /api/storage/strategy-templates/{code}/h24 | 策略模板 24h |
安全联动(氢/暖通/消防)
| 方法 | 路径 | 说明 |
|---|
| GET | /api/storage/h2/zones | 氢浓度分区 |
| GET | /api/storage/h2/summary | 氢安全总览 |
| POST | /api/storage/h2/report | 上报氢气值(联动触发) |
| GET | /api/storage/hvac/devices | 暖通设备 |
| POST | /api/storage/hvac/linkage | 暖通联动执行 |
| GET | /api/storage/fire/status | 消防联动状态 |
| POST | /api/storage/fire/trigger | 触发火警联动 |
| POST | /api/storage/fire/reset | 消防联动复位 |
| GET | /api/storage/fire/log | 消防联动日志 |
能碳 / VPP / V2G / 现场安防
| 方法 | 路径 | 说明 |
|---|
| GET | /api/storage/carbon/summary | 能碳台账汇总 |
| GET | /api/storage/carbon/monthly | 月度降碳趋势 |
| GET | /api/storage/carbon/mix | 绿电/市电构成 |
| GET | /api/storage/vpp | VPP 资源聚合 |
| GET | /api/storage/vpp/response-plans | 需求响应计划 |
| GET | /api/storage/vpp/revenue | VPP 收益测算 |
| GET | /api/storage/vpp/cost-ladder | 度电成本阶梯(0.74→0.52) |
| GET | /api/storage/v2g | V2G 总览 |
| GET | /api/storage/v2g/strategy | V2G 峰放谷充策略 |
| GET | /api/storage/site-devices/overview | 现场安防总览 |
| GET | /api/storage/site-devices | 安防设备清单(可按类型过滤) |
| POST | /api/storage/site-devices/{no}/event | 触发入侵/火警/视频异常联动 |
| POST | /api/storage/site-devices/{no}/reset | 安防设备复位 |
| GET | /api/storage/site-devices/events | 安防联动事件日志 |
节电与能耗
| 方法 | 路径 | 说明 |
|---|
| GET | /api/power/overview | 节电总览 |
| GET | /api/power/meters | 电表列表 |
| GET | /api/power/devices | 网络设备 |
| POST | /api/power/dispatch/run | AI 调度执行 |
| POST | /api/power/dispatch/restore | 恢复 |
| GET | /api/power/dispatch/logs | 调度日志 |
| GET | /api/power/savings | 节电收益 |
| GET | /api/power/ledger | 节能台账 |
| GET | /api/power/analysis/daily | 能耗日报 |
| GET | /api/power/analysis/monthly | 能耗月报 |
| GET | /api/power/analysis/trend | 能耗趋势 |
| GET | /api/power/forecast/week | AI 周负荷预测 |
| GET | /api/power/forecast/month | AI 月负荷预测 |
| GET | /api/power/thresholds | 阈值配置 |
| POST | /api/power/thresholds/{key} | 更新阈值 |
| GET | /api/power/alerts/night-anomaly | 夜间异常告警 |
| GET | /api/power/alerts/idle-routers | 空闲路由器 |
监管上报(GB/T 32960)
| 方法 | 路径 | 说明 |
|---|
| GET | /api/regulatory/status | 上报状态总览(模式/协议/水位) |
| GET | /api/regulatory/records | 最近上报记录(帧级留痕) |
| POST | /api/regulatory/upload/{vin} | 单车上报(GB/T 32960 帧编码) |
| POST | /api/regulatory/upload | 全车队批量上报 |
数据接入 / 协议 / 母排
| 方法 | 路径 | 说明 |
|---|
| GET | /api/ingest/protocols | 已注册协议品牌(含 GBT32960) |
| POST | /api/ingest/decode | 报文解码(brand + base64 payload) |
| GET | /api/busbar/samples | Busbar 样本 |
| GET | /api/busbar/summary | 母排健康总览 |
| GET | /api/busbar/benchmark | Busbar AI 基准(MRE/精度/检出) |
报表 / 工单 / 其他
| 方法 | 路径 | 说明 |
|---|
| GET | /api/report-templates | 报表模板 |
| GET | /api/report-templates/{code}/generate | 按模板生成(政务报表) |
| GET | /api/report-records | 报表生成记录 |
| GET | /api/work-orders | 工单列表 |
| POST | /api/work-orders | 创建工单(告警联动开单) |
| POST | /api/work-orders/{orderNo}/transition | 工单流转(提交→指派→处理→验收) |
| GET | /api/charging/price-curve | 充电价格曲线 |
| GET | /api/charging/soh-curve | SOH 曲线 |
| GET | /api/charging/efc-summary | EFC 循环总结 |
| GET | /api/health | 服务探活(返回 UP) |
说明:完整接口共 40+ 条。生产对接时以 GET /api/health 作为探活,所有写操作(pcs/issue、dispatch/run、fire/trigger 等)均写入审计日志。