10780285f5
## 改动摘要 ### 后端改动 - 新增 `lightning_import.py` schema,定义文件导入批次相关数据结构 - 在 `lightning_service.py` 中实现 `list_lightning_import_batches` 和 `get_lightning_import_batch_events` 函数 - 在 `lightning.py` API 中新增两个端点: - `GET /lightning-currents/import-batches` - 获取文件导入批次列表 - `GET /lightning-currents/import-batches/events` - 获取指定批次的事件明细 ### 前端改动 - 修改 `page.tsx`,将表格展示从单个事件改为文件导入批次 - 新增 `EventsModal` 组件,用于查看批次的事件明细 - 新增 `ScatterModal` 组件,用于查看批次对应的散点图 - 每个批次记录提供「事件明细」和「散点图」按钮 - 更新类型定义,新增 `LightningImportBatchSummary` 等类型 ### 数据分组逻辑 - 按 `source_file_name + create_date + region_id + location_tag + city` 进行分组 - 每个批次显示:文件名、导入时间、事件数、城市、地点标签、最大/平均电流 ## 测试结果 - ✅ Python 语法检查通过(lightning_service.py, lightning.py, lightning_import.py) - ✅ TypeScript 类型定义正确 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
API Service
FastAPI 后端服务,包含用户认证和 RBAC 权限控制。
核心能力
- JWT Access Token(默认 8 小时)
- Refresh Session(HttpOnly Cookie,默认 30 天,刷新轮换)
- RBAC(用户-角色-权限)
- 用户管理接口(需
user.manage)
本地开发
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r api/requirements.txt
python -m uvicorn api.app.main:app --reload --host 0.0.0.0 --port 8000
主要接口
GET /healthGET /api/v1/pingPOST /api/v1/auth/registerPOST /api/v1/auth/loginPOST /api/v1/auth/refreshPOST /api/v1/auth/logoutGET /api/v1/auth/meGET /api/v1/users