拆分main.py

This commit is contained in:
2026-01-21 18:19:48 +08:00
parent fd3a9f92c0
commit 2668faf8ad
28 changed files with 2459 additions and 4205 deletions

View File

@@ -2,19 +2,70 @@ from fastapi import APIRouter
from app.api.v1.endpoints import (
auth,
project,
network_elements,
simulation,
scada,
extension,
snapshots
snapshots,
data_query,
users
)
from app.api.v1.endpoints.network import (
general,
junctions,
reservoirs,
tanks,
pipes,
pumps,
valves,
tags,
demands,
geometry,
regions,
)
from app.api.v1.endpoints.components import (
curves,
patterns,
controls,
options,
quality,
visuals,
)
api_router = APIRouter()
api_router.include_router(auth.router, prefix="/auth", tags=["auth"])
api_router.include_router(project.router, prefix="/projects", tags=["projects"])
api_router.include_router(network_elements.router, prefix="/elements", tags=["network-elements"])
api_router.include_router(simulation.router, prefix="/simulation", tags=["simulation"])
api_router.include_router(scada.router, prefix="/scada", tags=["scada"])
api_router.include_router(extension.router, prefix="/extension", tags=["extension"])
api_router.include_router(snapshots.router, prefix="/snapshots", tags=["snapshots"])
# Core Services
api_router.include_router(auth.router, tags=["Auth"])
api_router.include_router(project.router, tags=["Project"])
# Network Elements (Node/Link Types)
api_router.include_router(general.router, tags=["Network General"])
api_router.include_router(junctions.router, tags=["Junctions"])
api_router.include_router(reservoirs.router, tags=["Reservoirs"])
api_router.include_router(tanks.router, tags=["Tanks"])
api_router.include_router(pipes.router, tags=["Pipes"])
api_router.include_router(pumps.router, tags=["Pumps"])
api_router.include_router(valves.router, tags=["Valves"])
# Network Features
api_router.include_router(tags.router, tags=["Tags"])
api_router.include_router(demands.router, tags=["Demands"])
api_router.include_router(geometry.router, tags=["Geometry & Coordinates"])
api_router.include_router(regions.router, tags=["Regions & DMAs"])
# Components & Controls
api_router.include_router(curves.router, tags=["Curves"])
api_router.include_router(patterns.router, tags=["Patterns"])
api_router.include_router(controls.router, tags=["Controls & Rules"])
api_router.include_router(options.router, tags=["Options"])
api_router.include_router(quality.router, tags=["Quality"])
api_router.include_router(visuals.router, tags=["Visuals"])
# Simulation & Data
api_router.include_router(simulation.router, tags=["Simulation Control"])
api_router.include_router(data_query.router, tags=["Data Query & InfluxDB"])
api_router.include_router(scada.router, tags=["SCADA"])
api_router.include_router(snapshots.router, tags=["Snapshots"])
api_router.include_router(users.router, tags=["Users & Schemes"])
# Extension
api_router.include_router(extension.router, tags=["Extension"])