2026-02-11 11:00:55 +08:00
2025-10-26 08:54:35 +08:00
2026-02-24 10:45:53 +08:00
2026-02-24 10:45:53 +08:00
2026-02-24 10:46:33 +08:00
2025-10-26 08:54:35 +08:00
2025-10-26 08:54:35 +08:00
2025-10-26 08:54:35 +08:00

TJWater Server (FastAPI)

基于 FastAPI 的水务业务服务端提供模拟计算、SCADA 数据、网络元素、项目管理等接口。

目录结构

app/
  main.py                     # FastAPI 入口lifespan、CORS、路由挂载
  api/
    v1/
      router.py               # API 路由汇总(/api/v1 前缀)
      endpoints/              # 业务接口实现auth、simulation、scada 等)
      endpoints/network/      # 管网要素与特性接口
      endpoints/components/   # 组件/控制相关接口
  services/                   # 业务服务层simulation、tjnetwork 等)
  infra/
    db/                       # 数据库访问层timescaledb / postgresql / influxdb
    cache/                    # 缓存与 Redis 客户端
  algorithms/                 # 算法与分析模块
  core/                       # 配置与安全相关
configs/
  project_info.yml            # 默认工程配置(启动时自动打开)
scripts/
  run_server.py               # Uvicorn 启动脚本
tests/                        # 测试

启动方式

  1. 安装依赖(示例):
    pip install -r requirements.txt
    
  2. 启动服务:
    python scripts/run_server.py
    

默认监听:http://0.0.0.0:8000
API 前缀:/api/v1(见 app/main.pyapp/api/v1/router.py

Description
No description provided
Readme 345 MiB
Languages
Python 99.5%
Shell 0.2%
PLpgSQL 0.2%