diff --git a/AUTHENTICATION_AND_USER_MANAGEMENT.md b/AUTHENTICATION_AND_USER_MANAGEMENT.md index 7a6906e..8b04db3 100644 --- a/AUTHENTICATION_AND_USER_MANAGEMENT.md +++ b/AUTHENTICATION_AND_USER_MANAGEMENT.md @@ -13,6 +13,25 @@ TJWater metadata stores only business snapshots and authorization data: The backend does not accept passwords, does not issue local JWTs, and does not trust frontend-supplied user IDs. +## Fixed Project RBAC + +Project roles are stored directly in +`user_project_membership.project_role`; there is no separate role table or +user-defined permission editor in this delivery. + +| Role | Main access | +| --- | --- | +| `modeler` | Model upload/import, simulation, burst, risk, and optimization analysis | +| `dispatcher` | SCADA cleaning, simulation and burst analysis | +| `auditor` | Project read access and project-scoped audit logs | +| `viewer` | WebGIS and read-only risk results | + +Legacy `owner`, `admin`, and `member` values remain supported for existing +records. The backend is the authorization boundary; the frontend uses +`GET /api/v1/access/context` only to hide unavailable menus and guard routes. +System admins receive environment, membership, and global-audit permissions, +but still need a project membership for project business APIs. + ## Login Snapshot Refresh Every authenticated metadata-user resolution validates the Keycloak access token @@ -77,14 +96,22 @@ Apply metadata patches in order: 1. `resources/sql/004_metadata_auth_management.sql` 2. `resources/sql/005_metadata_project_configuration.sql` +3. `resources/sql/006_metadata_rbac_roles.sql` `004` creates Keycloak-backed metadata users and project memberships. `005` creates project and project database routing tables with uniqueness, role/type, -and pool-size constraints. +and pool-size constraints. `006` extends existing membership constraints with +the fixed delivery roles. ## Frontend System Management -`/system-admin` is shown only after `GET /api/v1/admin/me` confirms metadata -admin access. The page lets admins maintain metadata users, project members, -projects, project database routing for `biz_data` and `iot_data`, connection -health checks. This replaces direct SQL editing for normal project onboarding. +`/system-admin` is shown only when `GET /api/v1/access/context` returns +`environment.manage`. The page lets admins maintain metadata users, project +members, projects, project database routing for `biz_data` and `iot_data`, and +connection health checks. This replaces direct SQL editing for normal project +onboarding. + +Hydraulic model authoring is outside the Web application. Models are prepared +in the desktop modeling client and uploaded/imported by an authorized modeler; +the system administrator configures the project environment and database +routing. diff --git a/app/api/problem_details.py b/app/api/problem_details.py new file mode 100644 index 0000000..018bf93 --- /dev/null +++ b/app/api/problem_details.py @@ -0,0 +1,89 @@ +from __future__ import annotations + +from typing import Any +from uuid import uuid4 + +from fastapi import FastAPI, HTTPException, Request +from fastapi.exceptions import RequestValidationError +from fastapi.responses import JSONResponse +from pydantic import BaseModel, Field + + +class ProblemDetails(BaseModel): + """RFC 9457 compatible error response used by the REST contract.""" + + type: str + title: str + status: int + detail: str + instance: str + code: str + trace_id: str + errors: list[dict[str, Any]] = Field(default_factory=list) + + +def _trace_id(request: Request) -> str: + return request.headers.get("X-Request-Id") or str(uuid4()) + + +def _problem_response( + request: Request, + *, + status_code: int, + title: str, + detail: str, + code: str, + errors: list[dict[str, Any]] | None = None, +) -> JSONResponse: + problem = ProblemDetails( + type=f"https://tjwater.example/problems/{code.replace('_', '-')}", + title=title, + status=status_code, + detail=detail, + instance=request.url.path, + code=code, + trace_id=_trace_id(request), + errors=errors or [], + ) + return JSONResponse( + status_code=status_code, + content=problem.model_dump(mode="json"), + media_type="application/problem+json", + ) + + +def install_problem_details_handlers(app: FastAPI) -> None: + @app.exception_handler(RequestValidationError) + async def validation_error_handler( + request: Request, + exc: RequestValidationError, + ) -> JSONResponse: + return _problem_response( + request, + status_code=422, + title="Validation error", + detail="Request validation failed", + code="validation_error", + errors=exc.errors(), + ) + + @app.exception_handler(HTTPException) + async def http_error_handler(request: Request, exc: HTTPException) -> JSONResponse: + detail = exc.detail if isinstance(exc.detail, str) else str(exc.detail) + code_by_status = { + 401: "unauthenticated", + 403: "forbidden", + 404: "not_found", + 409: "conflict", + 422: "validation_error", + 503: "dependency_unavailable", + } + return _problem_response( + request, + status_code=exc.status_code, + title=code_by_status.get(exc.status_code, "request_error") + .replace("_", " ") + .title(), + detail=detail, + code=code_by_status.get(exc.status_code, "request_error"), + ) diff --git a/app/api/v1/endpoints/access.py b/app/api/v1/endpoints/access.py index fcf6a56..7792856 100644 --- a/app/api/v1/endpoints/access.py +++ b/app/api/v1/endpoints/access.py @@ -12,7 +12,7 @@ from app.infra.db.metadb.repositories.metadata_repository import MetadataReposit router = APIRouter() -@router.get("/access/context", response_model=AccessContextResponse) +@router.get("/access-context", response_model=AccessContextResponse) async def get_access_context( x_project_id: str | None = Header(default=None, alias="X-Project-Id"), current_user=Depends(get_current_metadata_user), diff --git a/app/api/v1/endpoints/admin_metadata.py b/app/api/v1/endpoints/admin_metadata.py index 930a3d8..b8bc55b 100644 --- a/app/api/v1/endpoints/admin_metadata.py +++ b/app/api/v1/endpoints/admin_metadata.py @@ -151,14 +151,14 @@ async def _upsert_and_audit_metadata_user( return MetadataUserResponse.model_validate(user) -@router.get("/me", response_model=MetadataUserResponse) +@router.get("/admin/users/me", response_model=MetadataUserResponse) async def get_metadata_admin_me( current_user=Depends(get_current_metadata_admin), ) -> MetadataUserResponse: return MetadataUserResponse.model_validate(current_user) -@router.post("/users/sync", response_model=MetadataUserResponse) +@router.post("/admin/user-syncs", response_model=MetadataUserResponse) async def sync_metadata_user( payload: MetadataUserSyncRequest, current_user=Depends(get_current_metadata_admin), @@ -184,7 +184,7 @@ async def sync_metadata_user( -@router.post("/users/sync/batch", response_model=List[MetadataUserSyncResult]) +@router.post("/admin/user-syncs/batches", response_model=List[MetadataUserSyncResult]) async def sync_metadata_users_batch( payload: MetadataUsersBatchSyncRequest, current_user=Depends(get_current_metadata_admin), @@ -228,7 +228,7 @@ async def sync_metadata_users_batch( return results -@router.get("/users", response_model=List[MetadataUserResponse]) +@router.get("/admin/users", response_model=List[MetadataUserResponse]) async def list_metadata_users( skip: int = Query(0, ge=0), limit: int = Query(100, ge=1, le=1000), @@ -239,7 +239,7 @@ async def list_metadata_users( return [MetadataUserResponse.model_validate(user) for user in users] -@router.get("/projects", response_model=List[AdminProjectResponse]) +@router.get("/admin/projects", response_model=List[AdminProjectResponse]) async def list_admin_projects( current_user=Depends(get_current_metadata_admin), metadata_repo: MetadataRepository = Depends(get_metadata_repository), @@ -249,7 +249,7 @@ async def list_admin_projects( @router.post( - "/projects", + "/admin/projects", response_model=AdminProjectResponse, status_code=status.HTTP_201_CREATED, ) @@ -293,7 +293,7 @@ async def create_admin_project( @router.patch( - "/projects/{project_id}", + "/admin/projects/{project_id}", response_model=AdminProjectResponse, ) async def update_admin_project( @@ -332,7 +332,7 @@ async def update_admin_project( @router.get( - "/projects/{project_id}/databases", + "/admin/projects/{project_id}/databases", response_model=List[ProjectDatabaseResponse], ) async def list_project_databases( @@ -348,7 +348,7 @@ async def list_project_databases( @router.put( - "/projects/{project_id}/databases", + "/admin/projects/{project_id}/databases", response_model=ProjectDatabaseResponse, ) async def upsert_project_database( @@ -421,7 +421,7 @@ async def upsert_project_database( @router.delete( - "/projects/{project_id}/databases/{db_role}", + "/admin/projects/{project_id}/databases/{db_role}", status_code=status.HTTP_204_NO_CONTENT, ) async def delete_project_database( @@ -449,7 +449,7 @@ async def delete_project_database( @router.post( - "/projects/{project_id}/databases/{db_role}/health", + "/admin/projects/{project_id}/databases/{db_role}/health-checks", response_model=ProjectDatabaseHealthResponse, ) async def check_project_database_health( @@ -504,7 +504,7 @@ async def check_project_database_health( ) -@router.get("/users/{user_id}", response_model=MetadataUserResponse) +@router.get("/admin/users/{user_id}", response_model=MetadataUserResponse) async def get_metadata_user( user_id: UUID = Path(...), current_user=Depends(get_current_metadata_admin), @@ -516,7 +516,7 @@ async def get_metadata_user( return MetadataUserResponse.model_validate(user) -@router.patch("/users/{user_id}", response_model=MetadataUserResponse) +@router.patch("/admin/users/{user_id}", response_model=MetadataUserResponse) async def update_metadata_user( payload: MetadataUserUpdateRequest, user_id: UUID = Path(...), @@ -549,7 +549,7 @@ async def update_metadata_user( @router.get( - "/projects/{project_id}/members", + "/admin/projects/{project_id}/members", response_model=List[ProjectMemberResponse], ) async def list_project_members( @@ -567,7 +567,7 @@ async def list_project_members( @router.post( - "/projects/{project_id}/members", + "/admin/projects/{project_id}/members", response_model=ProjectMemberResponse, status_code=status.HTTP_201_CREATED, ) @@ -622,7 +622,7 @@ async def add_project_member( @router.patch( - "/projects/{project_id}/members/{user_id}", + "/admin/projects/{project_id}/members/{user_id}", response_model=ProjectMemberResponse, ) async def update_project_member( @@ -668,7 +668,7 @@ async def update_project_member( ) -@router.delete("/projects/{project_id}/members/{user_id}", status_code=status.HTTP_204_NO_CONTENT) +@router.delete("/admin/projects/{project_id}/members/{user_id}", status_code=status.HTTP_204_NO_CONTENT) async def remove_project_member( project_id: UUID = Path(...), user_id: UUID = Path(...), diff --git a/app/api/v1/endpoints/agent_auth.py b/app/api/v1/endpoints/agent_auth.py index 3aed53b..9e2a970 100644 --- a/app/api/v1/endpoints/agent_auth.py +++ b/app/api/v1/endpoints/agent_auth.py @@ -27,7 +27,7 @@ class AgentAuthContextResponse(BaseModel): token_expires_at: str | None = None -@router.get("/agent/auth/context", response_model=AgentAuthContextResponse) +@router.get("/agent-auth-context", response_model=AgentAuthContextResponse) async def get_agent_auth_context( ctx: ProjectContext = Depends(get_project_context), current_user=Depends(get_current_metadata_user), diff --git a/app/api/v1/endpoints/audit.py b/app/api/v1/endpoints/audit.py index 871ff68..fb47d3c 100644 --- a/app/api/v1/endpoints/audit.py +++ b/app/api/v1/endpoints/audit.py @@ -29,7 +29,7 @@ async def get_audit_repository( @router.get( - "/logs", + "/audit-logs", summary="查询审计日志", description="查询审计日志(仅管理员)", response_model=list[AuditLogResponse], @@ -59,7 +59,7 @@ async def get_audit_logs( @router.get( - "/logs/count", + "/audit-logs/count", summary="获取审计日志总数", description="获取审计日志总数(仅管理员)", ) @@ -84,7 +84,7 @@ async def get_audit_logs_count( return {"count": count} -@router.post("/session-events", status_code=status.HTTP_204_NO_CONTENT) +@router.post("/audit-events", status_code=status.HTTP_204_NO_CONTENT) async def record_session_event( payload: SessionAuditEventRequest, request: Request, @@ -105,7 +105,7 @@ async def record_session_event( @router.get( - "/logs/my", + "/audit-logs/mine", summary="查询我的审计日志", description="查询当前用户的审计日志", response_model=list[AuditLogResponse], diff --git a/app/api/v1/endpoints/burst_detection.py b/app/api/v1/endpoints/burst_detection.py index 9d188d8..d9a0d17 100644 --- a/app/api/v1/endpoints/burst_detection.py +++ b/app/api/v1/endpoints/burst_detection.py @@ -48,7 +48,7 @@ class BurstDetectionRequest(BaseModel): @router.post( - "/detect/", + "/burst-detections", summary="执行爆管检测", description="基于压力观测数据和其他参数执行爆管检测分析" ) diff --git a/app/api/v1/endpoints/burst_location.py b/app/api/v1/endpoints/burst_location.py index fa5995a..e6f52d0 100644 --- a/app/api/v1/endpoints/burst_location.py +++ b/app/api/v1/endpoints/burst_location.py @@ -38,7 +38,7 @@ class BurstLocationRequest(BaseModel): @router.post( - "/locate/", + "/burst-locations", summary="执行爆管定位", description="基于压力和流量数据定位管网中的爆管位置" ) diff --git a/app/api/v1/endpoints/cache.py b/app/api/v1/endpoints/cache.py index 9e4dbdf..fee4ddc 100644 --- a/app/api/v1/endpoints/cache.py +++ b/app/api/v1/endpoints/cache.py @@ -3,7 +3,7 @@ from app.infra.cache.redis_client import redis_client router = APIRouter() -@router.post("/clearrediskey/", summary="清除单个缓存键", description="根据键名清除单个Redis缓存") +@router.delete("/redis-keys/detail", summary="清除单个缓存键", description="根据键名清除单个Redis缓存") async def fastapi_clear_redis_key(key: str = Query(..., description="缓存键名")): """ 清除单个缓存键 @@ -14,7 +14,7 @@ async def fastapi_clear_redis_key(key: str = Query(..., description="缓存键 return True -@router.post("/clearrediskeys/", summary="清除匹配的缓存键", description="根据模式清除匹配的Redis缓存键") +@router.delete("/redis-keys", summary="清除匹配的缓存键", description="根据模式清除匹配的Redis缓存键") async def fastapi_clear_redis_keys(keys: str = Query(..., description="缓存键模式(支持通配符)")): """ 清除匹配的缓存键 @@ -29,7 +29,7 @@ async def fastapi_clear_redis_keys(keys: str = Query(..., description="缓存键 return True -@router.post("/clearallredis/", summary="清除所有缓存", description="清空整个Redis数据库的所有缓存") +@router.delete("/all-redis", summary="清除所有缓存", description="清空整个Redis数据库的所有缓存") async def fastapi_clear_all_redis(): """ 清除所有缓存 @@ -40,7 +40,7 @@ async def fastapi_clear_all_redis(): return True -@router.get("/queryredis/", summary="查询缓存键列表", description="获取Redis中所有的缓存键") +@router.get("/redis", summary="查询缓存键列表", description="获取Redis中所有的缓存键") async def fastapi_query_redis(): """ 查询缓存键列表 diff --git a/app/api/v1/endpoints/components/controls.py b/app/api/v1/endpoints/components/controls.py index 2ff6525..d406f20 100644 --- a/app/api/v1/endpoints/components/controls.py +++ b/app/api/v1/endpoints/components/controls.py @@ -13,7 +13,7 @@ from app.services.tjnetwork import ( router = APIRouter() -@router.get("/getcontrolschema/", summary="获取控制架构", description="获取网络中控制对象的架构定义") +@router.get("/network-schemas/control", summary="获取控制架构", description="获取网络中控制对象的架构定义") async def fastapi_get_control_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取控制架构。 @@ -21,7 +21,7 @@ async def fastapi_get_control_schema(network: str = Query(..., description="管 """ return get_control_schema(network) -@router.get("/getcontrolproperties/", summary="获取控制属性", description="获取指定网络中的控制属性信息") +@router.get("/controls/properties", summary="获取控制属性", description="获取指定网络中的控制属性信息") async def fastapi_get_control_properties(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, Any]: """获取控制属性。 @@ -29,7 +29,7 @@ async def fastapi_get_control_properties(network: str = Query(..., description=" """ return get_control(network) -@router.post("/setcontrolproperties/", response_model=None, summary="设置控制属性", description="更新指定网络中的控制属性") +@router.patch("/controls/properties", response_model=None, summary="设置控制属性", description="更新指定网络中的控制属性") async def fastapi_set_control_properties( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -41,7 +41,7 @@ async def fastapi_set_control_properties( props = await req.json() return set_control(network, ChangeSet(props)) -@router.get("/getruleschema/", summary="获取规则架构", description="获取网络中规则对象的架构定义") +@router.get("/rule-schemas", summary="获取规则架构", description="获取网络中规则对象的架构定义") async def fastapi_get_rule_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取规则架构。 @@ -49,7 +49,7 @@ async def fastapi_get_rule_schema(network: str = Query(..., description="管网 """ return get_rule_schema(network) -@router.get("/getruleproperties/", summary="获取规则属性", description="获取指定网络中的规则属性信息") +@router.get("/rule-properties", summary="获取规则属性", description="获取指定网络中的规则属性信息") async def fastapi_get_rule_properties(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, Any]: """获取规则属性。 @@ -57,7 +57,7 @@ async def fastapi_get_rule_properties(network: str = Query(..., description="管 """ return get_rule(network) -@router.post("/setruleproperties/", response_model=None, summary="设置规则属性", description="更新指定网络中的规则属性") +@router.patch("/rule-properties", response_model=None, summary="设置规则属性", description="更新指定网络中的规则属性") async def fastapi_set_rule_properties( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None diff --git a/app/api/v1/endpoints/components/curves.py b/app/api/v1/endpoints/components/curves.py index 8b2b45a..c462dab 100644 --- a/app/api/v1/endpoints/components/curves.py +++ b/app/api/v1/endpoints/components/curves.py @@ -14,7 +14,7 @@ from app.services.tjnetwork import ( router = APIRouter() -@router.get("/getcurveschema", summary="获取曲线架构", description="获取网络中曲线对象的架构定义") +@router.get("/network-schemas/curve", summary="获取曲线架构", description="获取网络中曲线对象的架构定义") async def fastapi_get_curve_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取曲线架构。 @@ -22,7 +22,7 @@ async def fastapi_get_curve_schema(network: str = Query(..., description="管网 """ return get_curve_schema(network) -@router.post("/addcurve/", response_model=None, summary="添加曲线", description="在网络中添加一条新的曲线") +@router.post("/curves", response_model=None, summary="添加曲线", description="在网络中添加一条新的曲线") async def fastapi_add_curve( network: str = Query(..., description="管网名称(或数据库名称)"), curve: str = Query(..., description="曲线ID"), @@ -38,7 +38,7 @@ async def fastapi_add_curve( } | props return add_curve(network, ChangeSet(ps)) -@router.post("/deletecurve/", response_model=None, summary="删除曲线", description="从网络中删除指定的曲线") +@router.delete("/curves", response_model=None, summary="删除曲线", description="从网络中删除指定的曲线") async def fastapi_delete_curve( network: str = Query(..., description="管网名称(或数据库名称)"), curve: str = Query(..., description="曲线ID") @@ -50,7 +50,7 @@ async def fastapi_delete_curve( ps = {"id": curve} return delete_curve(network, ChangeSet(ps)) -@router.get("/getcurveproperties/", summary="获取曲线属性", description="获取指定曲线的属性信息") +@router.get("/curves/properties", summary="获取曲线属性", description="获取指定曲线的属性信息") async def fastapi_get_curve_properties( network: str = Query(..., description="管网名称(或数据库名称)"), curve: str = Query(..., description="曲线ID") @@ -61,7 +61,7 @@ async def fastapi_get_curve_properties( """ return get_curve(network, curve) -@router.post("/setcurveproperties/", response_model=None, summary="设置曲线属性", description="更新指定曲线的属性") +@router.patch("/curves/properties", response_model=None, summary="设置曲线属性", description="更新指定曲线的属性") async def fastapi_set_curve_properties( network: str = Query(..., description="管网名称(或数据库名称)"), curve: str = Query(..., description="曲线ID"), @@ -75,7 +75,7 @@ async def fastapi_set_curve_properties( ps = {"id": curve} | props return set_curve(network, ChangeSet(ps)) -@router.get("/getcurves/", summary="获取所有曲线", description="获取网络中的所有曲线列表") +@router.get("/curves", summary="获取所有曲线", description="获取网络中的所有曲线列表") async def fastapi_get_curves(network: str = Query(..., description="管网名称(或数据库名称)")) -> list[str]: """获取所有曲线。 @@ -83,7 +83,7 @@ async def fastapi_get_curves(network: str = Query(..., description="管网名称 """ return get_curves(network) -@router.get("/iscurve/", summary="检查曲线存在性", description="检查指定的曲线是否存在") +@router.get("/curves/existence", summary="检查曲线存在性", description="检查指定的曲线是否存在") async def fastapi_is_curve( network: str = Query(..., description="管网名称(或数据库名称)"), curve: str = Query(..., description="曲线ID") diff --git a/app/api/v1/endpoints/components/options.py b/app/api/v1/endpoints/components/options.py index 8506563..21083ee 100644 --- a/app/api/v1/endpoints/components/options.py +++ b/app/api/v1/endpoints/components/options.py @@ -19,7 +19,7 @@ from app.services.tjnetwork import ( router = APIRouter() -@router.get("/gettimeschema", summary="获取时间选项架构", description="获取网络中时间选项的架构定义") +@router.get("/network-schemas/time", summary="获取时间选项架构", description="获取网络中时间选项的架构定义") async def fastapi_get_time_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取时间选项架构。 @@ -27,7 +27,7 @@ async def fastapi_get_time_schema(network: str = Query(..., description="管网 """ return get_time_schema(network) -@router.get("/gettimeproperties/", summary="获取时间选项属性", description="获取指定网络中的时间选项属性信息") +@router.get("/network-options/time", summary="获取时间选项属性", description="获取指定网络中的时间选项属性信息") async def fastapi_get_time_properties(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, Any]: """获取时间选项属性。 @@ -35,7 +35,7 @@ async def fastapi_get_time_properties(network: str = Query(..., description="管 """ return get_time(network) -@router.post("/settimeproperties/", response_model=None, summary="设置时间选项属性", description="更新指定网络中的时间选项属性") +@router.patch("/time-properties", response_model=None, summary="设置时间选项属性", description="更新指定网络中的时间选项属性") async def fastapi_set_time_properties( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -47,7 +47,7 @@ async def fastapi_set_time_properties( props = await req.json() return set_time(network, ChangeSet(props)) -@router.get("/getenergyschema/", summary="获取能耗选项架构", description="获取网络中能耗选项的架构定义") +@router.get("/network-schemas/energy", summary="获取能耗选项架构", description="获取网络中能耗选项的架构定义") async def fastapi_get_energy_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取能耗选项架构。 @@ -55,7 +55,7 @@ async def fastapi_get_energy_schema(network: str = Query(..., description="管 """ return get_energy_schema(network) -@router.get("/getenergyproperties/", summary="获取能耗选项属性", description="获取指定网络中的能耗选项属性信息") +@router.get("/network-options/energy", summary="获取能耗选项属性", description="获取指定网络中的能耗选项属性信息") async def fastapi_get_energy_properties(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, Any]: """获取能耗选项属性。 @@ -63,7 +63,7 @@ async def fastapi_get_energy_properties(network: str = Query(..., description=" """ return get_energy(network) -@router.post("/setenergyproperties/", response_model=None, summary="设置能耗选项属性", description="更新指定网络中的能耗选项属性") +@router.patch("/energy-properties", response_model=None, summary="设置能耗选项属性", description="更新指定网络中的能耗选项属性") async def fastapi_set_energy_properties( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -75,7 +75,7 @@ async def fastapi_set_energy_properties( props = await req.json() return set_energy(network, ChangeSet(props)) -@router.get("/getpumpenergyschema/", summary="获取泵能耗选项架构", description="获取网络中泵能耗选项的架构定义") +@router.get("/network-schemas/pump-energy", summary="获取泵能耗选项架构", description="获取网络中泵能耗选项的架构定义") async def fastapi_get_pump_energy_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取泵能耗选项架构。 @@ -83,7 +83,7 @@ async def fastapi_get_pump_energy_schema(network: str = Query(..., description=" """ return get_pump_energy_schema(network) -@router.get("/getpumpenergyproperties//", summary="获取泵能耗属性", description="获取指定泵的能耗属性信息") +@router.get("/network-options/pump-energy", summary="获取泵能耗属性", description="获取指定泵的能耗属性信息") async def fastapi_get_pump_energy_proeprties( network: str = Query(..., description="管网名称(或数据库名称)"), pump: str = Query(..., description="泵ID") @@ -94,7 +94,7 @@ async def fastapi_get_pump_energy_proeprties( """ return get_pump_energy(network, pump) -@router.get("/setpumpenergyproperties//", response_model=None, summary="设置泵能耗属性", description="更新指定泵的能耗属性") +@router.patch("/network-options/pump-energy", response_model=None, summary="设置泵能耗属性", description="更新指定泵的能耗属性") async def fastapi_set_pump_energy_properties( network: str = Query(..., description="管网名称(或数据库名称)"), pump: str = Query(..., description="泵ID"), @@ -108,7 +108,7 @@ async def fastapi_set_pump_energy_properties( ps = {"id": pump} | props return set_pump_energy(network, ChangeSet(ps)) -@router.get("/getoptionschema/", summary="获取选项架构", description="获取网络中选项对象的架构定义") +@router.get("/network-schemas/option", summary="获取选项架构", description="获取网络中选项对象的架构定义") async def fastapi_get_option_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取选项架构。 @@ -116,7 +116,7 @@ async def fastapi_get_option_schema(network: str = Query(..., description="管 """ return get_option_v3_schema(network) -@router.get("/getoptionproperties/", summary="获取选项属性", description="获取指定网络中的选项属性信息") +@router.get("/network-options", summary="获取选项属性", description="获取指定网络中的选项属性信息") async def fastapi_get_option_properties(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, Any]: """获取选项属性。 @@ -124,7 +124,7 @@ async def fastapi_get_option_properties(network: str = Query(..., description=" """ return get_option_v3(network) -@router.post("/setoptionproperties/", response_model=None, summary="设置选项属性", description="更新指定网络中的选项属性") +@router.patch("/network-options", response_model=None, summary="设置选项属性", description="更新指定网络中的选项属性") async def fastapi_set_option_properties( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None diff --git a/app/api/v1/endpoints/components/patterns.py b/app/api/v1/endpoints/components/patterns.py index f73eb21..bb6daea 100644 --- a/app/api/v1/endpoints/components/patterns.py +++ b/app/api/v1/endpoints/components/patterns.py @@ -14,7 +14,7 @@ from app.services.tjnetwork import ( router = APIRouter() -@router.get("/getpatternschema", summary="获取模式架构", description="获取网络中模式对象的架构定义") +@router.get("/network-schemas/pattern", summary="获取模式架构", description="获取网络中模式对象的架构定义") async def fastapi_get_pattern_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取模式架构。 @@ -22,7 +22,7 @@ async def fastapi_get_pattern_schema(network: str = Query(..., description="管 """ return get_pattern_schema(network) -@router.post("/addpattern/", response_model=None, summary="添加模式", description="在网络中添加一个新的模式") +@router.post("/patterns", response_model=None, summary="添加模式", description="在网络中添加一个新的模式") async def fastapi_add_pattern( network: str = Query(..., description="管网名称(或数据库名称)"), pattern: str = Query(..., description="模式ID"), @@ -38,7 +38,7 @@ async def fastapi_add_pattern( } | props return add_pattern(network, ChangeSet(ps)) -@router.post("/deletepattern/", response_model=None, summary="删除模式", description="从网络中删除指定的模式") +@router.delete("/patterns", response_model=None, summary="删除模式", description="从网络中删除指定的模式") async def fastapi_delete_pattern( network: str = Query(..., description="管网名称(或数据库名称)"), pattern: str = Query(..., description="模式ID") @@ -50,7 +50,7 @@ async def fastapi_delete_pattern( ps = {"id": pattern} return delete_pattern(network, ChangeSet(ps)) -@router.get("/getpatternproperties/", summary="获取模式属性", description="获取指定模式的属性信息") +@router.get("/patterns/properties", summary="获取模式属性", description="获取指定模式的属性信息") async def fastapi_get_pattern_properties( network: str = Query(..., description="管网名称(或数据库名称)"), pattern: str = Query(..., description="模式ID") @@ -61,7 +61,7 @@ async def fastapi_get_pattern_properties( """ return get_pattern(network, pattern) -@router.post("/setpatternproperties/", response_model=None, summary="设置模式属性", description="更新指定模式的属性") +@router.patch("/patterns/properties", response_model=None, summary="设置模式属性", description="更新指定模式的属性") async def fastapi_set_pattern_properties( network: str = Query(..., description="管网名称(或数据库名称)"), pattern: str = Query(..., description="模式ID"), @@ -75,7 +75,7 @@ async def fastapi_set_pattern_properties( ps = {"id": pattern} | props return set_pattern(network, ChangeSet(ps)) -@router.get("/ispattern/", summary="检查模式存在性", description="检查指定的模式是否存在") +@router.get("/patterns/existence", summary="检查模式存在性", description="检查指定的模式是否存在") async def fastapi_is_pattern( network: str = Query(..., description="管网名称(或数据库名称)"), pattern: str = Query(..., description="模式ID") @@ -86,7 +86,7 @@ async def fastapi_is_pattern( """ return is_pattern(network, pattern) -@router.get("/getpatterns/", summary="获取所有模式", description="获取网络中的所有模式列表") +@router.get("/patterns", summary="获取所有模式", description="获取网络中的所有模式列表") async def fastapi_get_patterns(network: str = Query(..., description="管网名称(或数据库名称)")) -> list[str]: """获取所有模式。 diff --git a/app/api/v1/endpoints/components/quality.py b/app/api/v1/endpoints/components/quality.py index cef72cf..db3c6ca 100644 --- a/app/api/v1/endpoints/components/quality.py +++ b/app/api/v1/endpoints/components/quality.py @@ -32,7 +32,7 @@ from app.services.tjnetwork import ( router = APIRouter() -@router.get("/getqualityschema/", summary="获取水质架构", description="获取网络中水质对象的架构定义") +@router.get("/network-schemas/quality", summary="获取水质架构", description="获取网络中水质对象的架构定义") async def fastapi_get_quality_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取水质架构。 @@ -40,7 +40,7 @@ async def fastapi_get_quality_schema(network: str = Query(..., description="管 """ return get_quality_schema(network) -@router.get("/getqualityproperties/", summary="获取水质属性", description="获取指定节点的水质属性信息") +@router.get("/quality-configurations/properties", summary="获取水质属性", description="获取指定节点的水质属性信息") async def fastapi_get_quality_properties( network: str = Query(..., description="管网名称(或数据库名称)"), node: str = Query(..., description="节点ID") @@ -51,7 +51,7 @@ async def fastapi_get_quality_properties( """ return get_quality(network, node) -@router.post("/setqualityproperties/", response_model=None, summary="设置水质属性", description="更新指定节点的水质属性") +@router.patch("/quality-configurations/properties", response_model=None, summary="设置水质属性", description="更新指定节点的水质属性") async def fastapi_set_quality_properties( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -63,7 +63,7 @@ async def fastapi_set_quality_properties( props = await req.json() return set_quality(network, ChangeSet(props)) -@router.get("/getemitterschema", summary="获取发射器架构", description="获取网络中发射器对象的架构定义") +@router.get("/network-schemas/emitter", summary="获取发射器架构", description="获取网络中发射器对象的架构定义") async def fastapi_get_emitter_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取发射器架构。 @@ -71,7 +71,7 @@ async def fastapi_get_emitter_schema(network: str = Query(..., description="管 """ return get_emitter_schema(network) -@router.get("/getemitterproperties/", summary="获取发射器属性", description="获取指定连接点的发射器属性信息") +@router.get("/emitters/properties", summary="获取发射器属性", description="获取指定连接点的发射器属性信息") async def fastapi_get_emitter_properties( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="连接点ID") @@ -82,7 +82,7 @@ async def fastapi_get_emitter_properties( """ return get_emitter(network, junction) -@router.post("/setemitterproperties/", response_model=None, summary="设置发射器属性", description="更新指定连接点的发射器属性") +@router.patch("/emitters/properties", response_model=None, summary="设置发射器属性", description="更新指定连接点的发射器属性") async def fastapi_set_emitter_properties( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="连接点ID"), @@ -96,7 +96,7 @@ async def fastapi_set_emitter_properties( ps = {"junction": junction} | props return set_emitter(network, ChangeSet(ps)) -@router.get("/getsourcechema/", summary="获取水源架构", description="获取网络中水源对象的架构定义") +@router.get("/network-schemas/source", summary="获取水源架构", description="获取网络中水源对象的架构定义") async def fastapi_get_source_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取水源架构。 @@ -104,7 +104,7 @@ async def fastapi_get_source_schema(network: str = Query(..., description="管 """ return get_source_schema(network) -@router.get("/getsource/", summary="获取水源属性", description="获取指定节点的水源属性信息") +@router.get("/sources/detail", summary="获取水源属性", description="获取指定节点的水源属性信息") async def fastapi_get_source( network: str = Query(..., description="管网名称(或数据库名称)"), node: str = Query(..., description="节点ID") @@ -115,7 +115,7 @@ async def fastapi_get_source( """ return get_source(network, node) -@router.post("/setsource/", response_model=None, summary="设置水源属性", description="更新指定节点的水源属性") +@router.patch("/sources", response_model=None, summary="设置水源属性", description="更新指定节点的水源属性") async def fastapi_set_source( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -127,7 +127,7 @@ async def fastapi_set_source( props = await req.json() return set_source(network, ChangeSet(props)) -@router.post("/addsource/", response_model=None, summary="添加水源", description="在网络中添加一个新的水源") +@router.post("/sources", response_model=None, summary="添加水源", description="在网络中添加一个新的水源") async def fastapi_add_source( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -139,7 +139,7 @@ async def fastapi_add_source( props = await req.json() return add_source(network, ChangeSet(props)) -@router.post("/deletesource/", response_model=None, summary="删除水源", description="从网络中删除指定节点的水源") +@router.delete("/sources", response_model=None, summary="删除水源", description="从网络中删除指定节点的水源") async def fastapi_delete_source( network: str = Query(..., description="管网名称(或数据库名称)"), node: str = Query(..., description="节点ID") @@ -151,7 +151,7 @@ async def fastapi_delete_source( props = {"node": node} return delete_source(network, ChangeSet(props)) -@router.get("/getreactionschema/", summary="获取反应架构", description="获取网络中反应对象的架构定义") +@router.get("/network-schemas/reaction", summary="获取反应架构", description="获取网络中反应对象的架构定义") async def fastapi_get_reaction_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取反应架构。 @@ -159,7 +159,7 @@ async def fastapi_get_reaction_schema(network: str = Query(..., description="管 """ return get_reaction_schema(network) -@router.get("/getreaction/", summary="获取反应属性", description="获取指定网络中的反应属性信息") +@router.get("/reactions/detail", summary="获取反应属性", description="获取指定网络中的反应属性信息") async def fastapi_get_reaction(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, Any]: """获取反应属性。 @@ -167,7 +167,7 @@ async def fastapi_get_reaction(network: str = Query(..., description="管网名 """ return get_reaction(network) -@router.post("/setreaction/", response_model=None, summary="设置反应属性", description="更新指定网络中的反应属性") +@router.patch("/reactions", response_model=None, summary="设置反应属性", description="更新指定网络中的反应属性") async def fastapi_set_reaction( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -179,7 +179,7 @@ async def fastapi_set_reaction( props = await req.json() return set_reaction(network, ChangeSet(props)) -@router.get("/getpipereactionschema/", summary="获取管道反应架构", description="获取网络中管道反应对象的架构定义") +@router.get("/network-schemas/pipe-reaction", summary="获取管道反应架构", description="获取网络中管道反应对象的架构定义") async def fastapi_get_pipe_reaction_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取管道反应架构。 @@ -187,7 +187,7 @@ async def fastapi_get_pipe_reaction_schema(network: str = Query(..., description """ return get_pipe_reaction_schema(network) -@router.get("/getpipereaction/", summary="获取管道反应属性", description="获取指定管道的反应属性信息") +@router.get("/pipe-reactions/detail", summary="获取管道反应属性", description="获取指定管道的反应属性信息") async def fastapi_get_pipe_reaction( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID") @@ -198,7 +198,7 @@ async def fastapi_get_pipe_reaction( """ return get_pipe_reaction(network, pipe) -@router.post("/setpipereaction/", response_model=None, summary="设置管道反应属性", description="更新指定管道的反应属性") +@router.patch("/pipe-reactions", response_model=None, summary="设置管道反应属性", description="更新指定管道的反应属性") async def fastapi_set_pipe_reaction( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -210,7 +210,7 @@ async def fastapi_set_pipe_reaction( props = await req.json() return set_pipe_reaction(network, ChangeSet(props)) -@router.get("/gettankreactionschema/", summary="获取水池反应架构", description="获取网络中水池反应对象的架构定义") +@router.get("/network-schemas/tank-reaction", summary="获取水池反应架构", description="获取网络中水池反应对象的架构定义") async def fastapi_get_tank_reaction_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取水池反应架构。 @@ -218,7 +218,7 @@ async def fastapi_get_tank_reaction_schema(network: str = Query(..., description """ return get_tank_reaction_schema(network) -@router.get("/gettankreaction/", summary="获取水池反应属性", description="获取指定水池的反应属性信息") +@router.get("/tank-reactions/detail", summary="获取水池反应属性", description="获取指定水池的反应属性信息") async def fastapi_get_tank_reaction( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水池ID") @@ -229,7 +229,7 @@ async def fastapi_get_tank_reaction( """ return get_tank_reaction(network, tank) -@router.post("/settankreaction/", response_model=None, summary="设置水池反应属性", description="更新指定水池的反应属性") +@router.patch("/tank-reactions", response_model=None, summary="设置水池反应属性", description="更新指定水池的反应属性") async def fastapi_set_tank_reaction( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -241,7 +241,7 @@ async def fastapi_set_tank_reaction( props = await req.json() return set_tank_reaction(network, ChangeSet(props)) -@router.get("/getmixingschema/", summary="获取混合架构", description="获取网络中混合对象的架构定义") +@router.get("/network-schemas/mixing", summary="获取混合架构", description="获取网络中混合对象的架构定义") async def fastapi_get_mixing_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取混合架构。 @@ -249,7 +249,7 @@ async def fastapi_get_mixing_schema(network: str = Query(..., description="管 """ return get_mixing_schema(network) -@router.get("/getmixing/", summary="获取混合属性", description="获取指定水池的混合属性信息") +@router.get("/mixing-configurations/detail", summary="获取混合属性", description="获取指定水池的混合属性信息") async def fastapi_get_mixing( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水池ID") @@ -260,7 +260,7 @@ async def fastapi_get_mixing( """ return get_mixing(network, tank) -@router.post("/setmixing/", response_model=None, summary="设置混合属性", description="更新指定水池的混合属性") +@router.patch("/mixing-configurations", response_model=None, summary="设置混合属性", description="更新指定水池的混合属性") async def fastapi_set_mixing( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -272,7 +272,7 @@ async def fastapi_set_mixing( props = await req.json() return api.set_mixing(network, ChangeSet(props)) -@router.post("/addmixing/", response_model=None, summary="添加混合", description="在网络中添加一个新的混合") +@router.post("/mixing-configurations", response_model=None, summary="添加混合", description="在网络中添加一个新的混合") async def fastapi_add_mixing( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -284,7 +284,7 @@ async def fastapi_add_mixing( props = await req.json() return add_mixing(network, ChangeSet(props)) -@router.post("/deletemixing/", response_model=None, summary="删除混合", description="从网络中删除指定的混合") +@router.delete("/mixing-configurations", response_model=None, summary="删除混合", description="从网络中删除指定的混合") async def fastapi_delete_mixing( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None diff --git a/app/api/v1/endpoints/components/visuals.py b/app/api/v1/endpoints/components/visuals.py index aabd191..7764d86 100644 --- a/app/api/v1/endpoints/components/visuals.py +++ b/app/api/v1/endpoints/components/visuals.py @@ -24,7 +24,7 @@ import json router = APIRouter() -@router.get("/getvertexschema/", summary="获取图形元素架构", description="获取网络中图形元素对象的架构定义") +@router.get("/network-schemas/vertex", summary="获取图形元素架构", description="获取网络中图形元素对象的架构定义") async def fastapi_get_vertex_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取图形元素架构。 @@ -32,7 +32,7 @@ async def fastapi_get_vertex_schema(network: str = Query(..., description="管 """ return get_vertex_schema(network) -@router.get("/getvertexproperties/", summary="获取图形元素属性", description="获取指定图形元素的属性信息") +@router.get("/visual-elements/properties", summary="获取图形元素属性", description="获取指定图形元素的属性信息") async def fastapi_get_vertex_properties( network: str = Query(..., description="管网名称(或数据库名称)"), link: str = Query(..., description="图形元素链接") @@ -43,7 +43,7 @@ async def fastapi_get_vertex_properties( """ return get_vertex(network, link) -@router.post("/setvertexproperties/", response_model=None, summary="设置图形元素属性", description="更新指定图形元素的属性") +@router.patch("/visual-elements/properties", response_model=None, summary="设置图形元素属性", description="更新指定图形元素的属性") async def fastapi_set_vertex_properties( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -55,7 +55,7 @@ async def fastapi_set_vertex_properties( props = await req.json() return set_vertex(network, ChangeSet(props)) -@router.post("/addvertex/", response_model=None, summary="添加图形元素", description="在网络中添加一个新的图形元素") +@router.post("/visual-elements", response_model=None, summary="添加图形元素", description="在网络中添加一个新的图形元素") async def fastapi_add_vertex( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -67,7 +67,7 @@ async def fastapi_add_vertex( props = await req.json() return add_vertex(network, ChangeSet(props)) -@router.post("/deletevertex/", response_model=None, summary="删除图形元素", description="从网络中删除指定的图形元素") +@router.delete("/visual-elements", response_model=None, summary="删除图形元素", description="从网络中删除指定的图形元素") async def fastapi_delete_vertex( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -79,7 +79,7 @@ async def fastapi_delete_vertex( props = await req.json() return delete_vertex(network, ChangeSet(props)) -@router.get("/getallvertexlinks/", response_class=PlainTextResponse, summary="获取所有图形元素链接", description="获取网络中的所有图形元素链接列表") +@router.get("/visual-elements/links", response_class=PlainTextResponse, summary="获取所有图形元素链接", description="获取网络中的所有图形元素链接列表") async def fastapi_get_all_vertex_links(network: str = Query(..., description="管网名称(或数据库名称)")) -> list[str]: """获取所有图形元素链接。 @@ -87,7 +87,7 @@ async def fastapi_get_all_vertex_links(network: str = Query(..., description=" """ return json.dumps(get_all_vertex_links(network)) -@router.get("/getallvertices/", response_class=PlainTextResponse, summary="获取所有图形元素", description="获取网络中的所有图形元素详细信息") +@router.get("/all-vertices", response_class=PlainTextResponse, summary="获取所有图形元素", description="获取网络中的所有图形元素详细信息") async def fastapi_get_all_vertices(network: str = Query(..., description="管网名称(或数据库名称)")) -> list[dict[str, Any]]: """获取所有图形元素。 @@ -95,7 +95,7 @@ async def fastapi_get_all_vertices(network: str = Query(..., description="管网 """ return json.dumps(get_all_vertices(network)) -@router.get("/getlabelschema/", summary="获取标签架构", description="获取网络中标签对象的架构定义") +@router.get("/network-schemas/label", summary="获取标签架构", description="获取网络中标签对象的架构定义") async def fastapi_get_label_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取标签架构。 @@ -103,7 +103,7 @@ async def fastapi_get_label_schema(network: str = Query(..., description="管网 """ return get_label_schema(network) -@router.get("/getlabelproperties/", summary="获取标签属性", description="获取指定坐标处的标签属性信息") +@router.get("/labels/properties", summary="获取标签属性", description="获取指定坐标处的标签属性信息") async def fastapi_get_label_properties( network: str = Query(..., description="管网名称(或数据库名称)"), x: float = Query(..., description="X坐标"), @@ -115,7 +115,7 @@ async def fastapi_get_label_properties( """ return get_label(network, x, y) -@router.post("/setlabelproperties/", response_model=None, summary="设置标签属性", description="更新指定标签的属性") +@router.patch("/labels/properties", response_model=None, summary="设置标签属性", description="更新指定标签的属性") async def fastapi_set_label_properties( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -127,7 +127,7 @@ async def fastapi_set_label_properties( props = await req.json() return set_label(network, ChangeSet(props)) -@router.post("/addlabel/", response_model=None, summary="添加标签", description="在网络中添加一个新的标签") +@router.post("/labels", response_model=None, summary="添加标签", description="在网络中添加一个新的标签") async def fastapi_add_label( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -139,7 +139,7 @@ async def fastapi_add_label( props = await req.json() return add_label(network, ChangeSet(props)) -@router.post("/deletelabel/", response_model=None, summary="删除标签", description="从网络中删除指定的标签") +@router.delete("/labels", response_model=None, summary="删除标签", description="从网络中删除指定的标签") async def fastapi_delete_label( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -151,7 +151,7 @@ async def fastapi_delete_label( props = await req.json() return delete_label(network, ChangeSet(props)) -@router.get("/getbackdropschema/", summary="获取背景架构", description="获取网络中背景对象的架构定义") +@router.get("/network-schemas/backdrop", summary="获取背景架构", description="获取网络中背景对象的架构定义") async def fastapi_get_backdrop_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """获取背景架构。 @@ -159,7 +159,7 @@ async def fastapi_get_backdrop_schema(network: str = Query(..., description="管 """ return get_backdrop_schema(network) -@router.get("/getbackdropproperties/", summary="获取背景属性", description="获取指定网络的背景属性信息") +@router.get("/backdrops/properties", summary="获取背景属性", description="获取指定网络的背景属性信息") async def fastapi_get_backdrop_properties(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, Any]: """获取背景属性。 @@ -167,7 +167,7 @@ async def fastapi_get_backdrop_properties(network: str = Query(..., description= """ return get_backdrop(network) -@router.post("/setbackdropproperties/", response_model=None, summary="设置背景属性", description="更新指定网络的背景属性") +@router.patch("/backdrops/properties", response_model=None, summary="设置背景属性", description="更新指定网络的背景属性") async def fastapi_set_backdrop_properties( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None diff --git a/app/api/v1/endpoints/extension.py b/app/api/v1/endpoints/extension.py index affb9f2..d9ce025 100644 --- a/app/api/v1/endpoints/extension.py +++ b/app/api/v1/endpoints/extension.py @@ -11,7 +11,7 @@ from app.services.tjnetwork import ( router = APIRouter() @router.get( - "/getallextensiondatakeys/", + "/all-extension-data-keys", summary="获取所有扩展数据键", description="获取指定网络的所有扩展数据的键列表" ) @@ -32,7 +32,7 @@ async def get_all_extension_data_keys_endpoint( return get_all_extension_data_keys(network) @router.get( - "/getallextensiondata/", + "/all-extension-datas", summary="获取所有扩展数据", description="获取指定网络的所有扩展数据" ) @@ -53,7 +53,7 @@ async def get_all_extension_data_endpoint( return get_all_extension_data(network) @router.get( - "/getextensiondata/", + "/extension-datas", summary="获取指定扩展数据", description="获取指定网络中指定键的扩展数据值" ) @@ -75,8 +75,8 @@ async def get_extension_data_endpoint( """ return get_extension_data(network, key) -@router.post( - "/setextensiondata/", +@router.patch( + "/extension-datas", response_model=None, summary="设置扩展数据", description="设置指定网络中的扩展数据" diff --git a/app/api/v1/endpoints/geocoding.py b/app/api/v1/endpoints/geocoding.py index 24c6797..c436d9e 100644 --- a/app/api/v1/endpoints/geocoding.py +++ b/app/api/v1/endpoints/geocoding.py @@ -13,7 +13,7 @@ router = APIRouter() @router.post( - "/tianditu/geocode", + "/geocoding-requests", summary="Tianditu Geocoding", description="调用天地图地理编码服务,将结构化地址转换为经纬度", ) diff --git a/app/api/v1/endpoints/leakage.py b/app/api/v1/endpoints/leakage.py index c57f95b..1af055e 100644 --- a/app/api/v1/endpoints/leakage.py +++ b/app/api/v1/endpoints/leakage.py @@ -38,7 +38,7 @@ class LeakageIdentifyRequest(BaseModel): @router.post( - "/identify/", + "/leakage-identifications", summary="执行漏损识别", description="基于压力观测数据和遗传算法识别管网中的漏损位置和大小" ) diff --git a/app/api/v1/endpoints/meta.py b/app/api/v1/endpoints/meta.py index 969c471..a84b197 100644 --- a/app/api/v1/endpoints/meta.py +++ b/app/api/v1/endpoints/meta.py @@ -25,7 +25,7 @@ router = APIRouter() logger = logging.getLogger(__name__) -@router.get("/meta/project", summary="获取项目元数据", description="获取当前项目的元数据和配置信息", response_model=ProjectMetaResponse) +@router.get("/projects/current/metadata", summary="获取项目元数据", description="获取当前项目的元数据和配置信息", response_model=ProjectMetaResponse) async def get_project_metadata( ctx: ProjectContext = Depends(get_project_context), metadata_repo: MetadataRepository = Depends(get_metadata_repository), @@ -52,7 +52,7 @@ async def get_project_metadata( ) -@router.get("/meta/projects", summary="列出用户项目", description="获取当前用户有权限的所有项目列表", response_model=list[ProjectSummaryResponse]) +@router.get("/projects", summary="列出用户项目", description="获取当前用户有权限的所有项目列表", response_model=list[ProjectSummaryResponse]) async def list_user_projects( current_user=Depends(get_current_metadata_user), metadata_repo: MetadataRepository = Depends(get_metadata_repository), @@ -88,7 +88,7 @@ async def list_user_projects( ] -@router.get("/meta/db/health", summary="检查数据库健康状态", description="检查项目数据库连接的健康状况") +@router.get("/projects/current/database-health", summary="检查数据库健康状态", description="检查项目数据库连接的健康状况") async def project_db_health( pg_session: AsyncSession = Depends(get_project_pg_session), ts_conn: AsyncConnection = Depends(get_project_timescale_connection), diff --git a/app/api/v1/endpoints/misc.py b/app/api/v1/endpoints/misc.py index 5500268..255fe47 100644 --- a/app/api/v1/endpoints/misc.py +++ b/app/api/v1/endpoints/misc.py @@ -11,7 +11,6 @@ from app.services.tjnetwork import ( router = APIRouter() -@router.get("/getjson/", summary="获取JSON示例", description="获取JSON格式响应示例") async def fastapi_get_json(): """ 获取JSON示例 @@ -29,7 +28,6 @@ async def fastapi_get_json(): @router.get("/sensor-placement-schemes", summary="获取所有传感器位置", description="获取网络中所有传感器的放置位置信息") -@router.get("/getallsensorplacements/", summary="获取所有传感器位置(旧路径)", description="获取网络中所有传感器的放置位置信息", deprecated=True) async def fastapi_get_all_sensor_placements(network: str = Query(..., description="管网名称(或数据库名称)")) -> list[dict[Any, Any]]: """ 获取所有传感器位置 @@ -39,7 +37,7 @@ async def fastapi_get_all_sensor_placements(network: str = Query(..., descriptio return get_all_sensor_placements(network) -@router.get("/getallburstlocateresults/", summary="获取所有爆管定位结果", description="获取网络中所有爆管定位的分析结果") +@router.get("/burst-locations", summary="获取所有爆管定位结果", description="获取网络中所有爆管定位的分析结果") async def fastapi_get_all_burst_locate_results(network: str = Query(..., description="管网名称(或数据库名称)")) -> list[dict[Any, Any]]: """ 获取所有爆管定位结果 @@ -54,7 +52,6 @@ class Item(BaseModel): str_info: str -@router.post("/test_dict/", summary="测试字典处理", description="测试处理字典类型数据") async def fastapi_test_dict(data: Item) -> dict[str, str]: """ 测试字典处理 diff --git a/app/api/v1/endpoints/model_import.py b/app/api/v1/endpoints/model_import.py index 35fc9fc..ffd84e8 100644 --- a/app/api/v1/endpoints/model_import.py +++ b/app/api/v1/endpoints/model_import.py @@ -1,17 +1,13 @@ -import json from pathlib import Path from tempfile import NamedTemporaryFile from uuid import UUID, uuid4 from fastapi import ( APIRouter, - Body, Depends, File, - Header, HTTPException, Path as ApiPath, - Query, Request, UploadFile, status, @@ -24,7 +20,7 @@ from app.auth.metadata_dependencies import ( from app.core.audit import AuditAction, log_audit_event from app.infra.db.metadb.repositories.metadata_repository import MetadataRepository from app.services.network_import import network_update -from app.services.tjnetwork import ChangeSet, import_inp, run_inp +from app.services.tjnetwork import run_inp router = APIRouter() @@ -145,7 +141,7 @@ async def _apply_model_update(content: bytes) -> None: @router.post( - "/admin/projects/{project_id}/model/import", + "/admin/projects/{project_id}/model-imports", summary="导入桌面端水力模型", ) async def import_project_model( @@ -168,8 +164,8 @@ async def import_project_model( return {"project_id": str(project.id), "filename": filename, "result": result} -@router.post( - "/admin/projects/{project_id}/model/update", +@router.patch( + "/admin/projects/{project_id}/model-imports", summary="更新桌面端水力模型", ) async def update_project_model( @@ -190,108 +186,3 @@ async def update_project_model( action="update", ) return {"project_id": str(project.id), "filename": filename, "updated": True} - - -@router.post("/importinp/", deprecated=True) -async def legacy_import_inp( - request: Request, - network: str = Query(...), - x_project_id: UUID = Header(..., alias="X-Project-Id"), - current_user=Depends(get_current_metadata_admin), - metadata_repo: MetadataRepository = Depends(get_metadata_repository), -): - project = await _get_active_project(x_project_id, metadata_repo) - if network != project.code: - raise HTTPException( - status_code=status.HTTP_403_FORBIDDEN, - detail="Project scope denied", - ) - payload = await request.json() - inp_text = payload.get("inp") if isinstance(payload, dict) else None - if not isinstance(inp_text, str): - raise HTTPException( - status_code=status.HTTP_400_BAD_REQUEST, - detail="Missing INP content", - ) - _validate_inp_bytes(inp_text.encode("utf-8"), "model.inp") - result = import_inp(network, ChangeSet({"inp": inp_text})) - await _audit_model_change( - request=request, - current_user=current_user, - metadata_repo=metadata_repo, - project_id=project.id, - action="import", - ) - return result - - -@router.post("/uploadinp/", deprecated=True) -async def legacy_upload_inp( - request: Request, - content: bytes = Body(...), - name: str = Query(...), - x_project_id: UUID = Header(..., alias="X-Project-Id"), - current_user=Depends(get_current_metadata_admin), - metadata_repo: MetadataRepository = Depends(get_metadata_repository), -) -> bool: - project = await _get_active_project(x_project_id, metadata_repo) - safe_name = Path(name).name - if safe_name != name: - raise HTTPException( - status_code=status.HTTP_400_BAD_REQUEST, - detail="Invalid INP file name", - ) - _validate_inp_bytes(content, safe_name) - target_dir = Path("data") - target_dir.mkdir(parents=True, exist_ok=True) - (target_dir / safe_name).write_bytes(content) - await _audit_model_change( - request=request, - current_user=current_user, - metadata_repo=metadata_repo, - project_id=project.id, - action="upload", - ) - return True - - -@router.post("/network_project/", deprecated=True) -async def legacy_network_project( - request: Request, - file: UploadFile = File(...), - x_project_id: UUID = Header(..., alias="X-Project-Id"), - current_user=Depends(get_current_metadata_admin), - metadata_repo: MetadataRepository = Depends(get_metadata_repository), -): - project = await _get_active_project(x_project_id, metadata_repo) - content, _ = await _read_upload(file) - result = await _run_uploaded_inp(content) - await _audit_model_change( - request=request, - current_user=current_user, - metadata_repo=metadata_repo, - project_id=project.id, - action="import", - ) - return result - - -@router.post("/network_update/", deprecated=True) -async def legacy_network_update( - request: Request, - file: UploadFile = File(...), - x_project_id: UUID = Header(..., alias="X-Project-Id"), - current_user=Depends(get_current_metadata_admin), - metadata_repo: MetadataRepository = Depends(get_metadata_repository), -) -> str: - project = await _get_active_project(x_project_id, metadata_repo) - content, _ = await _read_upload(file) - await _apply_model_update(content) - await _audit_model_change( - request=request, - current_user=current_user, - metadata_repo=metadata_repo, - project_id=project.id, - action="update", - ) - return json.dumps({"message": "管网更新成功"}) diff --git a/app/api/v1/endpoints/network/demands.py b/app/api/v1/endpoints/network/demands.py index 96efa9f..ac63be1 100644 --- a/app/api/v1/endpoints/network/demands.py +++ b/app/api/v1/endpoints/network/demands.py @@ -18,7 +18,7 @@ router = APIRouter() ############################################################ @router.get( - "/getdemandschema", + "/network-schemas/demand", summary="获取需水量属性架构", description="获取指定水网中需水量(Demand)的属性架构定义" ) @@ -32,7 +32,7 @@ async def fastapi_get_demand_schema(network: str = Query(..., description="管 @router.get( - "/getdemandproperties/", + "/demands/properties", summary="获取需水量属性", description="获取指定水网中节点的需水量属性信息" ) @@ -49,8 +49,8 @@ async def fastapi_get_demand_properties( # example: set_demand(p, ChangeSet({'junction': 'j1', 'demands': [{'demand': 10.0, 'pattern': None, 'category': 'x'}, {'demand': 20.0, 'pattern': None, 'category': None}]})) -@router.post( - "/setdemandproperties/", +@router.patch( + "/demands/properties", response_model=None, summary="设置需水量属性", description="设置指定水网中节点的需水量属性信息" @@ -72,8 +72,8 @@ async def fastapi_set_demand_properties( ############################################################ # water distribution 36.[Water Distribution] ############################################################ -@router.get( - "/calculatedemandtonodes/", +@router.post( + "/demands/to-nodes", summary="计算需水量到节点分配", description="将总需水量按指定方式分配到多个节点" ) @@ -97,8 +97,8 @@ async def fastapi_calculate_demand_to_nodes( nodes = props["nodes"] return calculate_demand_to_nodes(network, demand, nodes) -@router.get( - "/calculatedemandtoregion/", +@router.post( + "/demands/to-region", summary="计算需水量到区域分配", description="将总需水量按区域特征分配到该区域内的节点" ) @@ -122,8 +122,8 @@ async def fastapi_calculate_demand_to_region( region = props["region"] return calculate_demand_to_region(network, demand, region) -@router.get( - "/calculatedemandtonetwork/", +@router.post( + "/demands/to-network", summary="计算需水量到整网分配", description="将需水量均匀分配到整个水网的所有需水节点" ) diff --git a/app/api/v1/endpoints/network/general.py b/app/api/v1/endpoints/network/general.py index 894739a..0873800 100644 --- a/app/api/v1/endpoints/network/general.py +++ b/app/api/v1/endpoints/network/general.py @@ -45,7 +45,7 @@ router = APIRouter() ############################################################ @router.get( - "/isnode/", + "/nodes/existence", summary="检查节点有效性", description="检查指定ID是否为水网中的有效节点" ) @@ -57,7 +57,7 @@ async def fastapi_is_node( return is_node(network, node) @router.get( - "/isjunction/", + "/junctions/existence", summary="检查是否为接点", description="检查指定ID是否为水网中的接点(需求点)" ) @@ -69,7 +69,7 @@ async def fastapi_is_junction( return is_junction(network, node) @router.get( - "/isreservoir/", + "/reservoirs/existence", summary="检查是否为水源", description="检查指定ID是否为水网中的水源(水库/河流)" ) @@ -81,7 +81,7 @@ async def fastapi_is_reservoir( return is_reservoir(network, node) @router.get( - "/istank/", + "/tanks/existence", summary="检查是否为蓄水池", description="检查指定ID是否为水网中的蓄水池" ) @@ -93,7 +93,7 @@ async def fastapi_is_tank( return is_tank(network, node) @router.get( - "/islink/", + "/links/existence", summary="检查管线有效性", description="检查指定ID是否为水网中的有效管线" ) @@ -105,7 +105,7 @@ async def fastapi_is_link( return is_link(network, link) @router.get( - "/ispipe/", + "/pipes/existence", summary="检查是否为管道", description="检查指定ID是否为水网中的管道" ) @@ -117,7 +117,7 @@ async def fastapi_is_pipe( return is_pipe(network, link) @router.get( - "/ispump/", + "/pumps/existence", summary="检查是否为泵", description="检查指定ID是否为水网中的泵" ) @@ -129,7 +129,7 @@ async def fastapi_is_pump( return is_pump(network, link) @router.get( - "/isvalve/", + "/valves/existence", summary="检查是否为阀门", description="检查指定ID是否为水网中的阀门" ) @@ -141,7 +141,7 @@ async def fastapi_is_valve( return is_valve(network, link) @router.get( - "/getnodetype/", + "/node-types", summary="获取节点类型", description="获取指定节点的类型(接点/水源/蓄水池)" ) @@ -153,7 +153,7 @@ async def fastapi_get_node_type( return get_node_type(network, node) @router.get( - "/getlinktype/", + "/link-types", summary="获取管线类型", description="获取指定管线的类型(管道/泵/阀门)" ) @@ -165,7 +165,7 @@ async def fastapi_get_link_type( return get_link_type(network, link) @router.get( - "/getelementtype/", + "/element-types", summary="获取元素类型", description="获取指定元素的类型(节点或管线)" ) @@ -177,7 +177,7 @@ async def fastapi_get_element_type( return get_element_type(network, element) @router.get( - "/getelementtypevalue/", + "/element-type-values", summary="获取元素类型值", description="获取指定元素的类型数值标识" ) @@ -189,7 +189,7 @@ async def fastapi_get_element_type_value( return get_element_type_value(network, element) @router.get( - "/getnodes/", + "/nodes", summary="获取所有节点", description="获取指定水网中的所有节点ID列表" ) @@ -198,7 +198,7 @@ async def fastapi_get_nodes(network: str = Query(..., description="管网名称 return get_nodes(network) @router.get( - "/getlinks/", + "/links", summary="获取所有管线", description="获取指定水网中的所有管线ID列表" ) @@ -207,7 +207,7 @@ async def fastapi_get_links(network: str = Query(..., description="管网名称 return get_links(network) @router.get( - "/getnodelinks/", + "/node-links", summary="获取节点的关联管线", description="获取指定节点连接的所有管线ID列表" ) @@ -223,7 +223,7 @@ def get_node_links_endpoint( ############################################################ @router.get( - "/getnodeproperties/", + "/node-properties", summary="获取节点属性", description="获取指定节点的所有属性信息" ) @@ -235,7 +235,7 @@ async def fast_get_node_properties( return get_node_properties(network, node) @router.get( - "/getlinkproperties/", + "/link-properties", summary="获取管线属性", description="获取指定管线的所有属性信息" ) @@ -247,7 +247,7 @@ async def fast_get_link_properties( return get_link_properties(network, link) @router.get( - "/getscadaproperties/", + "/scada-properties", summary="获取SCADA点属性", description="获取指定SCADA点的属性信息" ) @@ -259,7 +259,7 @@ async def fast_get_scada_properties( return get_scada_info(network, scada) @router.get( - "/getallscadaproperties/", + "/all-scada-properties", summary="获取所有SCADA点属性", description="获取指定水网中所有SCADA点的属性信息" ) @@ -270,7 +270,7 @@ async def fast_get_all_scada_properties( return get_all_scada_info(network) @router.get( - "/getelementpropertieswithtype/", + "/element-properties-with-types", summary="获取指定类型元素属性", description="获取指定类型的元素属性信息" ) @@ -283,7 +283,7 @@ async def fast_get_element_properties_with_type( return get_element_properties_with_type(network, elementtype, element) @router.get( - "/getelementproperties/", + "/element-properties", summary="获取元素属性", description="获取指定元素的属性信息" ) @@ -299,7 +299,7 @@ async def fast_get_element_properties( ############################################################ @router.get( - "/gettitleschema/", + "/title-schemas", summary="获取标题属性架构", description="获取指定水网的标题(标题)属性架构定义" ) @@ -310,7 +310,7 @@ async def fast_get_title_schema( return get_title_schema(network) @router.get( - "/gettitle/", + "/titles", summary="获取水网标题属性", description="获取指定水网的标题(Title)信息" ) @@ -318,8 +318,8 @@ async def fast_get_title(network: str = Query(..., description="管网名称( """获取水网的标题属性。""" return get_title(network) -@router.get( - "/settitle/", +@router.patch( + "/titles", response_model=None, summary="设置水网标题属性", description="设置指定水网的标题(Title)信息" @@ -337,7 +337,7 @@ async def fastapi_set_title( ############################################################ @router.get( - "/getstatusschema", + "/status-schemas", summary="获取状态属性架构", description="获取指定水网的状态(Status)属性架构定义" ) @@ -348,7 +348,7 @@ async def fastapi_get_status_schema( return get_status_schema(network) @router.get( - "/getstatus/", + "/status", summary="获取管线状态", description="获取指定管线的状态信息" ) @@ -359,8 +359,8 @@ async def fastapi_get_status( """获取管线的状态属性。""" return get_status(network, link) -@router.post( - "/setstatus/", +@router.patch( + "/status-properties", response_model=None, summary="设置管线状态", description="设置指定管线的状态信息" @@ -379,8 +379,8 @@ async def fastapi_set_status_properties( # General Deletion ############################################################ -@router.post( - "/deletenode/", +@router.delete( + "/nodes", response_model=None, summary="删除节点", description="删除指定的节点(接点/水源/蓄水池)" @@ -399,8 +399,8 @@ async def fastapi_delete_node( return delete_tank(network, ChangeSet(ps)) return ChangeSet() # Should probably raise error or return empty -@router.post( - "/deletelink/", +@router.delete( + "/links", response_model=None, summary="删除管线", description="删除指定的管线(管道/泵/阀门)" diff --git a/app/api/v1/endpoints/network/geometry.py b/app/api/v1/endpoints/network/geometry.py index 8acf2f4..3b7a90f 100644 --- a/app/api/v1/endpoints/network/geometry.py +++ b/app/api/v1/endpoints/network/geometry.py @@ -31,7 +31,7 @@ router = APIRouter() # return set_coord(network, ChangeSet(props)) @router.get( - "/getnodecoord/", + "/node-coords", summary="获取节点坐标", description="获取指定节点的地理坐标(X, Y)" ) @@ -44,7 +44,7 @@ async def fastapi_get_node_coord( # Additional geometry queries found in main.py logic (implicit or explicit) @router.get( - "/getnetworkinextent/", + "/network-in-extents", summary="获取范围内的网络元素", description="获取指定地理范围内的网络节点和管线" ) @@ -59,7 +59,7 @@ async def fastapi_get_network_in_extent( return get_network_in_extent(network, x1, y1, x2, y2) @router.get( - "/getmajornodecoords/", + "/majornode-coords", summary="获取主要节点坐标", description="获取直径大于等于指定值的节点坐标" ) @@ -71,7 +71,7 @@ async def fastapi_get_majornode_coords( return get_major_node_coords(network, diameter) @router.get( - "/getmajorpipenodes/", + "/major-pipe-nodes", summary="获取主要管道节点", description="获取直径大于等于指定值的管道的节点ID" ) @@ -83,7 +83,7 @@ async def fastapi_get_major_pipe_nodes( return get_major_pipe_nodes(network, diameter) @router.get( - "/getnetworklinknodes/", + "/network-link-nodes", summary="获取网络管线节点", description="获取指定水网所有管线的起点和终点节点" ) diff --git a/app/api/v1/endpoints/network/junctions.py b/app/api/v1/endpoints/network/junctions.py index a7eff35..4959dcd 100644 --- a/app/api/v1/endpoints/network/junctions.py +++ b/app/api/v1/endpoints/network/junctions.py @@ -13,7 +13,7 @@ from app.services.tjnetwork import ( router = APIRouter() -@router.get("/getjunctionschema", summary="获取节点架构", description="获取指定项目的节点属性架构和数据类型定义。") +@router.get("/network-schemas/junction", summary="获取节点架构", description="获取指定项目的节点属性架构和数据类型定义。") async def fast_get_junction_schema( network: str = Query(..., description="管网名称(或数据库名称)") ) -> dict[str, dict[str, Any]]: @@ -27,7 +27,7 @@ async def fast_get_junction_schema( """ return get_junction_schema(network) -@router.post("/addjunction/", response_model=None, summary="添加节点", description="在供水网络中添加新的节点,指定节点ID和空间坐标。") +@router.post("/junctions", response_model=None, summary="添加节点", description="在供水网络中添加新的节点,指定节点ID和空间坐标。") async def fastapi_add_junction( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="节点 ID"), @@ -51,7 +51,7 @@ async def fastapi_add_junction( ps = {"id": junction, "x": x, "y": y, "elevation": z} return add_junction(network, ChangeSet(ps)) -@router.post("/deletejunction/", response_model=None, summary="删除节点", description="从供水网络中删除指定的节点。") +@router.delete("/junctions", response_model=None, summary="删除节点", description="从供水网络中删除指定的节点。") async def fastapi_delete_junction( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="节点 ID") @@ -69,7 +69,7 @@ async def fastapi_delete_junction( ps = {"id": junction} return delete_junction(network, ChangeSet(ps)) -@router.get("/getjunctionelevation/", summary="获取节点标高", description="获取指定节点的标高(海拔高度)。") +@router.get("/junctions/elevation", summary="获取节点标高", description="获取指定节点的标高(海拔高度)。") async def fastapi_get_junction_elevation( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="节点 ID") @@ -87,7 +87,7 @@ async def fastapi_get_junction_elevation( ps = get_junction(network, junction) return ps["elevation"] -@router.get("/getjunctionx/", summary="获取节点 X 坐标", description="获取指定节点的 X 坐标值。") +@router.get("/junctions/x", summary="获取节点 X 坐标", description="获取指定节点的 X 坐标值。") async def fastapi_get_junction_x( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="节点 ID") @@ -105,7 +105,7 @@ async def fastapi_get_junction_x( ps = get_junction(network, junction) return ps["x"] -@router.get("/getjunctiony/", summary="获取节点 Y 坐标", description="获取指定节点的 Y 坐标值。") +@router.get("/junctions/y", summary="获取节点 Y 坐标", description="获取指定节点的 Y 坐标值。") async def fastapi_get_junction_y( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="节点 ID") @@ -123,7 +123,7 @@ async def fastapi_get_junction_y( ps = get_junction(network, junction) return ps["y"] -@router.get("/getjunctioncoord/", summary="获取节点坐标", description="获取指定节点的 X 和 Y 坐标。") +@router.get("/junctions/coord", summary="获取节点坐标", description="获取指定节点的 X 和 Y 坐标。") async def fastapi_get_junction_coord( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="节点 ID") @@ -142,7 +142,7 @@ async def fastapi_get_junction_coord( coord = {"x": ps["x"], "y": ps["y"]} return coord -@router.get("/getjunctiondemand/", summary="获取节点需水量", description="获取指定节点的需水量。") +@router.get("/junctions/demand", summary="获取节点需水量", description="获取指定节点的需水量。") async def fastapi_get_junction_demand( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="节点 ID") @@ -160,7 +160,7 @@ async def fastapi_get_junction_demand( ps = get_junction(network, junction) return ps["demand"] -@router.get("/getjunctionpattern/", summary="获取节点需水模式", description="获取指定节点的需水模式标识。") +@router.get("/junctions/pattern", summary="获取节点需水模式", description="获取指定节点的需水模式标识。") async def fastapi_get_junction_pattern( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="节点 ID") @@ -178,7 +178,7 @@ async def fastapi_get_junction_pattern( ps = get_junction(network, junction) return ps["pattern"] -@router.post("/setjunctionelevation/", response_model=None, summary="设置节点标高", description="设置指定节点的标高值。") +@router.patch("/junctions/elevation", response_model=None, summary="设置节点标高", description="设置指定节点的标高值。") async def fastapi_set_junction_elevation( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="节点 ID"), @@ -198,7 +198,7 @@ async def fastapi_set_junction_elevation( ps = {"id": junction, "elevation": elevation} return set_junction(network, ChangeSet(ps)) -@router.post("/setjunctionx/", response_model=None, summary="设置节点 X 坐标", description="设置指定节点的 X 坐标值。") +@router.patch("/junctions/x", response_model=None, summary="设置节点 X 坐标", description="设置指定节点的 X 坐标值。") async def fastapi_set_junction_x( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="节点 ID"), @@ -218,7 +218,7 @@ async def fastapi_set_junction_x( ps = {"id": junction, "x": x} return set_junction(network, ChangeSet(ps)) -@router.post("/setjunctiony/", response_model=None, summary="设置节点 Y 坐标", description="设置指定节点的 Y 坐标值。") +@router.patch("/junctions/y", response_model=None, summary="设置节点 Y 坐标", description="设置指定节点的 Y 坐标值。") async def fastapi_set_junction_y( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="节点 ID"), @@ -238,7 +238,7 @@ async def fastapi_set_junction_y( ps = {"id": junction, "y": y} return set_junction(network, ChangeSet(ps)) -@router.post("/setjunctioncoord/", response_model=None, summary="设置节点坐标", description="设置指定节点的 X 和 Y 坐标。") +@router.patch("/junctions/coord", response_model=None, summary="设置节点坐标", description="设置指定节点的 X 和 Y 坐标。") async def fastapi_set_junction_coord( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="节点 ID"), @@ -260,7 +260,7 @@ async def fastapi_set_junction_coord( ps = {"id": junction, "x": x, "y": y} return set_junction(network, ChangeSet(ps)) -@router.post("/setjunctiondemand/", response_model=None, summary="设置节点需水量", description="设置指定节点的需水量。") +@router.patch("/junctions/demand", response_model=None, summary="设置节点需水量", description="设置指定节点的需水量。") async def fastapi_set_junction_demand( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="节点 ID"), @@ -280,7 +280,7 @@ async def fastapi_set_junction_demand( ps = {"id": junction, "demand": demand} return set_junction(network, ChangeSet(ps)) -@router.post("/setjunctionpattern/", response_model=None, summary="设置节点需水模式", description="设置指定节点的需水模式标识。") +@router.patch("/junctions/pattern", response_model=None, summary="设置节点需水模式", description="设置指定节点的需水模式标识。") async def fastapi_set_junction_pattern( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="节点 ID"), @@ -300,7 +300,7 @@ async def fastapi_set_junction_pattern( ps = {"id": junction, "pattern": pattern} return set_junction(network, ChangeSet(ps)) -@router.get("/getjunctionproperties/", summary="获取节点属性", description="获取指定节点的所有属性信息。") +@router.get("/junctions/properties", summary="获取节点属性", description="获取指定节点的所有属性信息。") async def fastapi_get_junction_properties( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="节点 ID") @@ -317,7 +317,7 @@ async def fastapi_get_junction_properties( """ return get_junction(network, junction) -@router.get("/getalljunctionproperties/", summary="获取所有节点属性", description="获取指定项目中所有节点的属性信息。") +@router.get("/junctions", summary="获取所有节点属性", description="获取指定项目中所有节点的属性信息。") async def fastapi_get_all_junction_properties( network: str = Query(..., description="管网名称(或数据库名称)") ) -> list[dict[str, Any]]: @@ -337,7 +337,7 @@ async def fastapi_get_all_junction_properties( results = get_all_junctions(network) return results -@router.post("/setjunctionproperties/", response_model=None, summary="批量设置节点属性", description="批量设置指定节点的多个属性。") +@router.patch("/junctions/properties", response_model=None, summary="批量设置节点属性", description="批量设置指定节点的多个属性。") async def fastapi_set_junction_properties( network: str = Query(..., description="管网名称(或数据库名称)"), junction: str = Query(..., description="节点 ID"), diff --git a/app/api/v1/endpoints/network/pipes.py b/app/api/v1/endpoints/network/pipes.py index 7ef513d..d65a83b 100644 --- a/app/api/v1/endpoints/network/pipes.py +++ b/app/api/v1/endpoints/network/pipes.py @@ -14,7 +14,7 @@ from app.services.tjnetwork import ( router = APIRouter() -@router.get("/getpipeschema", summary="获取管道模式", description="获取管道对象的模式定义,包含所有可用字段及其类型") +@router.get("/network-schemas/pipe", summary="获取管道模式", description="获取管道对象的模式定义,包含所有可用字段及其类型") async def fastapi_get_pipe_schema( network: str = Query(..., description="管网名称(或数据库名称)") ) -> dict[str, dict[str, Any]]: @@ -29,7 +29,7 @@ async def fastapi_get_pipe_schema( """ return get_pipe_schema(network) -@router.post("/addpipe/", response_model=None, summary="添加管道", description="向网络中添加新的管道,需要提供管道的基本参数如长度、管径、粗糙度等") +@router.post("/pipes", response_model=None, summary="添加管道", description="向网络中添加新的管道,需要提供管道的基本参数如长度、管径、粗糙度等") async def fastapi_add_pipe( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道标识符"), @@ -70,7 +70,7 @@ async def fastapi_add_pipe( } return add_pipe(network, ChangeSet(ps)) -@router.post("/deletepipe/", response_model=None, summary="删除管道", description="从网络中删除指定的管道") +@router.delete("/pipes", response_model=None, summary="删除管道", description="从网络中删除指定的管道") async def fastapi_delete_pipe( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="要删除的管道ID") @@ -88,7 +88,7 @@ async def fastapi_delete_pipe( ps = {"id": pipe} return delete_pipe(network, ChangeSet(ps)) -@router.get("/getpipenode1/", summary="获取管道起始节点", description="获取指定管道的起始节点ID") +@router.get("/pipes/node1", summary="获取管道起始节点", description="获取指定管道的起始节点ID") async def fastapi_get_pipe_node1( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID") @@ -106,7 +106,7 @@ async def fastapi_get_pipe_node1( ps = get_pipe(network, pipe) return ps["node1"] -@router.get("/getpipenode2/", summary="获取管道终止节点", description="获取指定管道的终止节点ID") +@router.get("/pipes/node2", summary="获取管道终止节点", description="获取指定管道的终止节点ID") async def fastapi_get_pipe_node2( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID") @@ -124,7 +124,7 @@ async def fastapi_get_pipe_node2( ps = get_pipe(network, pipe) return ps["node2"] -@router.get("/getpipelength/", summary="获取管道长度", description="获取指定管道的长度") +@router.get("/pipes/length", summary="获取管道长度", description="获取指定管道的长度") async def fastapi_get_pipe_length( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID") @@ -142,7 +142,7 @@ async def fastapi_get_pipe_length( ps = get_pipe(network, pipe) return ps["length"] -@router.get("/getpipediameter/", summary="获取管道管径", description="获取指定管道的管径") +@router.get("/pipes/diameter", summary="获取管道管径", description="获取指定管道的管径") async def fastapi_get_pipe_diameter( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID") @@ -160,7 +160,7 @@ async def fastapi_get_pipe_diameter( ps = get_pipe(network, pipe) return ps["diameter"] -@router.get("/getpiperoughness/", summary="获取管道粗糙度", description="获取指定管道的粗糙度") +@router.get("/pipes/roughness", summary="获取管道粗糙度", description="获取指定管道的粗糙度") async def fastapi_get_pipe_roughness( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID") @@ -178,7 +178,7 @@ async def fastapi_get_pipe_roughness( ps = get_pipe(network, pipe) return ps["roughness"] -@router.get("/getpipeminorloss/", summary="获取管道局部阻力系数", description="获取指定管道的局部阻力系数") +@router.get("/pipes/minor-loss", summary="获取管道局部阻力系数", description="获取指定管道的局部阻力系数") async def fastapi_get_pipe_minor_loss( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID") @@ -196,7 +196,7 @@ async def fastapi_get_pipe_minor_loss( ps = get_pipe(network, pipe) return ps["minor_loss"] -@router.get("/getpipestatus/", summary="获取管道状态", description="获取指定管道的状态(开启或关闭)") +@router.get("/pipes/status", summary="获取管道状态", description="获取指定管道的状态(开启或关闭)") async def fastapi_get_pipe_status( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID") @@ -214,7 +214,7 @@ async def fastapi_get_pipe_status( ps = get_pipe(network, pipe) return ps["status"] -@router.post("/setpipenode1/", response_model=None, summary="设置管道起始节点", description="设置指定管道的起始节点") +@router.patch("/pipes/node1", response_model=None, summary="设置管道起始节点", description="设置指定管道的起始节点") async def fastapi_set_pipe_node1( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID"), @@ -234,7 +234,7 @@ async def fastapi_set_pipe_node1( ps = {"id": pipe, "node1": node1} return set_pipe(network, ChangeSet(ps)) -@router.post("/setpipenode2/", response_model=None, summary="设置管道终止节点", description="设置指定管道的终止节点") +@router.patch("/pipes/node2", response_model=None, summary="设置管道终止节点", description="设置指定管道的终止节点") async def fastapi_set_pipe_node2( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID"), @@ -254,7 +254,7 @@ async def fastapi_set_pipe_node2( ps = {"id": pipe, "node2": node2} return set_pipe(network, ChangeSet(ps)) -@router.post("/setpipelength/", response_model=None, summary="设置管道长度", description="设置指定管道的长度") +@router.patch("/pipes/length", response_model=None, summary="设置管道长度", description="设置指定管道的长度") async def fastapi_set_pipe_length( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID"), @@ -274,7 +274,7 @@ async def fastapi_set_pipe_length( ps = {"id": pipe, "length": length} return set_pipe(network, ChangeSet(ps)) -@router.post("/setpipediameter/", response_model=None, summary="设置管道管径", description="设置指定管道的管径") +@router.patch("/pipes/diameter", response_model=None, summary="设置管道管径", description="设置指定管道的管径") async def fastapi_set_pipe_diameter( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID"), @@ -294,7 +294,7 @@ async def fastapi_set_pipe_diameter( ps = {"id": pipe, "diameter": diameter} return set_pipe(network, ChangeSet(ps)) -@router.post("/setpiperoughness/", response_model=None, summary="设置管道粗糙度", description="设置指定管道的粗糙度") +@router.patch("/pipes/roughness", response_model=None, summary="设置管道粗糙度", description="设置指定管道的粗糙度") async def fastapi_set_pipe_roughness( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID"), @@ -314,7 +314,7 @@ async def fastapi_set_pipe_roughness( ps = {"id": pipe, "roughness": roughness} return set_pipe(network, ChangeSet(ps)) -@router.post("/setpipeminorloss/", response_model=None, summary="设置管道局部阻力系数", description="设置指定管道的局部阻力系数") +@router.patch("/pipes/minor-loss", response_model=None, summary="设置管道局部阻力系数", description="设置指定管道的局部阻力系数") async def fastapi_set_pipe_minor_loss( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID"), @@ -334,7 +334,7 @@ async def fastapi_set_pipe_minor_loss( ps = {"id": pipe, "minor_loss": minor_loss} return set_pipe(network, ChangeSet(ps)) -@router.post("/setpipestatus/", response_model=None, summary="设置管道状态", description="设置指定管道的状态(开启或关闭)") +@router.patch("/pipes/status", response_model=None, summary="设置管道状态", description="设置指定管道的状态(开启或关闭)") async def fastapi_set_pipe_status( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID"), @@ -354,7 +354,7 @@ async def fastapi_set_pipe_status( ps = {"id": pipe, "status": status} return set_pipe(network, ChangeSet(ps)) -@router.get("/getpipeproperties/", summary="获取管道属性", description="获取指定管道的所有属性信息") +@router.get("/pipes/properties", summary="获取管道属性", description="获取指定管道的所有属性信息") async def fastapi_get_pipe_properties( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID") @@ -371,7 +371,7 @@ async def fastapi_get_pipe_properties( """ return get_pipe(network, pipe) -@router.get("/getallpipeproperties/", summary="获取所有管道属性", description="获取网络中所有管道的属性信息列表") +@router.get("/pipes", summary="获取所有管道属性", description="获取网络中所有管道的属性信息列表") async def fastapi_get_all_pipe_properties( network: str = Query(..., description="管网名称(或数据库名称)") ) -> list[dict[str, Any]]: @@ -389,7 +389,7 @@ async def fastapi_get_all_pipe_properties( results = get_all_pipes(network) return results -@router.post("/setpipeproperties/", response_model=None, summary="设置管道属性", description="批量设置指定管道的多个属性") +@router.patch("/pipes/properties", response_model=None, summary="设置管道属性", description="批量设置指定管道的多个属性") async def fastapi_set_pipe_properties( network: str = Query(..., description="管网名称(或数据库名称)"), pipe: str = Query(..., description="管道ID"), diff --git a/app/api/v1/endpoints/network/pumps.py b/app/api/v1/endpoints/network/pumps.py index 8b79f53..d947f67 100644 --- a/app/api/v1/endpoints/network/pumps.py +++ b/app/api/v1/endpoints/network/pumps.py @@ -13,7 +13,7 @@ from app.services.tjnetwork import ( router = APIRouter() -@router.get("/getpumpschema", summary="获取水泵模式", description="获取水泵对象的模式定义,包含所有可用字段及其类型") +@router.get("/network-schemas/pump", summary="获取水泵模式", description="获取水泵对象的模式定义,包含所有可用字段及其类型") async def fastapi_get_pump_schema( network: str = Query(..., description="管网名称(或数据库名称)") ) -> dict[str, dict[str, Any]]: @@ -28,7 +28,7 @@ async def fastapi_get_pump_schema( """ return get_pump_schema(network) -@router.post("/addpump/", response_model=None, summary="添加水泵", description="向网络中添加新的水泵,需要提供水泵的基本参数如功率等") +@router.post("/pumps", response_model=None, summary="添加水泵", description="向网络中添加新的水泵,需要提供水泵的基本参数如功率等") async def fastapi_add_pump( network: str = Query(..., description="管网名称(或数据库名称)"), pump: str = Query(..., description="水泵标识符"), @@ -52,7 +52,7 @@ async def fastapi_add_pump( ps = {"id": pump, "node1": node1, "node2": node2, "power": power} return add_pump(network, ChangeSet(ps)) -@router.post("/deletepump/", response_model=None, summary="删除水泵", description="从网络中删除指定的水泵") +@router.delete("/pumps", response_model=None, summary="删除水泵", description="从网络中删除指定的水泵") async def fastapi_delete_pump( network: str = Query(..., description="管网名称(或数据库名称)"), pump: str = Query(..., description="要删除的水泵ID") @@ -70,7 +70,7 @@ async def fastapi_delete_pump( ps = {"id": pump} return delete_pump(network, ChangeSet(ps)) -@router.get("/getpumpnode1/", summary="获取水泵起始节点", description="获取指定水泵的起始节点ID") +@router.get("/pumps/node1", summary="获取水泵起始节点", description="获取指定水泵的起始节点ID") async def fastapi_get_pump_node1( network: str = Query(..., description="管网名称(或数据库名称)"), pump: str = Query(..., description="水泵ID") @@ -88,7 +88,7 @@ async def fastapi_get_pump_node1( ps = get_pump(network, pump) return ps["node1"] -@router.get("/getpumpnode2/", summary="获取水泵终止节点", description="获取指定水泵的终止节点ID") +@router.get("/pumps/node2", summary="获取水泵终止节点", description="获取指定水泵的终止节点ID") async def fastapi_get_pump_node2( network: str = Query(..., description="管网名称(或数据库名称)"), pump: str = Query(..., description="水泵ID") @@ -106,7 +106,7 @@ async def fastapi_get_pump_node2( ps = get_pump(network, pump) return ps["node2"] -@router.post("/setpumpnode1/", response_model=None, summary="设置水泵起始节点", description="设置指定水泵的起始节点") +@router.patch("/pumps/node1", response_model=None, summary="设置水泵起始节点", description="设置指定水泵的起始节点") async def fastapi_set_pump_node1( network: str = Query(..., description="管网名称(或数据库名称)"), pump: str = Query(..., description="水泵ID"), @@ -126,7 +126,7 @@ async def fastapi_set_pump_node1( ps = {"id": pump, "node1": node1} return set_pump(network, ChangeSet(ps)) -@router.post("/setpumpnode2/", response_model=None, summary="设置水泵终止节点", description="设置指定水泵的终止节点") +@router.patch("/pumps/node2", response_model=None, summary="设置水泵终止节点", description="设置指定水泵的终止节点") async def fastapi_set_pump_node2( network: str = Query(..., description="管网名称(或数据库名称)"), pump: str = Query(..., description="水泵ID"), @@ -146,7 +146,7 @@ async def fastapi_set_pump_node2( ps = {"id": pump, "node2": node2} return set_pump(network, ChangeSet(ps)) -@router.get("/getpumpproperties/", summary="获取水泵属性", description="获取指定水泵的所有属性信息") +@router.get("/pumps/properties", summary="获取水泵属性", description="获取指定水泵的所有属性信息") async def fastapi_get_pump_properties( network: str = Query(..., description="管网名称(或数据库名称)"), pump: str = Query(..., description="水泵ID") @@ -163,7 +163,7 @@ async def fastapi_get_pump_properties( """ return get_pump(network, pump) -@router.get("/getallpumpproperties/", summary="获取所有水泵属性", description="获取网络中所有水泵的属性信息列表") +@router.get("/pumps", summary="获取所有水泵属性", description="获取网络中所有水泵的属性信息列表") async def fastapi_get_all_pump_properties( network: str = Query(..., description="管网名称(或数据库名称)") ) -> list[dict[str, Any]]: @@ -181,7 +181,7 @@ async def fastapi_get_all_pump_properties( results = get_all_pumps(network) return results -@router.post("/setpumpproperties/", response_model=None, summary="设置水泵属性", description="批量设置指定水泵的多个属性") +@router.patch("/pumps/properties", response_model=None, summary="设置水泵属性", description="批量设置指定水泵的多个属性") async def fastapi_set_pump_properties( network: str = Query(..., description="管网名称(或数据库名称)"), pump: str = Query(..., description="水泵ID"), diff --git a/app/api/v1/endpoints/network/regions.py b/app/api/v1/endpoints/network/regions.py index 4d1b564..833852b 100644 --- a/app/api/v1/endpoints/network/regions.py +++ b/app/api/v1/endpoints/network/regions.py @@ -45,7 +45,7 @@ router = APIRouter() ############################################################ @router.get( - "/getregionschema/", + "/network-schemas/region", summary="获取区域属性架构", description="获取指定水网的区域属性架构定义" ) @@ -56,7 +56,7 @@ async def fastapi_get_region_schema( return get_region_schema(network) @router.get( - "/getregion/", + "/regions/detail", summary="获取区域信息", description="获取指定ID的区域详细信息" ) @@ -67,8 +67,8 @@ async def fastapi_get_region( """获取区域的详细信息。""" return get_region(network, id) -@router.post( - "/setregion/", +@router.patch( + "/regions", response_model=None, summary="设置区域属性", description="修改指定区域的属性信息" @@ -82,7 +82,7 @@ async def fastapi_set_region( return set_region(network, ChangeSet(props)) @router.post( - "/addregion/", + "/regions", response_model=None, summary="添加新区域", description="向水网添加一个新的区域" @@ -95,8 +95,8 @@ async def fastapi_add_region( props = await req.json() return add_region(network, ChangeSet(props)) -@router.post( - "/deleteregion/", +@router.delete( + "/regions", response_model=None, summary="删除区域", description="删除指定的区域" @@ -114,8 +114,8 @@ async def fastapi_delete_region( # district_metering_area 33 ############################################################ -@router.get( - "/calculatedistrictmeteringareaforregion/", +@router.post( + "/district-metering-areas/for-region", summary="计算区域内DMA分区", description="为指定区域计算区域计量(DMA)分区方案" ) @@ -141,8 +141,8 @@ async def fastapi_calculate_district_metering_area_for_region( network, region, part_count, part_type ) -@router.get( - "/calculatedistrictmeteringareafornetwork/", +@router.post( + "/district-metering-areas/for-network", summary="计算整网DMA分区", description="为整个水网计算区域计量(DMA)分区方案" ) @@ -165,7 +165,7 @@ async def fastapi_calculate_district_metering_area_for_network( return calculate_district_metering_area_for_network(network, part_count, part_type) @router.get( - "/getdistrictmeteringareaschema/", + "/network-schemas/district-metering-area", summary="获取DMA属性架构", description="获取指定水网的区域计量(DMA)属性架构定义" ) @@ -176,7 +176,7 @@ async def fastapi_get_district_metering_area_schema( return get_district_metering_area_schema(network) @router.get( - "/getdistrictmeteringarea/", + "/district-metering-areas/detail", summary="获取DMA信息", description="获取指定ID的区域计量(DMA)详细信息" ) @@ -187,8 +187,8 @@ async def fastapi_get_district_metering_area( """获取DMA的详细信息。""" return get_district_metering_area(network, id) -@router.post( - "/setdistrictmeteringarea/", +@router.patch( + "/district-metering-areas", response_model=None, summary="设置DMA属性", description="修改指定DMA的属性信息" @@ -202,7 +202,7 @@ async def fastapi_set_district_metering_area( return set_district_metering_area(network, ChangeSet(props)) @router.post( - "/adddistrictmeteringarea/", + "/district-metering-areas", response_model=None, summary="添加新DMA", description="向水网添加一个新的区域计量(DMA)" @@ -222,8 +222,8 @@ async def fastapi_add_district_metering_area( props["boundary"] = newBoundary return add_district_metering_area(network, ChangeSet(props)) -@router.post( - "/deletedistrictmeteringarea/", +@router.delete( + "/district-metering-areas", response_model=None, summary="删除DMA", description="删除指定的区域计量(DMA)" @@ -237,7 +237,7 @@ async def fastapi_delete_district_metering_area( return delete_district_metering_area(network, ChangeSet(props)) @router.get( - "/getalldistrictmeteringareaids/", + "/district-metering-areas/ids", summary="获取所有DMA ID", description="获取指定水网中所有DMA的ID列表" ) @@ -248,7 +248,7 @@ async def fastapi_get_all_district_metering_area_ids( return get_all_district_metering_area_ids(network) @router.get( - "/getalldistrictmeteringareas/", + "/district-metering-areas", summary="获取所有DMA", description="获取指定水网中所有DMA的详细信息" ) @@ -259,7 +259,7 @@ async def getalldistrictmeteringareas( return get_all_district_metering_areas(network) @router.post( - "/generatedistrictmeteringarea/", + "/district-metering-area-generation-runs", response_model=None, summary="生成DMA分区", description="根据参数自动生成水网的DMA分区方案" @@ -276,7 +276,7 @@ async def fastapi_generate_district_metering_area( ) @router.post( - "/generatesubdistrictmeteringarea/", + "/sub-district-metering-areas", response_model=None, summary="生成DMA子分区", description="为指定DMA生成子DMA分区" @@ -298,8 +298,8 @@ async def fastapi_generate_sub_district_metering_area( # service_area 34 ############################################################ -@router.get( - "/calculateservicearea/", +@router.post( + "/service-area-calculations", summary="计算服务区", description="计算指定水网的服务区分区,返回全部时间步结果" ) @@ -310,7 +310,7 @@ async def fastapi_calculate_service_area( return calculate_service_area(network) @router.get( - "/getserviceareaschema/", + "/network-schemas/service-area", summary="获取服务区属性架构", description="获取指定水网的服务区属性架构定义" ) @@ -321,7 +321,7 @@ async def fastapi_get_service_area_schema( return get_service_area_schema(network) @router.get( - "/getservicearea/", + "/service-areas/detail", summary="获取服务区信息", description="获取指定ID的服务区详细信息" ) @@ -332,8 +332,8 @@ async def fastapi_get_service_area( """获取服务区的详细信息。""" return get_service_area(network, id) -@router.post( - "/setservicearea/", +@router.patch( + "/service-areas", response_model=None, summary="设置服务区属性", description="修改指定服务区的属性信息" @@ -347,7 +347,7 @@ async def fastapi_set_service_area( return set_service_area(network, ChangeSet(props)) @router.post( - "/addservicearea/", + "/service-areas", response_model=None, summary="添加新服务区", description="向水网添加一个新的服务区" @@ -360,8 +360,8 @@ async def fastapi_add_service_area( props = await req.json() return add_service_area(network, ChangeSet(props)) -@router.post( - "/deleteservicearea/", +@router.delete( + "/service-areas", response_model=None, summary="删除服务区", description="删除指定的服务区" @@ -375,7 +375,7 @@ async def fastapi_delete_service_area( return delete_service_area(network, ChangeSet(props)) @router.get( - "/getallserviceareas/", + "/service-areas", summary="获取所有服务区", description="获取指定水网中的所有服务区信息" ) @@ -386,7 +386,7 @@ async def fastapi_get_all_service_areas( return get_all_service_areas(network) @router.post( - "/generateservicearea/", + "/service-area-generation-runs", response_model=None, summary="生成服务区分区", description="根据参数自动生成水网的服务区分区" @@ -403,8 +403,8 @@ async def fastapi_generate_service_area( # virtual_district 35 ############################################################ -@router.get( - "/calculatevirtualdistrict/", +@router.post( + "/virtual-district-calculations", summary="计算虚拟分区", description="根据指定的压力监测节点作为中心节点计算虚拟分区方案" ) @@ -416,7 +416,7 @@ async def fastapi_calculate_virtual_district( return calculate_virtual_district(network, centers) @router.get( - "/getvirtualdistrictschema/", + "/network-schemas/virtual-district", summary="获取虚拟分区属性架构", description="获取指定水网的虚拟分区属性架构定义" ) @@ -427,7 +427,7 @@ async def fastapi_get_virtual_district_schema( return get_virtual_district_schema(network) @router.get( - "/getvirtualdistrict/", + "/virtual-districts/detail", summary="获取虚拟分区信息", description="获取指定ID的虚拟分区详细信息" ) @@ -438,8 +438,8 @@ async def fastapi_get_virtual_district( """获取虚拟分区的详细信息。""" return get_virtual_district(network, id) -@router.post( - "/setvirtualdistrict/", +@router.patch( + "/virtual-districts", response_model=None, summary="设置虚拟分区属性", description="修改指定虚拟分区的属性信息" @@ -453,7 +453,7 @@ async def fastapi_set_virtual_district( return set_virtual_district(network, ChangeSet(props)) @router.post( - "/addvirtualdistrict/", + "/virtual-districts", response_model=None, summary="添加新虚拟分区", description="向水网添加一个新的虚拟分区" @@ -466,8 +466,8 @@ async def fastapi_add_virtual_district( props = await req.json() return add_virtual_district(network, ChangeSet(props)) -@router.post( - "/deletevirtualdistrict/", +@router.delete( + "/virtual-districts", response_model=None, summary="删除虚拟分区", description="删除指定的虚拟分区" @@ -481,7 +481,7 @@ async def fastapi_delete_virtual_district( return delete_virtual_district(network, ChangeSet(props)) @router.get( - "/getallvirtualdistrict/", + "/virtual-districts", summary="获取所有虚拟分区", description="获取指定水网中的所有虚拟分区信息" ) @@ -492,7 +492,7 @@ async def fastapi_get_all_virtual_district( return get_all_virtual_districts(network) @router.post( - "/generatevirtualdistrict/", + "/virtual-district-generation-runs", response_model=None, summary="生成虚拟分区", description="根据参数自动生成虚拟分区方案" @@ -506,8 +506,8 @@ async def fastapi_generate_virtual_district( props = await req.json() return generate_virtual_district(network, props["centers"], inflate_delta) -@router.get( - "/calculatedistrictmeteringareafornodes/", +@router.post( + "/district-metering-areas/for-nodes", summary="计算节点DMA分区", description="为指定节点集计算区域计量(DMA)分区方案" ) diff --git a/app/api/v1/endpoints/network/reservoirs.py b/app/api/v1/endpoints/network/reservoirs.py index cf58b74..c2e29c0 100644 --- a/app/api/v1/endpoints/network/reservoirs.py +++ b/app/api/v1/endpoints/network/reservoirs.py @@ -14,7 +14,7 @@ from app.services.tjnetwork import ( router = APIRouter() @router.get( - "/getreservoirschema", + "/network-schemas/reservoir", summary="获取水库模式", description="获取指定供水网络中所有水库的模式/属性字段定义" ) @@ -35,7 +35,7 @@ async def fast_get_reservoir_schema( return get_reservoir_schema(network) @router.post( - "/addreservoir/", + "/reservoirs", response_model=None, summary="添加水库", description="在指定供水网络中添加新的水库/水源节点" @@ -65,8 +65,8 @@ async def fastapi_add_reservoir( ps = {"id": reservoir, "x": x, "y": y, "head": head} return add_reservoir(network, ChangeSet(ps)) -@router.post( - "/deletereservoir/", +@router.delete( + "/reservoirs", response_model=None, summary="删除水库", description="从指定供水网络中删除指定的水库/水源节点" @@ -91,7 +91,7 @@ async def fastapi_delete_reservoir( return delete_reservoir(network, ChangeSet(ps)) @router.get( - "/getreservoirhead/", + "/reservoirs/head", summary="获取水库水头", description="获取指定水库的供水水头/总水头值" ) @@ -115,7 +115,7 @@ async def fastapi_get_reservoir_head( return ps["head"] @router.get( - "/getreservoirpattern/", + "/reservoirs/pattern", summary="获取水库模式", description="获取指定水库的运行模式/供水模式" ) @@ -139,7 +139,7 @@ async def fastapi_get_reservoir_pattern( return ps["pattern"] @router.get( - "/getreservoirx/", + "/reservoirs/x", summary="获取水库X坐标", description="获取指定水库的X坐标位置" ) @@ -163,7 +163,7 @@ async def fastapi_get_reservoir_x( return ps["x"] @router.get( - "/getreservoiry/", + "/reservoirs/y", summary="获取水库Y坐标", description="获取指定水库的Y坐标位置" ) @@ -187,7 +187,7 @@ async def fastapi_get_reservoir_y( return ps["y"] @router.get( - "/getreservoircoord/", + "/reservoirs/coord", summary="获取水库坐标", description="获取指定水库的平面坐标(X和Y坐标)" ) @@ -211,8 +211,8 @@ async def fastapi_get_reservoir_coord( coord = {"id": reservoir, "x": ps["x"], "y": ps["y"]} return coord -@router.post( - "/setreservoirhead/", +@router.patch( + "/reservoirs/head", response_model=None, summary="设置水库水头", description="更新指定水库的供水水头/总水头值" @@ -238,8 +238,8 @@ async def fastapi_set_reservoir_head( ps = {"id": reservoir, "head": head} return set_reservoir(network, ChangeSet(ps)) -@router.post( - "/setreservoirpattern/", +@router.patch( + "/reservoirs/pattern", response_model=None, summary="设置水库模式", description="更新指定水库的运行模式/供水模式" @@ -265,8 +265,8 @@ async def fastapi_set_reservoir_pattern( ps = {"id": reservoir, "pattern": pattern} return set_reservoir(network, ChangeSet(ps)) -@router.post( - "/setreservoirx/", +@router.patch( + "/reservoirs/x", response_model=None, summary="设置水库X坐标", description="更新指定水库的X坐标位置" @@ -292,8 +292,8 @@ async def fastapi_set_reservoir_x( ps = {"id": reservoir, "x": x} return set_reservoir(network, ChangeSet(ps)) -@router.post( - "/setreservoiry/", +@router.patch( + "/reservoirs/y", response_model=None, summary="设置水库Y坐标", description="更新指定水库的Y坐标位置" @@ -319,8 +319,8 @@ async def fastapi_set_reservoir_y( ps = {"id": reservoir, "y": y} return set_reservoir(network, ChangeSet(ps)) -@router.post( - "/setreservoircoord/", +@router.patch( + "/reservoirs/coord", response_model=None, summary="设置水库坐标", description="更新指定水库的平面坐标(X和Y坐标)" @@ -349,7 +349,7 @@ async def fastapi_set_reservoir_coord( return set_reservoir(network, ChangeSet(ps)) @router.get( - "/getreservoirproperties/", + "/reservoirs/properties", summary="获取水库属性", description="获取指定水库的所有属性" ) @@ -372,7 +372,7 @@ async def fastapi_get_reservoir_properties( return get_reservoir(network, reservoir) @router.get( - "/getallreservoirproperties/", + "/reservoirs", summary="获取所有水库属性", description="获取指定供水网络中所有水库的属性" ) @@ -393,8 +393,8 @@ async def fastapi_get_all_reservoir_properties( results = get_all_reservoirs(network) return results -@router.post( - "/setreservoirproperties/", +@router.patch( + "/reservoirs/properties", response_model=None, summary="设置水库属性", description="批量更新指定水库的多个属性" diff --git a/app/api/v1/endpoints/network/tags.py b/app/api/v1/endpoints/network/tags.py index fb43228..6a0964e 100644 --- a/app/api/v1/endpoints/network/tags.py +++ b/app/api/v1/endpoints/network/tags.py @@ -16,7 +16,7 @@ router = APIRouter() ############################################################ @router.get( - "/gettagschema/", + "/network-schemas/tag", summary="获取标签属性架构", description="获取指定水网的标签(Tag)属性架构定义" ) @@ -27,7 +27,7 @@ async def fastapi_get_tag_schema( return get_tag_schema(network) @router.get( - "/gettag/", + "/tags/detail", summary="获取标签信息", description="获取指定类型和ID的标签信息" ) @@ -40,7 +40,7 @@ async def fastapi_get_tag( return get_tag(network, t_type, id) @router.get( - "/gettags/", + "/tags", summary="获取所有标签", description="获取指定水网中的所有标签信息" ) @@ -51,8 +51,8 @@ async def fastapi_get_tags( tags = get_tags(network) return tags -@router.post( - "/settag/", +@router.patch( + "/tags", response_model=None, summary="设置标签", description="为指定元素设置或修改标签信息" diff --git a/app/api/v1/endpoints/network/tanks.py b/app/api/v1/endpoints/network/tanks.py index 319a091..9d579b0 100644 --- a/app/api/v1/endpoints/network/tanks.py +++ b/app/api/v1/endpoints/network/tanks.py @@ -13,7 +13,7 @@ from app.services.tjnetwork import ( router = APIRouter() -@router.get("/gettankschema", summary="获取水箱模式", description="获取指定网络的水箱数据结构模式定义") +@router.get("/network-schemas/tank", summary="获取水箱模式", description="获取指定网络的水箱数据结构模式定义") async def fast_get_tank_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[str, Any]]: """ 获取水箱的数据结构模式。 @@ -26,7 +26,7 @@ async def fast_get_tank_schema(network: str = Query(..., description="管网名 """ return get_tank_schema(network) -@router.post("/addtank/", summary="新增水箱", description="向指定网络中新增一个水箱", response_model=None) +@router.post("/tanks", summary="新增水箱", description="向指定网络中新增一个水箱", response_model=None) async def fastapi_add_tank( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID"), @@ -70,7 +70,7 @@ async def fastapi_add_tank( } return add_tank(network, ChangeSet(ps)) -@router.post("/deletetank/", summary="删除水箱", description="删除指定网络中的水箱", response_model=None) +@router.delete("/tanks", summary="删除水箱", description="删除指定网络中的水箱", response_model=None) async def fastapi_delete_tank( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID") @@ -88,7 +88,7 @@ async def fastapi_delete_tank( ps = {"id": tank} return delete_tank(network, ChangeSet(ps)) -@router.get("/gettankelevation/", summary="获取水箱标高", description="获取指定水箱的标高值") +@router.get("/tanks/elevation", summary="获取水箱标高", description="获取指定水箱的标高值") async def fastapi_get_tank_elevation( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID") @@ -106,7 +106,7 @@ async def fastapi_get_tank_elevation( ps = get_tank(network, tank) return ps["elevation"] -@router.get("/gettankinitlevel/", summary="获取水箱初始水位", description="获取指定水箱的初始水位值") +@router.get("/tanks/init-level", summary="获取水箱初始水位", description="获取指定水箱的初始水位值") async def fastapi_get_tank_init_level( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID") @@ -124,7 +124,7 @@ async def fastapi_get_tank_init_level( ps = get_tank(network, tank) return ps["init_level"] -@router.get("/gettankminlevel/", summary="获取水箱最小水位", description="获取指定水箱的最小水位值") +@router.get("/tanks/min-level", summary="获取水箱最小水位", description="获取指定水箱的最小水位值") async def fastapi_get_tank_min_level( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID") @@ -142,7 +142,7 @@ async def fastapi_get_tank_min_level( ps = get_tank(network, tank) return ps["min_level"] -@router.get("/gettankmaxlevel/", summary="获取水箱最大水位", description="获取指定水箱的最大水位值") +@router.get("/tanks/max-level", summary="获取水箱最大水位", description="获取指定水箱的最大水位值") async def fastapi_get_tank_max_level( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID") @@ -160,7 +160,7 @@ async def fastapi_get_tank_max_level( ps = get_tank(network, tank) return ps["max_level"] -@router.get("/gettankdiameter/", summary="获取水箱直径", description="获取指定水箱的直径值") +@router.get("/tanks/diameter", summary="获取水箱直径", description="获取指定水箱的直径值") async def fastapi_get_tank_diameter( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID") @@ -178,7 +178,7 @@ async def fastapi_get_tank_diameter( ps = get_tank(network, tank) return ps["diameter"] -@router.get("/gettankminvol/", summary="获取水箱最小体积", description="获取指定水箱的最小体积值") +@router.get("/tanks/min-vol", summary="获取水箱最小体积", description="获取指定水箱的最小体积值") async def fastapi_get_tank_min_vol( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID") @@ -196,7 +196,7 @@ async def fastapi_get_tank_min_vol( ps = get_tank(network, tank) return ps["min_vol"] -@router.get("/gettankvolcurve/", summary="获取水箱容积曲线", description="获取指定水箱的容积曲线标识") +@router.get("/tanks/vol-curve", summary="获取水箱容积曲线", description="获取指定水箱的容积曲线标识") async def fastapi_get_tank_vol_curve( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID") @@ -214,7 +214,7 @@ async def fastapi_get_tank_vol_curve( ps = get_tank(network, tank) return ps["vol_curve"] -@router.get("/gettankoverflow/", summary="获取水箱溢流口", description="获取指定水箱的溢流口配置") +@router.get("/tanks/overflow", summary="获取水箱溢流口", description="获取指定水箱的溢流口配置") async def fastapi_get_tank_overflow( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID") @@ -232,7 +232,7 @@ async def fastapi_get_tank_overflow( ps = get_tank(network, tank) return ps["overflow"] -@router.get("/gettankx/", summary="获取水箱X坐标", description="获取指定水箱的X坐标值") +@router.get("/tanks/x", summary="获取水箱X坐标", description="获取指定水箱的X坐标值") async def fastapi_get_tank_x( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID") @@ -250,7 +250,7 @@ async def fastapi_get_tank_x( ps = get_tank(network, tank) return ps["x"] -@router.get("/gettanky/", summary="获取水箱Y坐标", description="获取指定水箱的Y坐标值") +@router.get("/tanks/y", summary="获取水箱Y坐标", description="获取指定水箱的Y坐标值") async def fastapi_get_tank_y( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID") @@ -268,7 +268,7 @@ async def fastapi_get_tank_y( ps = get_tank(network, tank) return ps["y"] -@router.get("/gettankcoord/", summary="获取水箱坐标", description="获取指定水箱的X和Y坐标") +@router.get("/tanks/coord", summary="获取水箱坐标", description="获取指定水箱的X和Y坐标") async def fastapi_get_tank_coord( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID") @@ -287,7 +287,7 @@ async def fastapi_get_tank_coord( coord = {"x": ps["x"], "y": ps["y"]} return coord -@router.post("/settankelevation/", summary="设置水箱标高", description="设置指定水箱的标高值", response_model=None) +@router.patch("/tanks/elevation", summary="设置水箱标高", description="设置指定水箱的标高值", response_model=None) async def fastapi_set_tank_elevation( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID"), @@ -307,7 +307,7 @@ async def fastapi_set_tank_elevation( ps = {"id": tank, "elevation": elevation} return set_tank(network, ChangeSet(ps)) -@router.post("/settankinitlevel/", summary="设置水箱初始水位", description="设置指定水箱的初始水位值", response_model=None) +@router.patch("/tanks/init-level", summary="设置水箱初始水位", description="设置指定水箱的初始水位值", response_model=None) async def fastapi_set_tank_init_level( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID"), @@ -327,7 +327,7 @@ async def fastapi_set_tank_init_level( ps = {"id": tank, "init_level": init_level} return set_tank(network, ChangeSet(ps)) -@router.post("/settankminlevel/", summary="设置水箱最小水位", description="设置指定水箱的最小水位值", response_model=None) +@router.patch("/tanks/min-level", summary="设置水箱最小水位", description="设置指定水箱的最小水位值", response_model=None) async def fastapi_set_tank_min_level( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID"), @@ -347,7 +347,7 @@ async def fastapi_set_tank_min_level( ps = {"id": tank, "min_level": min_level} return set_tank(network, ChangeSet(ps)) -@router.post("/settankmaxlevel/", summary="设置水箱最大水位", description="设置指定水箱的最大水位值", response_model=None) +@router.patch("/tanks/max-level", summary="设置水箱最大水位", description="设置指定水箱的最大水位值", response_model=None) async def fastapi_set_tank_max_level( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID"), @@ -367,7 +367,7 @@ async def fastapi_set_tank_max_level( ps = {"id": tank, "max_level": max_level} return set_tank(network, ChangeSet(ps)) -@router.post("/settankdiameter/", summary="设置水箱直径", description="设置指定水箱的直径值", response_model=None) +@router.patch("/tanks/diameter", summary="设置水箱直径", description="设置指定水箱的直径值", response_model=None) async def fastapi_set_tank_diameter( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID"), @@ -387,7 +387,7 @@ async def fastapi_set_tank_diameter( ps = {"id": tank, "diameter": diameter} return set_tank(network, ChangeSet(ps)) -@router.post("/settankminvol/", summary="设置水箱最小体积", description="设置指定水箱的最小体积值", response_model=None) +@router.patch("/tanks/min-vol", summary="设置水箱最小体积", description="设置指定水箱的最小体积值", response_model=None) async def fastapi_set_tank_min_vol( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID"), @@ -407,7 +407,7 @@ async def fastapi_set_tank_min_vol( ps = {"id": tank, "min_vol": min_vol} return set_tank(network, ChangeSet(ps)) -@router.post("/settankvolcurve/", summary="设置水箱容积曲线", description="设置指定水箱的容积曲线标识", response_model=None) +@router.patch("/tanks/vol-curve", summary="设置水箱容积曲线", description="设置指定水箱的容积曲线标识", response_model=None) async def fastapi_set_tank_vol_curve( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID"), @@ -427,7 +427,7 @@ async def fastapi_set_tank_vol_curve( ps = {"id": tank, "vol_curve": vol_curve} return set_tank(network, ChangeSet(ps)) -@router.post("/settankoverflow/", summary="设置水箱溢流口", description="设置指定水箱的溢流口配置", response_model=None) +@router.patch("/tanks/overflow", summary="设置水箱溢流口", description="设置指定水箱的溢流口配置", response_model=None) async def fastapi_set_tank_overflow( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID"), @@ -447,7 +447,7 @@ async def fastapi_set_tank_overflow( ps = {"id": tank, "overflow": overflow} return set_tank(network, ChangeSet(ps)) -@router.post("/settankx/", summary="设置水箱X坐标", description="设置指定水箱的X坐标值", response_model=None) +@router.patch("/tanks/x", summary="设置水箱X坐标", description="设置指定水箱的X坐标值", response_model=None) async def fastapi_set_tank_x( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID"), @@ -467,7 +467,7 @@ async def fastapi_set_tank_x( ps = {"id": tank, "x": x} return set_tank(network, ChangeSet(ps)) -@router.post("/settanky/", summary="设置水箱Y坐标", description="设置指定水箱的Y坐标值", response_model=None) +@router.patch("/tanks/y", summary="设置水箱Y坐标", description="设置指定水箱的Y坐标值", response_model=None) async def fastapi_set_tank_y( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID"), @@ -487,7 +487,7 @@ async def fastapi_set_tank_y( ps = {"id": tank, "y": y} return set_tank(network, ChangeSet(ps)) -@router.post("/settankcoord/", summary="设置水箱坐标", description="设置指定水箱的X和Y坐标", response_model=None) +@router.patch("/tanks/coord", summary="设置水箱坐标", description="设置指定水箱的X和Y坐标", response_model=None) async def fastapi_set_tank_coord( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID"), @@ -509,7 +509,7 @@ async def fastapi_set_tank_coord( ps = {"id": tank, "x": x, "y": y} return set_tank(network, ChangeSet(ps)) -@router.get("/gettankproperties/", summary="获取水箱属性", description="获取指定水箱的所有属性") +@router.get("/tanks/properties", summary="获取水箱属性", description="获取指定水箱的所有属性") async def fastapi_get_tank_properties( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID") @@ -526,7 +526,7 @@ async def fastapi_get_tank_properties( """ return get_tank(network, tank) -@router.get("/getalltankproperties/", summary="获取所有水箱属性", description="获取指定网络中所有水箱的属性") +@router.get("/tanks", summary="获取所有水箱属性", description="获取指定网络中所有水箱的属性") async def fastapi_get_all_tank_properties( network: str = Query(..., description="管网名称(或数据库名称)") ) -> list[dict[str, Any]]: @@ -544,7 +544,7 @@ async def fastapi_get_all_tank_properties( results = get_all_tanks(network) return results -@router.post("/settankproperties/", summary="设置水箱属性", description="批量设置指定水箱的多个属性", response_model=None) +@router.patch("/tanks/properties", summary="设置水箱属性", description="批量设置指定水箱的多个属性", response_model=None) async def fastapi_set_tank_properties( network: str = Query(..., description="管网名称(或数据库名称)"), tank: str = Query(..., description="水箱ID"), diff --git a/app/api/v1/endpoints/network/valves.py b/app/api/v1/endpoints/network/valves.py index b6745b8..43acf30 100644 --- a/app/api/v1/endpoints/network/valves.py +++ b/app/api/v1/endpoints/network/valves.py @@ -15,7 +15,7 @@ from app.services.tjnetwork import ( router = APIRouter() @router.get( - "/getvalveschema", + "/network-schemas/valve", summary="获取阀门架构", description="获取指定水网中所有阀门的架构和字段定义", ) @@ -30,7 +30,7 @@ async def fastapi_get_valve_schema( return get_valve_schema(network) @router.post( - "/addvalve/", + "/valves", response_model=None, summary="添加阀门", description="在指定的水网中添加新的阀门", @@ -62,8 +62,8 @@ async def fastapi_add_valve( return add_valve(network, ChangeSet(ps)) -@router.post( - "/deletevalve/", +@router.delete( + "/valves", response_model=None, summary="删除阀门", description="从指定的水网中删除指定的阀门", @@ -81,7 +81,7 @@ async def fastapi_delete_valve( return delete_valve(network, ChangeSet(ps)) @router.get( - "/getvalvenode1/", + "/valves/node1", summary="获取阀门起点节点", description="获取指定阀门连接的起点节点ID", ) @@ -98,7 +98,7 @@ async def fastapi_get_valve_node1( return ps["node1"] @router.get( - "/getvalvenode2/", + "/valves/node2", summary="获取阀门终点节点", description="获取指定阀门连接的终点节点ID", ) @@ -115,7 +115,7 @@ async def fastapi_get_valve_node2( return ps["node2"] @router.get( - "/getvalvediameter/", + "/valves/diameter", summary="获取阀门直径", description="获取指定阀门的直径", ) @@ -132,7 +132,7 @@ async def fastapi_get_valve_diameter( return ps["diameter"] @router.get( - "/getvalvetype/", + "/valves/type", summary="获取阀门类型", description="获取指定阀门的类型", ) @@ -149,7 +149,7 @@ async def fastapi_get_valve_type( return ps["type"] @router.get( - "/getvalvesetting/", + "/valves/setting", summary="获取阀门开度", description="获取指定阀门的开度/设置值", ) @@ -166,7 +166,7 @@ async def fastapi_get_valve_setting( return ps["setting"] @router.get( - "/getvalveminorloss/", + "/valves/minor-loss", summary="获取阀门损失系数", description="获取指定阀门的损失系数", ) @@ -182,8 +182,8 @@ async def fastapi_get_valve_minor_loss( ps = get_valve(network, valve) return ps["minor_loss"] -@router.post( - "/setvalvenode1/", +@router.patch( + "/valves/node1", response_model=None, summary="设置阀门起点节点", description="设置指定阀门的起点节点", @@ -201,8 +201,8 @@ async def fastapi_set_valve_node1( ps = {"id": valve, "node1": node1} return set_valve(network, ChangeSet(ps)) -@router.post( - "/setvalvenode2/", +@router.patch( + "/valves/node2", response_model=None, summary="设置阀门终点节点", description="设置指定阀门的终点节点", @@ -220,8 +220,8 @@ async def fastapi_set_valve_node2( ps = {"id": valve, "node2": node2} return set_valve(network, ChangeSet(ps)) -@router.post( - "/setvalvenodediameter/", +@router.patch( + "/valves/diameter", response_model=None, summary="设置阀门直径", description="设置指定阀门的直径", @@ -239,8 +239,8 @@ async def fastapi_set_valve_diameter( ps = {"id": valve, "diameter": diameter} return set_valve(network, ChangeSet(ps)) -@router.post( - "/setvalvetype/", +@router.patch( + "/valves/type", response_model=None, summary="设置阀门类型", description="设置指定阀门的类型", @@ -258,8 +258,8 @@ async def fastapi_set_valve_type( ps = {"id": valve, "type": type} return set_valve(network, ChangeSet(ps)) -@router.post( - "/setvalvesetting/", +@router.patch( + "/valves/setting", response_model=None, summary="设置阀门开度", description="设置指定阀门的开度/设置值", @@ -278,7 +278,7 @@ async def fastapi_set_valve_setting( return set_valve(network, ChangeSet(ps)) @router.get( - "/getvalveproperties/", + "/valves/properties", summary="获取阀门所有属性", description="获取指定阀门的所有属性", ) @@ -294,7 +294,7 @@ async def fastapi_get_valve_properties( return get_valve(network, valve) @router.get( - "/getallvalveproperties/", + "/valves", summary="获取所有阀门属性", description="获取指定水网中所有阀门的属性", ) @@ -311,8 +311,8 @@ async def fastapi_get_all_valve_properties( results = get_all_valves(network) return results -@router.post( - "/setvalveproperties/", +@router.patch( + "/valves/properties", response_model=None, summary="批量设置阀门属性", description="批量设置指定阀门的多个属性", diff --git a/app/api/v1/endpoints/project.py b/app/api/v1/endpoints/project.py index b0afe84..cf34a77 100644 --- a/app/api/v1/endpoints/project.py +++ b/app/api/v1/endpoints/project.py @@ -45,8 +45,7 @@ inpDir = "data/" # Assuming data directory exists or is defined somewhere. router = APIRouter() lockedPrjs: Dict[str, str] = {} -@router.get("/project-info", summary="获取项目信息", description="从数据库获取项目的详细信息,包括地图范围等。", response_model=ProjectMetaResponse) -@router.get("/project_info/", summary="获取项目信息(旧路径)", description="从数据库获取项目的详细信息,包括地图范围等。", response_model=ProjectMetaResponse, deprecated=True) +@router.get("/projects/current", summary="获取项目信息", description="从数据库获取项目的详细信息,包括地图范围等。", response_model=ProjectMetaResponse) async def get_project_info_endpoint( network: str = Query(..., description="管网名称(或项目代码)"), metadata_repo: MetadataRepository = Depends(get_metadata_repository), @@ -70,7 +69,7 @@ async def get_project_info_endpoint( project_role="viewer", # Default role for public access ) -@router.get("/listprojects/", summary="获取项目列表", description="获取服务器上所有可用的供水管网项目名称列表。") +@router.get("/project-codes", summary="获取项目列表", description="获取服务器上所有可用的供水管网项目名称列表。") async def list_projects_endpoint() -> list[str]: """ 获取项目列表 @@ -79,7 +78,7 @@ async def list_projects_endpoint() -> list[str]: """ return list_project() -@router.get("/haveproject/", summary="检查项目是否存在", description="检查指定名称的项目是否存在。") +@router.get("/projects/existence", summary="检查项目是否存在", description="检查指定名称的项目是否存在。") async def have_project_endpoint( network: str = Query(..., description="管网名称(或数据库名称)") ): @@ -90,7 +89,7 @@ async def have_project_endpoint( """ return have_project(network) -@router.post("/createproject/", summary="创建新项目", description="创建一个新的供水管网项目。如果项目已存在,可能会覆盖或报错(取决于底层实现)。") +@router.post("/projects", summary="创建新项目", description="创建一个新的供水管网项目。如果项目已存在,可能会覆盖或报错(取决于底层实现)。") async def create_project_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), _=Depends(require_permission(ENVIRONMENT_MANAGE)), @@ -103,7 +102,7 @@ async def create_project_endpoint( create_project(network) return network -@router.post("/deleteproject/", summary="删除项目", description="永久删除指定的供水管网项目。此操作不可恢复。") +@router.delete("/projects", summary="删除项目", description="永久删除指定的供水管网项目。此操作不可恢复。") async def delete_project_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), _=Depends(require_permission(ENVIRONMENT_MANAGE)), @@ -116,7 +115,7 @@ async def delete_project_endpoint( delete_project(network) return True -@router.get("/isprojectopen/", summary="检查项目是否已打开", description="检查指定项目是否已被加载到内存中。") +@router.get("/projects/current/status", summary="检查项目是否已打开", description="检查指定项目是否已被加载到内存中。") async def is_project_open_endpoint( network: str = Query(..., description="管网名称(或数据库名称)") ): @@ -127,8 +126,7 @@ async def is_project_open_endpoint( """ return is_project_open(network) -@router.post("/projects/open", summary="打开项目", description="将指定项目加载到内存中,并初始化数据库连接池。") -@router.post("/openproject/", summary="打开项目(旧路径)", description="将指定项目加载到内存中,并初始化数据库连接池。", deprecated=True) +@router.post("/projects/current", summary="打开项目", description="将指定项目加载到内存中,并初始化数据库连接池。") async def open_project_endpoint( network: str = Query(..., description="管网名称(或数据库名称)") ): @@ -162,7 +160,7 @@ async def open_project_endpoint( return network -@router.post("/closeproject/", summary="关闭项目", description="将指定项目从内存中卸载,释放资源。") +@router.delete("/projects/current", summary="关闭项目", description="将指定项目从内存中卸载,释放资源。") async def close_project_endpoint( network: str = Query(..., description="管网名称(或数据库名称)") ): @@ -174,7 +172,7 @@ async def close_project_endpoint( close_project(network) return True -@router.post("/copyproject/", summary="复制项目", description="将现有项目复制为新项目。") +@router.post("/project-copies", summary="复制项目", description="将现有项目复制为新项目。") async def copy_project_endpoint( source: str = Query(..., description="管网名称(或数据库名称)"), target: str = Query(..., description="管网名称(或数据库名称)"), @@ -189,7 +187,7 @@ async def copy_project_endpoint( copy_project(source, target) return True -@router.get("/exportinp/", response_model=None, summary="导出项目为 ChangeSet", description="导出项目的变更集 (ChangeSet),包含顶点、SCADA 元素、DMA、SA、VD 等信息。") +@router.get("/projects/current/exports/change-set", response_model=None, summary="导出项目为 ChangeSet", description="导出项目的变更集 (ChangeSet),包含顶点、SCADA 元素、DMA、SA、VD 等信息。") async def export_inp_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), version: str = Query(..., description="版本号 (通常用于增量更新)") @@ -222,7 +220,7 @@ async def export_inp_endpoint( return cs -@router.post("/readinp/", summary="读取 INP 文件到项目", description="从服务器文件系统中读取指定的 INP 文件并加载到项目中。") +@router.post("/projects/current/imports", summary="读取 INP 文件到项目", description="从服务器文件系统中读取指定的 INP 文件并加载到项目中。") async def read_inp_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), inp: str = Query(..., description="INP 文件名 (不包含路径)") @@ -236,7 +234,7 @@ async def read_inp_endpoint( read_inp(network, inp) return True -@router.get("/dumpinp/", summary="导出项目到 INP 文件", description="将项目当前状态保存为 INP 文件到服务器文件系统。") +@router.post("/projects/current/exports/inp", summary="导出项目到 INP 文件", description="将项目当前状态保存为 INP 文件到服务器文件系统。") async def dump_inp_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), inp: str = Query(..., description="目标文件名") @@ -250,7 +248,7 @@ async def dump_inp_endpoint( dump_inp(network, inp) return True -@router.get("/isprojectlocked/", summary="检查项目是否被锁定", description="检查指定项目是否处于锁定状态。") +@router.get("/projects/current/lock", summary="检查项目是否被锁定", description="检查指定项目是否处于锁定状态。") async def is_project_locked_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -262,7 +260,7 @@ async def is_project_locked_endpoint( """ return network in lockedPrjs.keys() -@router.get("/isprojectlockedbyme/", summary="检查项目是否被当前用户锁定", description="检查指定项目是否被当前客户端 (IP) 锁定。") +@router.get("/projects/current/lock/ownership", summary="检查项目是否被当前用户锁定", description="检查指定项目是否被当前客户端 (IP) 锁定。") async def is_project_locked_by_me_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -278,7 +276,7 @@ async def is_project_locked_by_me_endpoint( # 0 successfully locked # 1 already locked by you # 2 locked by others -@router.post("/lockproject/", summary="锁定项目", description="锁定指定项目以防止并发修改。") +@router.post("/projects/current/lock", summary="锁定项目", description="锁定指定项目以防止并发修改。") async def lock_project_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -301,7 +299,7 @@ async def lock_project_endpoint( else: return 2 -@router.post("/unlockproject/", summary="解锁项目", description="释放对项目的锁定。") +@router.delete("/projects/current/lock", summary="解锁项目", description="释放对项目的锁定。") def unlock_project_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -319,7 +317,7 @@ def unlock_project_endpoint( return False -@router.get("/downloadinp/", status_code=status.HTTP_200_OK, summary="下载 INP 文件", description="从服务器数据目录下载指定的 INP 文件。") +@router.get("/projects/current/files/inp", status_code=status.HTTP_200_OK, summary="下载 INP 文件", description="从服务器数据目录下载指定的 INP 文件。") async def fastapi_download_inp( name: str = Query(..., description="文件名"), response: Response = None @@ -339,7 +337,7 @@ async def fastapi_download_inp( return True # DingZQ, 2024-12-28, convert v3 to v2 -@router.get("/convertv3tov2/", response_model=None, summary="转换 INP V3 为 V2", description="将 EPANET 3.0 格式的 INP 内容转换为 2.x 格式。") +@router.post("/project-conversions", response_model=None, summary="转换 INP V3 为 V2", description="将 EPANET 3.0 格式的 INP 内容转换为 2.x 格式。") async def fastapi_convert_v3_to_v2( req: Request ) -> ChangeSet: @@ -373,7 +371,6 @@ async def fastapi_convert_v3_to_v2( return cs -@router.post("/readinp/", summary="读取 INP 文件到项目", description="从服务器文件系统中读取指定的 INP 文件并加载到项目中。") async def read_inp_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), inp: str = Query(..., description="INP 文件名 (不包含路径)") @@ -387,7 +384,6 @@ async def read_inp_endpoint( read_inp(network, inp) return True -@router.get("/dumpinp/", summary="导出项目到 INP 文件", description="将项目当前状态保存为 INP 文件到服务器文件系统。") async def dump_inp_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), inp: str = Query(..., description="目标文件名") @@ -401,7 +397,6 @@ async def dump_inp_endpoint( dump_inp(network, inp) return True -@router.get("/isprojectlocked/", summary="检查项目是否被锁定", description="检查指定项目是否处于锁定状态。") async def is_project_locked_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -413,7 +408,6 @@ async def is_project_locked_endpoint( """ return network in lockedPrjs.keys() -@router.get("/isprojectlockedbyme/", summary="检查项目是否被当前用户锁定", description="检查指定项目是否被当前客户端 (IP) 锁定。") async def is_project_locked_by_me_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -429,7 +423,6 @@ async def is_project_locked_by_me_endpoint( # 0 successfully locked # 1 already locked by you # 2 locked by others -@router.post("/lockproject/", summary="锁定项目", description="锁定指定项目以防止并发修改。") async def lock_project_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -452,7 +445,6 @@ async def lock_project_endpoint( else: return 2 -@router.post("/unlockproject/", summary="解锁项目", description="释放对项目的锁定。") def unlock_project_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -470,7 +462,6 @@ def unlock_project_endpoint( return False -@router.get("/downloadinp/", status_code=status.HTTP_200_OK, summary="下载 INP 文件", description="从服务器数据目录下载指定的 INP 文件。") async def fastapi_download_inp( name: str = Query(..., description="文件名"), response: Response = None @@ -490,7 +481,6 @@ async def fastapi_download_inp( return True # DingZQ, 2024-12-28, convert v3 to v2 -@router.get("/convertv3tov2/", response_model=None, summary="转换 INP V3 为 V2", description="将 EPANET 3.0 格式的 INP 内容转换为 2.x 格式。") async def fastapi_convert_v3_to_v2( req: Request ) -> ChangeSet: diff --git a/app/api/v1/endpoints/project_data.py b/app/api/v1/endpoints/project_data.py index 58efa1b..dcf333a 100644 --- a/app/api/v1/endpoints/project_data.py +++ b/app/api/v1/endpoints/project_data.py @@ -15,7 +15,7 @@ async def get_database_connection( yield conn -@router.get("/scada-info", summary="获取SCADA信息", description="使用连接池查询所有SCADA信息") +@router.get("/scada-info/database-view", summary="获取SCADA信息", description="使用连接池查询所有SCADA信息") async def get_scada_info_with_connection( conn: AsyncConnection = Depends(get_database_connection), ): @@ -33,7 +33,7 @@ async def get_scada_info_with_connection( ) -@router.get("/scheme-list", summary="获取方案列表", description="使用连接池查询所有方案信息") +@router.get("/schemes/list-with-connection", summary="获取方案列表", description="使用连接池查询所有方案信息") async def get_scheme_list_with_connection( conn: AsyncConnection = Depends(get_database_connection), ): @@ -49,7 +49,7 @@ async def get_scheme_list_with_connection( raise HTTPException(status_code=500, detail=f"查询方案信息时发生错误: {str(e)}") -@router.get("/burst-locate-result", summary="获取爆管定位结果", description="使用连接池查询所有爆管定位结果") +@router.get("/burst-locations/database-view", summary="获取爆管定位结果", description="使用连接池查询所有爆管定位结果") async def get_burst_locate_result_with_connection( conn: AsyncConnection = Depends(get_database_connection), ): @@ -67,7 +67,7 @@ async def get_burst_locate_result_with_connection( ) -@router.get("/burst-locate-result/{burst_incident}", summary="按事件查询爆管定位结果", description="根据爆管事件ID查询对应的爆管定位结果") +@router.get("/burst-locations/{burst_incident}", summary="按事件查询爆管定位结果", description="根据爆管事件ID查询对应的爆管定位结果") async def get_burst_locate_result_by_incident( burst_incident: str = Path(..., description="爆管事件ID"), conn: AsyncConnection = Depends(get_database_connection), diff --git a/app/api/v1/endpoints/risk.py b/app/api/v1/endpoints/risk.py index 20a009c..58a2b02 100644 --- a/app/api/v1/endpoints/risk.py +++ b/app/api/v1/endpoints/risk.py @@ -11,7 +11,7 @@ from app.services.tjnetwork import ( router = APIRouter() @router.get( - "/getpiperiskprobabilitynow/", + "/pipes/risk-probability-now", summary="获取管道当前风险概率", description="获取指定管道当前时刻的风险概率值" ) @@ -35,7 +35,7 @@ async def fastapi_get_pipe_risk_probability_now( @router.get( - "/getpiperiskprobability/", + "/pipes/risk-probability", summary="获取管道风险概率历史", description="获取指定管道的风险概率历史数据" ) @@ -59,7 +59,7 @@ async def fastapi_get_pipe_risk_probability( @router.get( - "/getpipesriskprobability/", + "/pipes-risk-probabilities", summary="批量获取多条管道风险概率", description="批量获取多条管道的风险概率值" ) @@ -84,7 +84,7 @@ async def fastapi_get_pipes_risk_probability( @router.get( - "/getnetworkpiperiskprobabilitynow/", + "/network-pipe-risk-probability-nows", summary="获取整个网络的管道风险概率", description="获取指定网络中所有管道的当前风险概率值" ) @@ -106,7 +106,7 @@ async def fastapi_get_network_pipe_risk_probability_now( @router.get( - "/getpiperiskprobabilitygeometries/", + "/pipes/risk-probability-geometries", summary="获取管道风险几何信息", description="获取指定网络中管道的风险相关几何数据" ) diff --git a/app/api/v1/endpoints/scada.py b/app/api/v1/endpoints/scada.py index 29b8fee..48f822c 100644 --- a/app/api/v1/endpoints/scada.py +++ b/app/api/v1/endpoints/scada.py @@ -31,7 +31,6 @@ from app.services.tjnetwork import ( router = APIRouter() -@router.get("/getscadaproperties/", summary="获取SCADA属性", tags=["SCADA基础"]) async def fast_get_scada_properties( network: str = Query(..., description="管网名称(或数据库名称)"), scada: str = Query(..., description="SCADA设备ID") @@ -50,7 +49,6 @@ async def fast_get_scada_properties( """ return get_scada_info(network, scada) -@router.get("/getallscadaproperties/", summary="获取所有SCADA属性", tags=["SCADA基础"]) async def fast_get_all_scada_properties( network: str = Query(..., description="管网名称(或数据库名称)") ) -> list[dict[str, Any]]: @@ -72,7 +70,7 @@ async def fast_get_all_scada_properties( # scada_device 设备管理 ############################################################ -@router.get("/getscadadeviceschema/", summary="获取SCADA设备架构", tags=["SCADA设备"]) +@router.get("/network-schemas/scada-device", summary="获取SCADA设备架构", tags=["SCADA设备"]) async def fastapi_get_scada_device_schema( network: str = Query(..., description="管网名称(或数据库名称)") ) -> dict[str, dict[str, Any]]: @@ -89,7 +87,7 @@ async def fastapi_get_scada_device_schema( """ return get_scada_device_schema(network) -@router.get("/getscadadevice/", summary="获取SCADA设备", tags=["SCADA设备"]) +@router.get("/scada-devices/detail", summary="获取SCADA设备", tags=["SCADA设备"]) async def fastapi_get_scada_device( network: str = Query(..., description="管网名称(或数据库名称)"), id: str = Query(..., description="SCADA设备ID") @@ -108,7 +106,7 @@ async def fastapi_get_scada_device( """ return get_scada_device(network, id) -@router.post("/setscadadevice/", response_model=None, summary="更新SCADA设备", tags=["SCADA设备"]) +@router.patch("/scada-devices", response_model=None, summary="更新SCADA设备", tags=["SCADA设备"]) async def fastapi_set_scada_device( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -128,7 +126,7 @@ async def fastapi_set_scada_device( props = await req.json() return set_scada_device(network, ChangeSet(props)) -@router.post("/addscadadevice/", response_model=None, summary="添加SCADA设备", tags=["SCADA设备"]) +@router.post("/scada-devices", response_model=None, summary="添加SCADA设备", tags=["SCADA设备"]) async def fastapi_add_scada_device( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -148,7 +146,7 @@ async def fastapi_add_scada_device( props = await req.json() return add_scada_device(network, ChangeSet(props)) -@router.post("/deletescadadevice/", response_model=None, summary="删除SCADA设备", tags=["SCADA设备"]) +@router.delete("/scada-devices", response_model=None, summary="删除SCADA设备", tags=["SCADA设备"]) async def fastapi_delete_scada_device( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -168,7 +166,7 @@ async def fastapi_delete_scada_device( props = await req.json() return delete_scada_device(network, ChangeSet(props)) -@router.post("/cleanscadadevice/", response_model=None, summary="清空SCADA设备表", tags=["SCADA设备"]) +@router.post("/scada-device-cleaning-runs", response_model=None, summary="清空SCADA设备表", tags=["SCADA设备"]) async def fastapi_clean_scada_device( network: str = Query(..., description="管网名称(或数据库名称)") ) -> ChangeSet: @@ -185,7 +183,7 @@ async def fastapi_clean_scada_device( """ return clean_scada_device(network) -@router.get("/getallscadadeviceids/", summary="获取所有SCADA设备ID", tags=["SCADA设备"]) +@router.get("/scada-devices/ids", summary="获取所有SCADA设备ID", tags=["SCADA设备"]) async def fastapi_get_all_scada_device_ids( network: str = Query(..., description="管网名称(或数据库名称)") ) -> list[str]: @@ -200,7 +198,7 @@ async def fastapi_get_all_scada_device_ids( """ return get_all_scada_device_ids(network) -@router.get("/getallscadadevices/", summary="获取所有SCADA设备", tags=["SCADA设备"]) +@router.get("/scada-devices", summary="获取所有SCADA设备", tags=["SCADA设备"]) async def fastapi_get_all_scada_devices( network: str = Query(..., description="管网名称(或数据库名称)") ) -> list[dict[str, Any]]: @@ -220,7 +218,7 @@ async def fastapi_get_all_scada_devices( # scada_device_data 设备数据管理 ############################################################ -@router.get("/getscadadevicedataschema/", summary="获取SCADA设备数据架构", tags=["SCADA设备数据"]) +@router.get("/network-schemas/scada-device-data", summary="获取SCADA设备数据架构", tags=["SCADA设备数据"]) async def fastapi_get_scada_device_data_schema( network: str = Query(..., description="管网名称(或数据库名称)"), ) -> dict[str, dict[str, Any]]: @@ -237,7 +235,7 @@ async def fastapi_get_scada_device_data_schema( """ return get_scada_device_data_schema(network) -@router.get("/getscadadevicedata/", summary="获取SCADA设备数据", tags=["SCADA设备数据"]) +@router.get("/scada-device-datas/detail", summary="获取SCADA设备数据", tags=["SCADA设备数据"]) async def fastapi_get_scada_device_data( network: str = Query(..., description="管网名称(或数据库名称)"), device_id: str = Query(..., description="SCADA设备ID") @@ -256,7 +254,7 @@ async def fastapi_get_scada_device_data( """ return get_scada_device_data(network, device_id) -@router.post("/setscadadevicedata/", response_model=None, summary="更新SCADA设备数据", tags=["SCADA设备数据"]) +@router.patch("/scada-device-datas", response_model=None, summary="更新SCADA设备数据", tags=["SCADA设备数据"]) async def fastapi_set_scada_device_data( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -276,7 +274,7 @@ async def fastapi_set_scada_device_data( props = await req.json() return set_scada_device_data(network, ChangeSet(props)) -@router.post("/addscadadevicedata/", response_model=None, summary="添加SCADA设备数据", tags=["SCADA设备数据"]) +@router.post("/scada-device-datas", response_model=None, summary="添加SCADA设备数据", tags=["SCADA设备数据"]) async def fastapi_add_scada_device_data( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -296,7 +294,7 @@ async def fastapi_add_scada_device_data( props = await req.json() return add_scada_device_data(network, ChangeSet(props)) -@router.post("/deletescadadevicedata/", response_model=None, summary="删除SCADA设备数据", tags=["SCADA设备数据"]) +@router.delete("/scada-device-datas", response_model=None, summary="删除SCADA设备数据", tags=["SCADA设备数据"]) async def fastapi_delete_scada_device_data( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -316,7 +314,7 @@ async def fastapi_delete_scada_device_data( props = await req.json() return delete_scada_device_data(network, ChangeSet(props)) -@router.post("/cleanscadadevicedata/", response_model=None, summary="清空SCADA设备数据表", tags=["SCADA设备数据"]) +@router.post("/scada-device-data-cleaning-runs", response_model=None, summary="清空SCADA设备数据表", tags=["SCADA设备数据"]) async def fastapi_clean_scada_device_data( network: str = Query(..., description="管网名称(或数据库名称)") ) -> ChangeSet: @@ -338,7 +336,7 @@ async def fastapi_clean_scada_device_data( # scada_element SCADA元素映射 ############################################################ -@router.get("/getscadaelementschema/", summary="获取SCADA元素架构", tags=["SCADA元素映射"]) +@router.get("/network-schemas/scada-element", summary="获取SCADA元素架构", tags=["SCADA元素映射"]) async def fastapi_get_scada_element_schema( network: str = Query(..., description="管网名称(或数据库名称)"), ) -> dict[str, dict[str, Any]]: @@ -355,7 +353,7 @@ async def fastapi_get_scada_element_schema( """ return get_scada_element_schema(network) -@router.get("/getscadaelements/", summary="获取所有SCADA元素映射", tags=["SCADA元素映射"]) +@router.get("/scada-elements", summary="获取所有SCADA元素映射", tags=["SCADA元素映射"]) async def fastapi_get_scada_elements( network: str = Query(..., description="管网名称(或数据库名称)") ) -> list[dict[str, Any]]: @@ -372,7 +370,7 @@ async def fastapi_get_scada_elements( """ return get_all_scada_elements(network) -@router.get("/getscadaelement/", summary="获取单个SCADA元素映射", tags=["SCADA元素映射"]) +@router.get("/scada-elements/detail", summary="获取单个SCADA元素映射", tags=["SCADA元素映射"]) async def fastapi_get_scada_element( network: str = Query(..., description="管网名称(或数据库名称)"), id: str = Query(..., description="SCADA元素映射ID") @@ -391,7 +389,7 @@ async def fastapi_get_scada_element( """ return get_scada_element(network, id) -@router.post("/setscadaelement/", response_model=None, summary="更新SCADA元素映射", tags=["SCADA元素映射"]) +@router.patch("/scada-elements", response_model=None, summary="更新SCADA元素映射", tags=["SCADA元素映射"]) async def fastapi_set_scada_element( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -411,7 +409,7 @@ async def fastapi_set_scada_element( props = await req.json() return set_scada_element(network, ChangeSet(props)) -@router.post("/addscadaelement/", response_model=None, summary="添加SCADA元素映射", tags=["SCADA元素映射"]) +@router.post("/scada-elements", response_model=None, summary="添加SCADA元素映射", tags=["SCADA元素映射"]) async def fastapi_add_scada_element( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -431,7 +429,7 @@ async def fastapi_add_scada_element( props = await req.json() return add_scada_element(network, ChangeSet(props)) -@router.post("/deletescadaelement/", response_model=None, summary="删除SCADA元素映射", tags=["SCADA元素映射"]) +@router.delete("/scada-elements", response_model=None, summary="删除SCADA元素映射", tags=["SCADA元素映射"]) async def fastapi_delete_scada_element( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -451,7 +449,7 @@ async def fastapi_delete_scada_element( props = await req.json() return delete_scada_element(network, ChangeSet(props)) -@router.post("/cleanscadaelement/", response_model=None, summary="清空SCADA元素映射表", tags=["SCADA元素映射"]) +@router.post("/scada-element-cleaning-runs", response_model=None, summary="清空SCADA元素映射表", tags=["SCADA元素映射"]) async def fastapi_clean_scada_element( network: str = Query(..., description="管网名称(或数据库名称)") ) -> ChangeSet: @@ -473,7 +471,7 @@ async def fastapi_clean_scada_element( # scada_info SCADA信息 ############################################################ -@router.get("/getscadainfoschema/", summary="获取SCADA信息架构", tags=["SCADA信息"]) +@router.get("/scada-info-schemas", summary="获取SCADA信息架构", tags=["SCADA信息"]) async def fastapi_get_scada_info_schema( network: str = Query(..., description="管网名称(或数据库名称)") ) -> dict[str, dict[str, Any]]: @@ -490,7 +488,7 @@ async def fastapi_get_scada_info_schema( """ return get_scada_info_schema(network) -@router.get("/getscadainfo/", summary="获取SCADA信息", tags=["SCADA信息"]) +@router.get("/scada-info/detail", summary="获取SCADA信息", tags=["SCADA信息"]) async def fastapi_get_scada_info( network: str = Query(..., description="管网名称(或数据库名称)"), id: str = Query(..., description="SCADA信息ID") @@ -509,7 +507,7 @@ async def fastapi_get_scada_info( """ return get_scada_info(network, id) -@router.get("/getallscadainfo/", summary="获取所有SCADA信息", tags=["SCADA信息"]) +@router.get("/scada-info", summary="获取所有SCADA信息", tags=["SCADA信息"]) async def fastapi_get_all_scada_info( network: str = Query(..., description="管网名称(或数据库名称)") ) -> list[dict[str, Any]]: diff --git a/app/api/v1/endpoints/schemes.py b/app/api/v1/endpoints/schemes.py index 7195ad4..ff365cc 100644 --- a/app/api/v1/endpoints/schemes.py +++ b/app/api/v1/endpoints/schemes.py @@ -7,7 +7,7 @@ from app.services.time_api import extract_date router = APIRouter() -@router.get("/getschemeschema/", summary="获取方案模式", description="获取指定网络的方案模式定义") +@router.get("/network-schemas/scheme", summary="获取方案模式", description="获取指定网络的方案模式定义") async def fastapi_get_scheme_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[Any, Any]]: """ 获取方案模式定义 @@ -16,7 +16,7 @@ async def fastapi_get_scheme_schema(network: str = Query(..., description="管 """ return get_scheme_schema(network) -@router.get("/getscheme/", summary="获取单个方案", description="根据名称获取指定的方案信息") +@router.get("/schemes/detail", summary="获取单个方案", description="根据名称获取指定的方案信息") async def fastapi_get_scheme(network: str = Query(..., description="管网名称(或数据库名称)"), schema_name: str = Query(..., description="方案名称")) -> dict[Any, Any]: """ 获取单个方案详情 @@ -26,7 +26,6 @@ async def fastapi_get_scheme(network: str = Query(..., description="管网名称 return get_scheme(network, schema_name) @router.get("/schemes", summary="获取所有方案", description="获取指定网络的所有方案信息") -@router.get("/getallschemes/", summary="获取所有方案(旧路径)", description="获取指定网络的所有方案信息", deprecated=True) async def fastapi_get_all_schemes( network: str = Query(..., description="管网名称(或数据库名称)"), scheme_type: str | None = Query(None, description="方案类型;为空时返回全部类型"), diff --git a/app/api/v1/endpoints/sensor_placement.py b/app/api/v1/endpoints/sensor_placement.py index 6fd87c6..61f0b26 100644 --- a/app/api/v1/endpoints/sensor_placement.py +++ b/app/api/v1/endpoints/sensor_placement.py @@ -95,7 +95,7 @@ def _get_scheme_response( @router.post( - "/sensor-placement-schemes/optimize", + "/sensor-placement-optimization-runs", response_model=SensorPlacementSchemeResponse, summary="创建并返回监测点优化方案", ) diff --git a/app/api/v1/endpoints/simulation.py b/app/api/v1/endpoints/simulation.py index b4133ea..3720639 100644 --- a/app/api/v1/endpoints/simulation.py +++ b/app/api/v1/endpoints/simulation.py @@ -139,7 +139,7 @@ def run_simulation_manually_by_date( # 必须用这个PlainTextResponse,不然每个key都有引号 -@router.get("/runproject/", response_class=PlainTextResponse, summary="运行项目模拟", description="基于指定的管网项目运行标准水力模拟,返回纯文本格式的模拟报告。") +@router.post("/project-runs", response_class=PlainTextResponse, summary="运行项目模拟", description="基于指定的管网项目运行标准水力模拟,返回纯文本格式的模拟报告。") async def run_project_endpoint(network: str = Query(..., description="管网名称(或数据库名称)")) -> str: """ 运行项目模拟 @@ -155,7 +155,7 @@ async def run_project_endpoint(network: str = Query(..., description="管网名 # output 和 report # output 是 json # report 是 text -@router.get("/runprojectreturndict/", summary="运行项目模拟(返回字典)", description="基于指定的管网项目运行标准水力模拟,返回JSON格式的字典,包含输出数据和报告文本。") +@router.post("/project-return-dict-runs", summary="运行项目模拟(返回字典)", description="基于指定的管网项目运行标准水力模拟,返回JSON格式的字典,包含输出数据和报告文本。") async def run_project_return_dict_endpoint(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, Any]: """ 运行项目模拟(返回字典) @@ -172,7 +172,7 @@ async def run_project_return_dict_endpoint(network: str = Query(..., description # put in inp folder, name without extension -@router.get("/runinp/", summary="运行INP文件", description="运行指定INP文件格式的管网模型进行水力模拟。INP文件应该放在inp文件夹中,参数为文件名不含扩展名。") +@router.post("/inp-runs", summary="运行INP文件", description="运行指定INP文件格式的管网模型进行水力模拟。INP文件应该放在inp文件夹中,参数为文件名不含扩展名。") async def run_inp_endpoint(network: str = Query(..., description="inp文件名(不含扩展名)")) -> str: """ 运行INP文件 @@ -185,7 +185,7 @@ async def run_inp_endpoint(network: str = Query(..., description="inp文件名 # path is absolute path -@router.get("/dumpoutput/", summary="导出模拟输出", description="导出指定路径的模拟输出文件内容。参数应为绝对路径。") +@router.get("/outputs", summary="导出模拟输出", description="导出指定路径的模拟输出文件内容。参数应为绝对路径。") async def dump_output_endpoint(output: str = Query(..., description="模拟输出文件的绝对路径")) -> str: """ 导出模拟输出 @@ -198,8 +198,7 @@ async def dump_output_endpoint(output: str = Query(..., description="模拟输 # Analysis Endpoints -@router.get("/burst-analysis", summary="爆管分析(高级)", description="高级版本的爆管分析,支持在指定时间点修改泵控制模式和阀门开度,以分析这些改变对爆管影响的作用。支持固定泵和变速泵的独立控制。") -@router.get("/burst_analysis/", summary="爆管分析(高级,旧路径)", description="高级版本的爆管分析,支持在指定时间点修改泵控制模式和阀门开度,以分析这些改变对爆管影响的作用。支持固定泵和变速泵的独立控制。", deprecated=True) +@router.post("/burst-analyses", summary="爆管分析(高级)", description="高级版本的爆管分析,支持在指定时间点修改泵控制模式和阀门开度,以分析这些改变对爆管影响的作用。支持固定泵和变速泵的独立控制。") async def fastapi_burst_analysis( network: str = Query(..., description="管网名称(或数据库名称)"), modify_pattern_start_time: str = Query(..., description="模式修改开始时间(ISO 8601格式)"), @@ -233,7 +232,7 @@ async def fastapi_burst_analysis( return "success" -@router.get("/valve_close_analysis/", response_class=PlainTextResponse, summary="阀门关闭分析(高级)", description="高级版本的阀门关闭分析,支持同时关闭多个阀门,并在指定持续时间内进行模拟。返回纯文本格式的分析结果。") +@router.post("/valve-closure-analyses", response_class=PlainTextResponse, summary="阀门关闭分析(高级)", description="高级版本的阀门关闭分析,支持同时关闭多个阀门,并在指定持续时间内进行模拟。返回纯文本格式的分析结果。") async def fastapi_valve_close_analysis( network: str = Query(..., description="管网名称(或数据库名称)"), start_time: str = Query(..., description="阀门关闭开始时间(ISO 8601格式)"), @@ -262,8 +261,7 @@ async def fastapi_valve_close_analysis( return result or "success" -@router.get("/valve-isolation-analysis", summary="阀门隔离分析", description="分析当发生突发事件时,通过关闭指定阀门进行隔离,确定哪些阀门必须关闭、哪些可选关闭,以及隔离的可行性。") -@router.get("/valve_isolation_analysis/", summary="阀门隔离分析(旧路径)", description="分析当发生突发事件时,通过关闭指定阀门进行隔离,确定哪些阀门必须关闭、哪些可选关闭,以及隔离的可行性。", deprecated=True) +@router.post("/valve-isolation-analyses", summary="阀门隔离分析", description="分析当发生突发事件时,通过关闭指定阀门进行隔离,确定哪些阀门必须关闭、哪些可选关闭,以及隔离的可行性。") async def valve_isolation_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), accident_element: List[str] = Query(..., description="发生事故的管段/节点ID列表"), @@ -304,8 +302,7 @@ async def valve_isolation_endpoint( return result -@router.get("/flushing-analysis", response_class=PlainTextResponse, summary="冲洗分析(高级)", description="高级版本的冲洗分析,支持同时开启多个阀门进行冲洗,指定排污节点,并设置固定的冲洗流量。返回纯文本格式的分析结果。") -@router.get("/flushing_analysis/", response_class=PlainTextResponse, summary="冲洗分析(高级,旧路径)", description="高级版本的冲洗分析,支持同时开启多个阀门进行冲洗,指定排污节点,并设置固定的冲洗流量。返回纯文本格式的分析结果。", deprecated=True) +@router.post("/flushing-analyses", response_class=PlainTextResponse, summary="冲洗分析(高级)", description="高级版本的冲洗分析,支持同时开启多个阀门进行冲洗,指定排污节点,并设置固定的冲洗流量。返回纯文本格式的分析结果。") async def fastapi_flushing_analysis( network: str = Query(..., description="管网名称(或数据库名称)"), start_time: str = Query(..., description="冲洗开始时间(ISO 8601格式)"), @@ -347,8 +344,7 @@ async def fastapi_flushing_analysis( return result or "success" -@router.get("/contaminant-simulation", response_class=PlainTextResponse, summary="污染物模拟", description="对管网中的污染物扩散进行模拟,评估污染源对管网的影响范围和浓度分布。支持指定污染源位置、污染浓度和扩散模式。") -@router.get("/contaminant_simulation/", response_class=PlainTextResponse, summary="污染物模拟(旧路径)", description="对管网中的污染物扩散进行模拟,评估污染源对管网的影响范围和浓度分布。支持指定污染源位置、污染浓度和扩散模式。", deprecated=True) +@router.post("/contaminant-simulations", response_class=PlainTextResponse, summary="污染物模拟", description="对管网中的污染物扩散进行模拟,评估污染源对管网的影响范围和浓度分布。支持指定污染源位置、污染浓度和扩散模式。") async def fastapi_contaminant_simulation( network: str = Query(..., description="管网名称(或数据库名称)"), start_time: str = Query(..., description="污染开始时间(ISO 8601格式)"), @@ -385,7 +381,7 @@ async def fastapi_contaminant_simulation( return result or "success" -@router.get("/age_analysis/", response_class=PlainTextResponse, summary="水龄分析(高级)", description="高级版本的水龄分析,在指定时间点进行分析,支持自定义模拟持续时间。返回纯文本格式的分析结果。") +@router.post("/water-age-analyses", response_class=PlainTextResponse, summary="水龄分析(高级)", description="高级版本的水龄分析,在指定时间点进行分析,支持自定义模拟持续时间。返回纯文本格式的分析结果。") async def fastapi_age_analysis( network: str = Query(..., description="管网名称(或数据库名称)"), start_time: str = Query(..., description="分析开始时间(ISO 8601格式)"), @@ -409,7 +405,7 @@ async def fastapi_age_analysis( # return scheduling_analysis(network) -@router.get("/pressureregulation/", summary="压力调节(基础)", description="对管网的压力进行调节分析,通过控制泵的运行来维持目标节点的目标压力。此为基础版本。") +@router.post("/pressure-regulation-calculations", summary="压力调节(基础)", description="对管网的压力进行调节分析,通过控制泵的运行来维持目标节点的目标压力。此为基础版本。") async def pressure_regulation_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), target_node: str = Query(..., description="目标节点ID"), @@ -427,7 +423,7 @@ async def pressure_regulation_endpoint( return pressure_regulation(network, target_node, target_pressure) -@router.post("/pressure_regulation/", summary="压力调节(高级)", description="高级版本的压力调节分析,通过JSON请求体提供详细的控制参数,包括固定泵和变速泵的独立控制、水箱初始水位等。") +@router.post("/pressure-regulation-analyses", summary="压力调节(高级)", description="高级版本的压力调节分析,通过JSON请求体提供详细的控制参数,包括固定泵和变速泵的独立控制、水箱初始水位等。") async def fastapi_pressure_regulation(data: PressureRegulation = Body(..., description="压力调节控制参数")) -> str: """ 压力调节(高级版本) @@ -465,7 +461,7 @@ async def fastapi_pressure_regulation(data: PressureRegulation = Body(..., descr return "success" -@router.post("/project_management/", summary="项目管理(高级)", description="高级版本的项目管理,通过JSON请求体提供详细的控制参数,包括泵控制策略、水箱初始水位和区域需水量控制。") +@router.post("/project-managements", summary="项目管理(高级)", description="高级版本的项目管理,通过JSON请求体提供详细的控制参数,包括泵控制策略、水箱初始水位和区域需水量控制。") async def fastapi_project_management(data: ProjectManagement = Body(..., description="项目管理控制参数")) -> str: """ 项目管理(高级版本) @@ -494,7 +490,7 @@ async def fastapi_project_management(data: ProjectManagement = Body(..., descrip # return daily_scheduling_analysis(network) -@router.post("/scheduling_analysis/", summary="排程分析", description="对管网的供水排程进行分析,优化泵的运行时间和出水流量,平衡水厂出水、水箱进出水,满足用户需求。") +@router.post("/scheduling-analyses", summary="排程分析", description="对管网的供水排程进行分析,优化泵的运行时间和出水流量,平衡水厂出水、水箱进出水,满足用户需求。") async def fastapi_scheduling_analysis(data: SchedulingAnalysis = Body(..., description="排程分析参数")) -> str: """ 排程分析 @@ -520,7 +516,7 @@ async def fastapi_scheduling_analysis(data: SchedulingAnalysis = Body(..., descr ) -@router.post("/daily_scheduling_analysis/", summary="日排程分析", description="对管网的每日供水排程进行分析,优化水库、水厂、水箱和用户需求的协调,制定合理的每日排程方案。") +@router.post("/daily-scheduling-analyses", summary="日排程分析", description="对管网的每日供水排程进行分析,优化水库、水厂、水箱和用户需求的协调,制定合理的每日排程方案。") async def fastapi_daily_scheduling_analysis(data: DailySchedulingAnalysis = Body(..., description="日排程分析参数")) -> str: """ 日排程分析 @@ -552,7 +548,7 @@ async def fastapi_daily_scheduling_analysis(data: DailySchedulingAnalysis = Body # return pump_failure(network, pump_id, time) -@router.post("/pump_failure/", summary="泵故障管理", description="记录和管理泵的故障状态,包括故障发生时间和受影响的泵列表。系统将记录故障日志并更新泵状态。") +@router.post("/pump-failure-events", summary="泵故障管理", description="记录和管理泵的故障状态,包括故障发生时间和受影响的泵列表。系统将记录故障日志并更新泵状态。") async def fastapi_pump_failure(data: PumpFailureState = Body(..., description="泵故障状态信息")) -> str: """ 泵故障管理 @@ -596,7 +592,7 @@ async def fastapi_pump_failure(data: PumpFailureState = Body(..., description=" return json.dumps("SUCCESS") -@router.get("/pressuresensorplacementsensitivity/", summary="压力传感器放置-灵敏度分析(基础)", description="基于灵敏度分析方法,为指定管网项目确定最优的压力传感器放置位置。此为基础版本。") +@router.post("/pressure-sensor-placement-sensitivity-calculations", summary="压力传感器放置-灵敏度分析(基础)", description="基于灵敏度分析方法,为指定管网项目确定最优的压力传感器放置位置。此为基础版本。") async def pressure_sensor_placement_sensitivity_endpoint( name: str = Query(..., description="管网名称(或数据库名称)"), scheme_name: str = Query(..., description="放置方案名称"), @@ -620,7 +616,7 @@ async def pressure_sensor_placement_sensitivity_endpoint( ) -@router.post("/pressure_sensor_placement_sensitivity/", summary="压力传感器放置-灵敏度分析(高级)", description="高级版本的压力传感器放置分析,通过JSON请求体提供详细参数。基于灵敏度分析方法确定最优放置位置。") +@router.post("/pressure-sensor-placement-sensitivities", summary="压力传感器放置-灵敏度分析(高级)", description="高级版本的压力传感器放置分析,通过JSON请求体提供详细参数。基于灵敏度分析方法确定最优放置位置。") async def fastapi_pressure_sensor_placement_sensitivity( data: PressureSensorPlacement = Body(..., description="传感器放置分析参数"), ) -> None: @@ -646,7 +642,7 @@ async def fastapi_pressure_sensor_placement_sensitivity( ) -@router.get("/pressuresensorplacementkmeans/", summary="压力传感器放置-KMeans聚类分析(基础)", description="基于KMeans聚类算法,为指定管网项目确定压力传感器的最优放置位置。此为基础版本。") +@router.post("/pressure-sensor-placement-kmeans-calculations", summary="压力传感器放置-KMeans聚类分析(基础)", description="基于KMeans聚类算法,为指定管网项目确定压力传感器的最优放置位置。此为基础版本。") async def pressure_sensor_placement_kmeans_endpoint( name: str = Query(..., description="管网名称(或数据库名称)"), scheme_name: str = Query(..., description="放置方案名称"), @@ -670,7 +666,7 @@ async def pressure_sensor_placement_kmeans_endpoint( ) -@router.post("/pressure_sensor_placement_kmeans/", summary="压力传感器放置-KMeans聚类分析(高级)", description="高级版本的压力传感器放置分析,通过JSON请求体提供详细参数。基于KMeans聚类算法确定最优放置位置。") +@router.post("/pressure-sensor-placement-kmeans", summary="压力传感器放置-KMeans聚类分析(高级)", description="高级版本的压力传感器放置分析,通过JSON请求体提供详细参数。基于KMeans聚类算法确定最优放置位置。") async def fastapi_pressure_sensor_placement_kmeans( data: PressureSensorPlacement = Body(..., description="传感器放置分析参数"), ) -> None: @@ -697,7 +693,6 @@ async def fastapi_pressure_sensor_placement_kmeans( @router.post("/sensor-placement-schemes", summary="传感器放置方案创建", description="创建新的传感器放置方案,支持灵敏度分析和KMeans聚类两种方法。根据指定的方法自动计算最优的传感器放置位置。") -@router.post("/sensorplacementscheme/create", summary="传感器放置方案创建(旧路径)", description="创建新的传感器放置方案,支持灵敏度分析和KMeans聚类两种方法。根据指定的方法自动计算最优的传感器放置位置。", deprecated=True) async def fastapi_pressure_sensor_placement( network: str = Query(..., description="管网名称(或数据库名称)"), scheme_name: str = Query(..., description="放置方案名称"), @@ -745,8 +740,7 @@ async def fastapi_pressure_sensor_placement( return "success" -@router.post("/simulations/run-by-date", summary="手动运行日期指定模拟", description="根据指定的开始时间和持续时间,手动运行水力模拟。开始时间必须是显式带时区的 ISO 8601 / RFC3339 时间。") -@router.post("/runsimulationmanuallybydate/", summary="手动运行日期指定模拟(旧路径)", description="根据指定的开始时间和持续时间,手动运行水力模拟。开始时间必须是显式带时区的 ISO 8601 / RFC3339 时间。", deprecated=True) +@router.post("/simulation-runs", summary="手动运行日期指定模拟", description="根据指定的开始时间和持续时间,手动运行水力模拟。开始时间必须是显式带时区的 ISO 8601 / RFC3339 时间。") async def fastapi_run_simulation_manually_by_date( data: RunSimulationManuallyByDate = Body(..., description="模拟运行参数"), ) -> dict[str, str]: diff --git a/app/api/v1/endpoints/snapshots.py b/app/api/v1/endpoints/snapshots.py index e3690be..2d6e245 100644 --- a/app/api/v1/endpoints/snapshots.py +++ b/app/api/v1/endpoints/snapshots.py @@ -23,7 +23,7 @@ from app.services.tjnetwork import ( router = APIRouter() -@router.get("/getcurrentoperationid/", summary="获取当前操作ID", description="获取网络当前的操作ID") +@router.get("/current-operation-ids", summary="获取当前操作ID", description="获取网络当前的操作ID") async def get_current_operation_id_endpoint(network: str = Query(..., description="管网名称(或数据库名称)")) -> int: """ 获取当前操作ID @@ -32,7 +32,7 @@ async def get_current_operation_id_endpoint(network: str = Query(..., descriptio """ return get_current_operation(network) -@router.post("/undo/", summary="撤销操作", description="撤销网络上最后的一个操作") +@router.post("/undos", summary="撤销操作", description="撤销网络上最后的一个操作") async def undo_endpoint(network: str = Query(..., description="管网名称(或数据库名称)")): """ 撤销操作 @@ -41,7 +41,7 @@ async def undo_endpoint(network: str = Query(..., description="管网名称( """ return execute_undo(network) -@router.post("/redo/", summary="重做操作", description="重做网络上被撤销的操作") +@router.post("/redos", summary="重做操作", description="重做网络上被撤销的操作") async def redo_endpoint(network: str = Query(..., description="管网名称(或数据库名称)")): """ 重做操作 @@ -50,7 +50,7 @@ async def redo_endpoint(network: str = Query(..., description="管网名称( """ return execute_redo(network) -@router.get("/getsnapshots/", summary="获取快照列表", description="获取网络中的所有快照") +@router.get("/snapshots", summary="获取快照列表", description="获取网络中的所有快照") async def list_snapshot_endpoint(network: str = Query(..., description="管网名称(或数据库名称)")) -> list[tuple[int, str]]: """ 获取快照列表 @@ -59,7 +59,7 @@ async def list_snapshot_endpoint(network: str = Query(..., description="管网 """ return list_snapshot(network) -@router.get("/havesnapshot/", summary="检查快照是否存在", description="检查指定标签的快照是否存在") +@router.get("/snapshots/existence", summary="检查快照是否存在", description="检查指定标签的快照是否存在") async def have_snapshot_endpoint(network: str = Query(..., description="管网名称(或数据库名称)"), tag: str = Query(..., description="快照标签")) -> bool: """ 检查快照是否存在 @@ -68,7 +68,7 @@ async def have_snapshot_endpoint(network: str = Query(..., description="管网 """ return have_snapshot(network, tag) -@router.get("/havesnapshotforoperation/", summary="检查操作快照是否存在", description="检查指定操作ID的快照是否存在") +@router.get("/snapshot-for-operations", summary="检查操作快照是否存在", description="检查指定操作ID的快照是否存在") async def have_snapshot_for_operation_endpoint(network: str = Query(..., description="管网名称(或数据库名称)"), operation: int = Query(..., description="操作ID")) -> bool: """ 检查操作快照是否存在 @@ -77,7 +77,7 @@ async def have_snapshot_for_operation_endpoint(network: str = Query(..., descrip """ return have_snapshot_for_operation(network, operation) -@router.get("/havesnapshotforcurrentoperation/", summary="检查当前操作快照是否存在", description="检查当前操作的快照是否存在") +@router.get("/snapshot-for-current-operations", summary="检查当前操作快照是否存在", description="检查当前操作的快照是否存在") async def have_snapshot_for_current_operation_endpoint(network: str = Query(..., description="管网名称(或数据库名称)")) -> bool: """ 检查当前操作快照是否存在 @@ -86,7 +86,7 @@ async def have_snapshot_for_current_operation_endpoint(network: str = Query(..., """ return have_snapshot_for_current_operation(network) -@router.post("/takesnapshotforoperation/", summary="为操作创建快照", description="为指定的操作创建快照") +@router.post("/snapshot-for-operations", summary="为操作创建快照", description="为指定的操作创建快照") async def take_snapshot_for_operation_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), operation: int = Query(..., description="操作ID"), @@ -99,7 +99,7 @@ async def take_snapshot_for_operation_endpoint( """ return take_snapshot_for_operation(network, operation, tag) -@router.post("/takesnapshotforcurrentoperation", summary="为当前操作创建快照", description="为当前操作创建快照") +@router.post("/snapshot-for-current-operations", summary="为当前操作创建快照", description="为当前操作创建快照") async def take_snapshot_for_current_operation_endpoint(network: str = Query(..., description="管网名称(或数据库名称)"), tag: str = Query(..., description="快照标签")) -> None: """ 为当前操作创建快照 @@ -108,17 +108,7 @@ async def take_snapshot_for_current_operation_endpoint(network: str = Query(..., """ return take_snapshot_for_current_operation(network, tag) -# 兼容旧拼写: takenapshotforcurrentoperation -@router.post("/takenapshotforcurrentoperation", summary="为当前操作创建快照(兼容模式)", description="为当前操作创建快照(兼容旧的API路径)") -async def take_snapshot_for_current_operation_legacy_endpoint(network: str = Query(..., description="管网名称(或数据库名称)"), tag: str = Query(..., description="快照标签")) -> None: - """ - 为当前操作创建快照(兼容模式) - - 兼容旧的API路径,为网络当前操作创建一个快照 - """ - return take_snapshot_for_current_operation(network, tag) - -@router.post("/takesnapshot/", summary="创建快照", description="为网络创建一个快照") +@router.post("/snapshots", summary="创建快照", description="为网络创建一个快照") async def take_snapshot_endpoint(network: str = Query(..., description="管网名称(或数据库名称)"), tag: str = Query(..., description="快照标签")) -> None: """ 创建快照 @@ -127,7 +117,7 @@ async def take_snapshot_endpoint(network: str = Query(..., description="管网 """ return take_snapshot(network, tag) -@router.post("/picksnapshot/", summary="选择快照", description="选择并恢复到指定的快照", response_model=None) +@router.patch("/snapshots", summary="选择快照", description="选择并恢复到指定的快照", response_model=None) async def pick_snapshot_endpoint(network: str = Query(..., description="管网名称(或数据库名称)"), tag: str = Query(..., description="快照标签"), discard: bool = Query(False, description="是否丢弃当前更改")) -> ChangeSet: """ 选择快照 @@ -136,7 +126,7 @@ async def pick_snapshot_endpoint(network: str = Query(..., description="管网 """ return pick_snapshot(network, tag, discard) -@router.post("/pickoperation/", summary="选择操作", description="选择并恢复到指定的操作", response_model=None) +@router.patch("/operations", summary="选择操作", description="选择并恢复到指定的操作", response_model=None) async def pick_operation_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), operation: int = Query(..., description="操作ID"), @@ -149,7 +139,7 @@ async def pick_operation_endpoint( """ return pick_operation(network, operation, discard) -@router.get("/syncwithserver/", summary="与服务器同步", description="将网络与服务器同步到指定操作", response_model=None) +@router.post("/with-servers", summary="与服务器同步", description="将网络与服务器同步到指定操作", response_model=None) async def sync_with_server_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), operation: int = Query(..., description="目标操作ID"), @@ -162,7 +152,7 @@ async def sync_with_server_endpoint( """ return sync_with_server(network, operation) -@router.post("/batch/", summary="执行批量命令", description="执行多个网络操作命令", response_model=None) +@router.post("/network-command-batches", summary="执行批量命令", description="执行多个网络操作命令", response_model=None) async def execute_batch_commands_endpoint(network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None) -> ChangeSet: """ 执行批量命令 @@ -175,7 +165,7 @@ async def execute_batch_commands_endpoint(network: str = Query(..., description= rcs = execute_batch_commands(network, cs) return rcs -@router.post("/compressedbatch/", summary="执行压缩批量命令", description="执行压缩的批量命令", response_model=None) +@router.post("/network-command-batches/compressed", summary="执行压缩批量命令", description="执行压缩的批量命令", response_model=None) async def execute_compressed_batch_commands_endpoint( network: str = Query(..., description="管网名称(或数据库名称)"), req: Request = None @@ -190,7 +180,7 @@ async def execute_compressed_batch_commands_endpoint( cs.operations = jo_root["operations"] return execute_batch_command(network, cs) -@router.get("/getrestoreoperation/", summary="获取恢复操作ID", description="获取网络的恢复操作ID") +@router.get("/restore-operations", summary="获取恢复操作ID", description="获取网络的恢复操作ID") async def get_restore_operation_endpoint(network: str = Query(..., description="管网名称(或数据库名称)")) -> int: """ 获取恢复操作ID @@ -199,7 +189,7 @@ async def get_restore_operation_endpoint(network: str = Query(..., description=" """ return get_restore_operation(network) -@router.post("/setrestoreoperation/", summary="设置恢复操作ID", description="设置网络的恢复操作ID") +@router.patch("/restore-operations", summary="设置恢复操作ID", description="设置网络的恢复操作ID") async def set_restore_operation_endpoint(network: str = Query(..., description="管网名称(或数据库名称)"), operation: int = Query(..., description="操作ID")) -> None: """ 设置恢复操作ID diff --git a/app/api/v1/endpoints/timeseries/composite.py b/app/api/v1/endpoints/timeseries/composite.py index b863097..7ac740d 100644 --- a/app/api/v1/endpoints/timeseries/composite.py +++ b/app/api/v1/endpoints/timeseries/composite.py @@ -8,7 +8,7 @@ from .dependencies import get_timescale_connection, get_postgres_connection router = APIRouter() -@router.get("/composite/scada-simulation", summary="获取SCADA关联的模拟数据") +@router.get("/timeseries/views/scada-simulations", summary="获取SCADA关联的模拟数据") async def get_scada_associated_simulation_data( start_time: datetime = Query(..., description="查询开始时间"), end_time: datetime = Query(..., description="查询结束时间"), @@ -73,7 +73,7 @@ async def get_scada_associated_simulation_data( raise HTTPException(status_code=400, detail=str(e)) -@router.get("/composite/element-simulation", summary="获取管网元素的模拟数据") +@router.get("/timeseries/views/element-simulations", summary="获取管网元素的模拟数据") async def get_feature_simulation_data( start_time: datetime = Query(..., description="查询开始时间"), end_time: datetime = Query(..., description="查询结束时间"), @@ -143,7 +143,7 @@ async def get_feature_simulation_data( raise HTTPException(status_code=400, detail=str(e)) -@router.get("/composite/element-scada", summary="获取管网元素关联的SCADA监测数据") +@router.get("/timeseries/views/element-scada-readings", summary="获取管网元素关联的SCADA监测数据") async def get_element_associated_scada_data( element_id: str = Query(..., description="管网元素ID(管道或节点)"), start_time: datetime = Query(..., description="查询开始时间"), @@ -185,7 +185,7 @@ async def get_element_associated_scada_data( raise HTTPException(status_code=400, detail=str(e)) -@router.post("/composite/clean-scada", summary="清洗SCADA监测数据") +@router.post("/timeseries/scada-cleaning-runs", summary="清洗SCADA监测数据") async def clean_scada_data( device_ids: str = Query(..., description="设备ID列表或 'all' 表示清洗所有设备"), start_time: datetime = Query(..., description="清洗数据的开始时间"), @@ -228,7 +228,7 @@ async def clean_scada_data( raise HTTPException(status_code=400, detail=str(e)) -@router.get("/composite/pipeline-health-prediction", summary="预测管道健康状况") +@router.get("/pipeline-health-predictions", summary="预测管道健康状况") async def predict_pipeline_health( query_time: datetime = Query(..., description="查询时间"), network_name: str = Query(..., description="管网名称(或数据库名称)"), diff --git a/app/api/v1/endpoints/timeseries/realtime.py b/app/api/v1/endpoints/timeseries/realtime.py index eb6ee8b..705d27a 100644 --- a/app/api/v1/endpoints/timeseries/realtime.py +++ b/app/api/v1/endpoints/timeseries/realtime.py @@ -13,7 +13,7 @@ TIME_RANGE_START_DESC = f"时间范围开始时间。{TIME_WITH_TZ_DESC}" TIME_RANGE_END_DESC = f"时间范围结束时间。{TIME_WITH_TZ_DESC}" -@router.post("/realtime/links/batch", status_code=201, summary="批量插入实时管道数据") +@router.post("/timeseries/realtime/links/batches", status_code=201, summary="批量插入实时管道数据") async def insert_realtime_links( data: List[dict] = Body(..., description="管道数据列表,每项包含管道ID、时间戳等信息"), conn: AsyncConnection = Depends(get_timescale_connection) @@ -34,7 +34,7 @@ async def insert_realtime_links( @router.get( - "/realtime/links", + "/timeseries/realtime/links", summary="查询实时管道数据", description="按时间范围查询实时管道数据。start_time 和 end_time 必须显式带时区;允许传 UTC+8,服务端会先归一化为 UTC 再执行查询。", ) @@ -60,7 +60,7 @@ async def get_realtime_links( @router.delete( - "/realtime/links", + "/timeseries/realtime/links", summary="删除实时管道数据", description="按时间范围删除实时管道数据。start_time 和 end_time 必须显式带时区;允许传 UTC+8,服务端按请求中的绝对时间删除对应 UTC 数据。", ) @@ -85,7 +85,7 @@ async def delete_realtime_links( return {"message": "Deleted successfully"} -@router.patch("/realtime/links/{link_id}/field", summary="更新实时管道字段") +@router.patch("/timeseries/realtime/links/{link_id}/field", summary="更新实时管道字段") async def update_realtime_link_field( link_id: str = Path(..., description="管道ID"), time: datetime = Query(..., description=f"要更新记录的时间戳。{TIME_WITH_TZ_DESC}"), @@ -117,7 +117,7 @@ async def update_realtime_link_field( raise HTTPException(status_code=400, detail=str(e)) -@router.post("/realtime/nodes/batch", status_code=201, summary="批量插入实时节点数据") +@router.post("/timeseries/realtime/nodes/batches", status_code=201, summary="批量插入实时节点数据") async def insert_realtime_nodes( data: List[dict] = Body(..., description="节点数据列表,每项包含节点ID、时间戳等信息"), conn: AsyncConnection = Depends(get_timescale_connection) @@ -138,7 +138,7 @@ async def insert_realtime_nodes( @router.get( - "/realtime/nodes", + "/timeseries/realtime/nodes", summary="查询实时节点数据", description="按时间范围查询实时节点数据。start_time 和 end_time 必须显式带时区;允许传 UTC+8,服务端会先归一化为 UTC 再执行查询。", ) @@ -164,7 +164,7 @@ async def get_realtime_nodes( @router.delete( - "/realtime/nodes", + "/timeseries/realtime/nodes", summary="删除实时节点数据", description="按时间范围删除实时节点数据。start_time 和 end_time 必须显式带时区;允许传 UTC+8,服务端按请求中的绝对时间删除对应 UTC 数据。", ) @@ -191,7 +191,7 @@ async def delete_realtime_nodes( -@router.post("/realtime/simulation/store", status_code=201, summary="存储实时模拟结果") +@router.post("/timeseries/realtime/simulation-results", status_code=201, summary="存储实时模拟结果") async def store_realtime_simulation_result( node_result_list: List[dict] = Body(..., description="节点模拟结果列表"), link_result_list: List[dict] = Body(..., description="管道模拟结果列表"), @@ -218,7 +218,7 @@ async def store_realtime_simulation_result( @router.get( - "/realtime/query/by-time-property", + "/timeseries/realtime/records", summary="按时间和属性查询实时数据", description="查询指定时间点的实时属性值。query_time 必须显式带时区;允许传 UTC+8,服务端会先归一化为 UTC 再执行查询。", ) @@ -254,7 +254,7 @@ async def query_realtime_records_by_time_property( @router.get( - "/realtime/query/by-id-time", + "/timeseries/realtime/simulation-results", summary="按ID和时间查询实时模拟数据", description="查询指定元素在某一时间点的实时模拟结果。query_time 必须显式带时区;允许传 UTC+8,服务端会先归一化为 UTC 再执行查询。", ) diff --git a/app/api/v1/endpoints/timeseries/scada.py b/app/api/v1/endpoints/timeseries/scada.py index 3ed1bab..3f75b98 100644 --- a/app/api/v1/endpoints/timeseries/scada.py +++ b/app/api/v1/endpoints/timeseries/scada.py @@ -9,7 +9,7 @@ from .dependencies import get_timescale_connection router = APIRouter() -@router.post("/scada/batch", status_code=201, summary="批量插入SCADA监测数据") +@router.post("/timeseries/scada-readings/batches", status_code=201, summary="批量插入SCADA监测数据") async def insert_scada_data( data: List[dict] = Body(..., description="SCADA设备监测数据列表"), conn: AsyncConnection = Depends(get_timescale_connection), @@ -29,7 +29,7 @@ async def insert_scada_data( return {"message": f"Inserted {len(data)} records"} -@router.get("/scada/by-ids-time-range", summary="按设备ID和时间范围查询SCADA数据") +@router.get("/timeseries/scada-readings", summary="按设备ID和时间范围查询SCADA数据") async def get_scada_by_ids_time_range( start_time: datetime = Query(..., description="查询开始时间"), end_time: datetime = Query(..., description="查询结束时间"), @@ -60,7 +60,7 @@ async def get_scada_by_ids_time_range( @router.get( - "/scada/by-ids-field-time-range", summary="按设备ID、字段和时间范围查询SCADA数据" + "/timeseries/scada-readings/fields", summary="按设备ID、字段和时间范围查询SCADA数据" ) async def get_scada_field_by_ids_time_range( start_time: datetime = Query(..., description="查询开始时间"), @@ -101,7 +101,7 @@ async def get_scada_field_by_ids_time_range( raise HTTPException(status_code=400, detail=str(e)) -@router.patch("/scada/{device_id}/field", summary="更新SCADA设备字段") +@router.patch("/timeseries/scada-readings/{device_id}/field", summary="更新SCADA设备字段") async def update_scada_field( device_id: str = Path(..., description="设备ID"), time: datetime = Query(..., description="更新数据的时间戳"), @@ -133,7 +133,7 @@ async def update_scada_field( raise HTTPException(status_code=400, detail=str(e)) -@router.delete("/scada/by-id-time-range", summary="按设备ID和时间范围删除SCADA数据") +@router.delete("/timeseries/scada-readings", summary="按设备ID和时间范围删除SCADA数据") async def delete_scada_data( device_id: str = Query(..., description="设备ID"), start_time: datetime = Query(..., description="删除开始时间"), diff --git a/app/api/v1/endpoints/timeseries/scheme.py b/app/api/v1/endpoints/timeseries/scheme.py index 76f71e6..0c56a75 100644 --- a/app/api/v1/endpoints/timeseries/scheme.py +++ b/app/api/v1/endpoints/timeseries/scheme.py @@ -9,7 +9,7 @@ from .dependencies import get_timescale_connection router = APIRouter() -@router.post("/scheme/links/batch", status_code=201, summary="批量插入方案管道数据") +@router.post("/timeseries/schemes/links/batches", status_code=201, summary="批量插入方案管道数据") async def insert_scheme_links( data: List[dict] = Body(..., description="方案管道数据列表"), conn: AsyncConnection = Depends(get_timescale_connection), @@ -29,7 +29,7 @@ async def insert_scheme_links( return {"message": f"Inserted {len(data)} records"} -@router.get("/scheme/links", summary="查询方案管道数据") +@router.get("/timeseries/schemes/links", summary="查询方案管道数据") async def get_scheme_links( scheme_type: str = Query(..., description="方案类型"), scheme_name: str = Query(..., description="方案名称"), @@ -56,7 +56,7 @@ async def get_scheme_links( ) -@router.get("/scheme/links/{link_id}/field", summary="查询方案管道字段数据") +@router.get("/timeseries/schemes/links/{link_id}/field", summary="查询方案管道字段数据") async def get_scheme_link_field( link_id: str = Path(..., description="管道ID"), scheme_type: str = Query(..., description="方案类型"), @@ -93,7 +93,7 @@ async def get_scheme_link_field( raise HTTPException(status_code=400, detail=str(e)) -@router.patch("/scheme/links/{link_id}/field", summary="更新方案管道字段") +@router.patch("/timeseries/schemes/links/{link_id}/field", summary="更新方案管道字段") async def update_scheme_link_field( link_id: str = Path(..., description="管道ID"), scheme_type: str = Query(..., description="方案类型"), @@ -131,7 +131,7 @@ async def update_scheme_link_field( raise HTTPException(status_code=400, detail=str(e)) -@router.delete("/scheme/links", summary="删除方案管道数据") +@router.delete("/timeseries/schemes/links", summary="删除方案管道数据") async def delete_scheme_links( scheme_type: str = Query(..., description="方案类型"), scheme_name: str = Query(..., description="方案名称"), @@ -159,7 +159,7 @@ async def delete_scheme_links( return {"message": "Deleted successfully"} -@router.post("/scheme/nodes/batch", status_code=201, summary="批量插入方案节点数据") +@router.post("/timeseries/schemes/nodes/batches", status_code=201, summary="批量插入方案节点数据") async def insert_scheme_nodes( data: List[dict] = Body(..., description="方案节点数据列表"), conn: AsyncConnection = Depends(get_timescale_connection), @@ -179,7 +179,7 @@ async def insert_scheme_nodes( return {"message": f"Inserted {len(data)} records"} -@router.get("/scheme/nodes/{node_id}/field", summary="查询方案节点字段数据") +@router.get("/timeseries/schemes/nodes/{node_id}/field", summary="查询方案节点字段数据") async def get_scheme_node_field( node_id: str = Path(..., description="节点ID"), scheme_type: str = Query(..., description="方案类型"), @@ -216,7 +216,7 @@ async def get_scheme_node_field( raise HTTPException(status_code=400, detail=str(e)) -@router.patch("/scheme/nodes/{node_id}/field", summary="更新方案节点字段") +@router.patch("/timeseries/schemes/nodes/{node_id}/field", summary="更新方案节点字段") async def update_scheme_node_field( node_id: str = Path(..., description="节点ID"), scheme_type: str = Query(..., description="方案类型"), @@ -254,7 +254,7 @@ async def update_scheme_node_field( raise HTTPException(status_code=400, detail=str(e)) -@router.delete("/scheme/nodes", summary="删除方案节点数据") +@router.delete("/timeseries/schemes/nodes", summary="删除方案节点数据") async def delete_scheme_nodes( scheme_type: str = Query(..., description="方案类型"), scheme_name: str = Query(..., description="方案名称"), @@ -282,7 +282,7 @@ async def delete_scheme_nodes( return {"message": "Deleted successfully"} -@router.post("/scheme/simulation/store", status_code=201, summary="存储方案模拟结果") +@router.post("/timeseries/schemes/simulation-results", status_code=201, summary="存储方案模拟结果") async def store_scheme_simulation_result( scheme_type: str = Query(..., description="方案类型"), scheme_name: str = Query(..., description="方案名称"), @@ -318,7 +318,7 @@ async def store_scheme_simulation_result( @router.get( - "/scheme/query/by-scheme-time-property", summary="按方案、时间和属性查询数据" + "/timeseries/schemes/records", summary="按方案、时间和属性查询数据" ) async def query_scheme_records_by_scheme_time_property( scheme_type: str = Query(..., description="方案类型"), @@ -355,7 +355,7 @@ async def query_scheme_records_by_scheme_time_property( raise HTTPException(status_code=400, detail=str(e)) -@router.get("/scheme/query/by-id-time", summary="按ID和时间查询方案模拟数据") +@router.get("/timeseries/schemes/simulation-results", summary="按ID和时间查询方案模拟数据") async def query_scheme_simulation_by_id_time( scheme_type: str = Query(..., description="方案类型"), scheme_name: str = Query(..., description="方案名称"), diff --git a/app/api/v1/endpoints/users.py b/app/api/v1/endpoints/users.py index 9cd1507..867a766 100644 --- a/app/api/v1/endpoints/users.py +++ b/app/api/v1/endpoints/users.py @@ -8,7 +8,7 @@ router = APIRouter() # user 39 ########################################################### -@router.get("/getuserschema/", summary="获取用户模式", description="获取指定网络的用户模式定义") +@router.get("/network-schemas/user", summary="获取用户模式", description="获取指定网络的用户模式定义") async def fastapi_get_user_schema(network: str = Query(..., description="管网名称(或数据库名称)")) -> dict[str, dict[Any, Any]]: """ 获取用户模式定义 @@ -17,7 +17,7 @@ async def fastapi_get_user_schema(network: str = Query(..., description="管网 """ return get_user_schema(network) -@router.get("/getuser/", summary="获取单个用户", description="获取指定网络中的单个用户信息") +@router.get("/users/detail", summary="获取单个用户", description="获取指定网络中的单个用户信息") async def fastapi_get_user(network: str = Query(..., description="管网名称(或数据库名称)"), user_name: str = Query(..., description="用户名")) -> dict[Any, Any]: """ 获取用户信息 @@ -26,7 +26,7 @@ async def fastapi_get_user(network: str = Query(..., description="管网名称 """ return get_user(network, user_name) -@router.get("/getallusers/", summary="获取所有用户", description="获取指定网络的所有用户列表") +@router.get("/users", summary="获取所有用户", description="获取指定网络的所有用户列表") async def fastapi_get_all_users(network: str = Query(..., description="管网名称(或数据库名称)")) -> list[dict[Any, Any]]: """ 获取所有用户列表 diff --git a/app/api/v1/endpoints/web_search.py b/app/api/v1/endpoints/web_search.py index d3e2675..29f05e1 100644 --- a/app/api/v1/endpoints/web_search.py +++ b/app/api/v1/endpoints/web_search.py @@ -13,7 +13,7 @@ router = APIRouter() @router.post( - "/web-search", + "/web-searches", summary="Web Search", description="调用 Bocha Web Search API 获取实时网页搜索结果", ) diff --git a/app/api/v1/rest_router.py b/app/api/v1/rest_router.py new file mode 100644 index 0000000..fc736ee --- /dev/null +++ b/app/api/v1/rest_router.py @@ -0,0 +1,349 @@ +from __future__ import annotations + +import inspect +import re +from collections.abc import Iterable +from copy import copy +from functools import wraps +from typing import Any, Generic, TypeVar, get_args, get_origin + +from fastapi import APIRouter, Depends, Query +from fastapi.routing import APIRoute +from pydantic import BaseModel, JsonValue, create_model + +from app.api.problem_details import ProblemDetails +from app.api.v1.router import api_router as handler_api_router +from app.auth.metadata_dependencies import get_current_metadata_user +from app.auth.project_dependencies import ProjectContext, get_project_context + +T = TypeVar("T") + + +class Page(BaseModel, Generic[T]): + items: list[T] + total: int + limit: int + offset: int + + +_NAME_IS_NETWORK = { + "pressure_sensor_placement_sensitivity_endpoint", + "pressure_sensor_placement_kmeans_endpoint", +} +_DERIVE_USERNAME = { + "pressure_sensor_placement_sensitivity_endpoint": "username", + "pressure_sensor_placement_kmeans_endpoint": "username", + "fastapi_pressure_sensor_placement": "user_name", +} +_PUBLIC_PARAMETER_RENAMES = { + "burst_ID": "burst_id", + "drainage_node_ID": "drainage_node_id", +} +_MODEL_NAME_IS_NETWORK = {"RunSimulationManuallyByDate"} +_MODEL_USERNAME_FROM_AUTH: set[str] = set() + + +def _clean_name(name: str) -> str: + for prefix in ("fastapi_", "fast_"): + if name.startswith(prefix): + name = name[len(prefix) :] + break + if name.endswith("_endpoint"): + name = name[: -len("_endpoint")] + return name + + +def _rest_body_model(annotation): + if not inspect.isclass(annotation) or not issubclass(annotation, BaseModel): + return None + project_fields = { + name + for name in ("network", "network_name") + if name in annotation.model_fields + } + if annotation.__name__ in _MODEL_NAME_IS_NETWORK and "name" in annotation.model_fields: + project_fields.add("name") + username_fields = ( + { + name + for name in ("username", "user_name") + if name in annotation.model_fields + } + if annotation.__name__ in _MODEL_USERNAME_FROM_AUTH + else set() + ) + excluded_fields = project_fields | username_fields + if not excluded_fields: + return None + + public_fields = { + name: (field.annotation, copy(field)) + for name, field in annotation.model_fields.items() + if name not in excluded_fields + } + public_model = create_model( + f"{annotation.__name__}Rest", + __module__=annotation.__module__, + **public_fields, + ) + return annotation, public_model, project_fields, username_fields + + +def _with_header_project_context(endpoint, route_name: str): + signature = inspect.signature(endpoint) + network_parameters = [ + name for name in ("network", "network_name") if name in signature.parameters + ] + if route_name in _NAME_IS_NETWORK and "name" in signature.parameters: + network_parameters.append("name") + username_parameter = _DERIVE_USERNAME.get(route_name) + parameter_renames = { + internal: public + for internal, public in _PUBLIC_PARAMETER_RENAMES.items() + if internal in signature.parameters + } + body_models = { + name: body_model + for name, parameter in signature.parameters.items() + if (body_model := _rest_body_model(parameter.annotation)) is not None + } + model_has_username = any(model[3] for model in body_models.values()) + if ( + not network_parameters + and not username_parameter + and not parameter_renames + and not body_models + ): + return endpoint + + existing_context_parameter = next( + ( + name + for name, parameter in signature.parameters.items() + if parameter.annotation is ProjectContext + ), + None, + ) + injected_context_name = existing_context_parameter or "_rest_project_context" + injected_user_name = "_rest_current_user" + + @wraps(endpoint) + async def wrapper(*args, **kwargs): + project_context = kwargs.get(injected_context_name) + if not isinstance(project_context, ProjectContext): + raise RuntimeError("REST project context was not resolved") + if not existing_context_parameter: + kwargs.pop(injected_context_name, None) + for parameter_name in network_parameters: + kwargs[parameter_name] = project_context.project_code + if username_parameter: + kwargs[username_parameter] = kwargs[injected_user_name].username + kwargs.pop(injected_user_name, None) + for internal_name, public_name in parameter_renames.items(): + kwargs[internal_name] = kwargs.pop(public_name) + for parameter_name, ( + original_model, + _public_model, + project_fields, + username_fields, + ) in body_models.items(): + data = kwargs[parameter_name].model_dump() + data.update( + {field_name: project_context.project_code for field_name in project_fields} + ) + if username_fields: + current_user = kwargs[injected_user_name] + data.update( + {field_name: current_user.username for field_name in username_fields} + ) + kwargs[parameter_name] = original_model.model_validate(data) + if model_has_username: + kwargs.pop(injected_user_name, None) + result = endpoint(*args, **kwargs) + if inspect.isawaitable(result): + return await result + return result + + parameters = [] + for name, parameter in signature.parameters.items(): + if name in network_parameters or name == username_parameter: + continue + public_name = parameter_renames.get(name, name) + if public_name != name: + default = copy(parameter.default) + default.alias = public_name + default.validation_alias = public_name + default.serialization_alias = public_name + parameter = parameter.replace(name=public_name, default=default) + if name in body_models: + parameter = parameter.replace(annotation=body_models[name][1]) + parameters.append(parameter) + if not existing_context_parameter: + parameters.append( + inspect.Parameter( + injected_context_name, + kind=inspect.Parameter.KEYWORD_ONLY, + annotation=ProjectContext, + default=Depends(get_project_context), + ) + ) + if username_parameter or model_has_username: + parameters.append( + inspect.Parameter( + injected_user_name, + kind=inspect.Parameter.KEYWORD_ONLY, + default=Depends(get_current_metadata_user), + ) + ) + wrapper.__signature__ = signature.replace(parameters=parameters) + return wrapper + + +def _with_pagination(endpoint): + signature = inspect.signature(endpoint) + if "limit" in signature.parameters or "offset" in signature.parameters: + return endpoint + + @wraps(endpoint) + async def wrapper(*args, **kwargs): + limit = kwargs.pop("_rest_limit") + offset = kwargs.pop("_rest_offset") + result = endpoint(*args, **kwargs) + if inspect.isawaitable(result): + result = await result + if not isinstance(result, list): + return result + return Page( + items=result[offset : offset + limit], + total=len(result), + limit=limit, + offset=offset, + ) + + parameters = list(signature.parameters.values()) + parameters.extend( + [ + inspect.Parameter( + "_rest_limit", + kind=inspect.Parameter.KEYWORD_ONLY, + annotation=int, + default=Query(100, ge=1, le=1000, alias="limit"), + ), + inspect.Parameter( + "_rest_offset", + kind=inspect.Parameter.KEYWORD_ONLY, + annotation=int, + default=Query(0, ge=0, alias="offset"), + ), + ] + ) + wrapper.__signature__ = signature.replace(parameters=parameters) + return wrapper + + +def _adapt_route(route: APIRoute) -> APIRoute: + methods = route.methods or set() + if len(methods) != 1: + raise RuntimeError( + f"REST route {route.name!r} must declare exactly one HTTP method" + ) + method = next(iter(methods)) + responses = dict(route.responses or {}) + for status_code, description in ( + (401, "Authentication required"), + (403, "Insufficient permission"), + (404, "Resource not found"), + (409, "Resource conflict"), + (422, "Validation error"), + (503, "Dependency unavailable"), + ): + responses.setdefault( + status_code, + {"model": ProblemDetails, "description": description}, + ) + + endpoint = _with_header_project_context(route.endpoint, route.name) + response_model = route.response_model + if get_origin(response_model) is list: + item_type = get_args(response_model)[0] if get_args(response_model) else JsonValue + response_model = Page[item_type] + endpoint = _with_pagination(endpoint) + + clean_name = _clean_name(route.name) + creates_resource = clean_name.startswith( + ("add_", "create_", "copy_", "import_", "insert_", "store_", "take_", "upload_") + ) or route.name == "fastapi_pressure_sensor_placement" + status_code = ( + 204 + if method == "DELETE" + else 201 + if method == "POST" and creates_resource + else route.status_code + ) + if status_code == 204: + response_model = None + elif response_model is None: + response_model = JsonValue + + return APIRoute( + path=route.path, + endpoint=endpoint, + response_model=response_model, + status_code=status_code, + tags=route.tags, + dependencies=route.dependencies, + summary=route.summary, + description=route.description, + response_description=route.response_description, + responses=responses, + deprecated=False, + name=route.name, + methods={method}, + operation_id=f"{method.lower()}_{re.sub(r'[^a-z0-9]+', '_', route.path).strip('_')}", + response_model_include=route.response_model_include, + response_model_exclude=route.response_model_exclude, + response_model_by_alias=route.response_model_by_alias, + response_model_exclude_unset=route.response_model_exclude_unset, + response_model_exclude_defaults=route.response_model_exclude_defaults, + response_model_exclude_none=route.response_model_exclude_none, + include_in_schema=route.include_in_schema, + response_class=route.response_class, + callbacks=route.callbacks, + openapi_extra=route.openapi_extra, + ) + + +def build_rest_router(routes: Iterable[Any]) -> APIRouter: + router = APIRouter() + seen: dict[tuple[str, str], APIRoute] = {} + operation_ids: set[str] = set() + + for route in routes: + if not isinstance(route, APIRoute): + continue + + methods = route.methods or set() + if len(methods) != 1: + raise RuntimeError( + f"REST route {route.name!r} must declare exactly one HTTP method" + ) + method = next(iter(methods)) + key = (method, route.path) + if key in seen: + previous = seen[key] + raise RuntimeError( + "REST route collision for " + f"{method} {route.path}: {previous.name!r} and {route.name!r}." + ) + + adapted = _adapt_route(route) + if adapted.operation_id in operation_ids: + adapted.operation_id = f"{adapted.operation_id}_{route.name}" + seen[key] = route + operation_ids.add(adapted.operation_id or "") + router.routes.append(adapted) + + return router + + +api_router = build_rest_router(handler_api_router.routes) diff --git a/app/api/v1/router.py b/app/api/v1/router.py index 887be17..b6f801c 100644 --- a/app/api/v1/router.py +++ b/app/api/v1/router.py @@ -98,11 +98,10 @@ api_router.include_router(access.router, tags=["Access Control"]) api_router.include_router(agent_auth.router, tags=["Agent Auth"]) api_router.include_router( admin_metadata.router, - prefix="/admin", tags=["Metadata Admin"], ) api_router.include_router(model_import.router, tags=["Model Administration"]) -api_router.include_router(audit.router, prefix="/audit", tags=["Audit Logs"]) +api_router.include_router(audit.router, tags=["Audit Logs"]) api_router.include_router(meta.router, tags=["Metadata"]) api_router.include_router( project.router, @@ -190,19 +189,16 @@ api_router.include_router( ) api_router.include_router( leakage.router, - prefix="/leakage", tags=["Leakage"], dependencies=[burst_run_access], ) api_router.include_router( burst_detection.router, - prefix="/burst-detection", tags=["Burst Detection"], dependencies=[burst_run_access], ) api_router.include_router( burst_location.router, - prefix="/burst-location", tags=["Burst Location"], dependencies=[burst_run_access], ) diff --git a/app/auth/metadata_dependencies.py b/app/auth/metadata_dependencies.py index 5d3b6cf..47742f9 100644 --- a/app/auth/metadata_dependencies.py +++ b/app/auth/metadata_dependencies.py @@ -61,7 +61,7 @@ async def get_current_metadata_user( ) raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"Metadata database error: {exc}", + detail="Metadata database is unavailable", ) from exc if not user or not user.is_active: raise HTTPException( @@ -80,7 +80,7 @@ async def get_current_metadata_user( ) raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"Metadata database error: {exc}", + detail="Metadata database is unavailable", ) from exc return user diff --git a/app/auth/project_dependencies.py b/app/auth/project_dependencies.py index 362a186..6a2d387 100644 --- a/app/auth/project_dependencies.py +++ b/app/auth/project_dependencies.py @@ -78,7 +78,7 @@ async def resolve_project_context( ) raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"Metadata database error: {exc}", + detail="Metadata database is unavailable", ) from exc return ProjectContext( diff --git a/app/core/config.py b/app/core/config.py index 3aca912..521252a 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -8,7 +8,6 @@ class Settings(BaseSettings): PROJECT_NAME: str = "TJWater Server" ENVIRONMENT: str = "production" API_V1_STR: str = "/api/v1" - NETWORK_NAME: str = "default_network" # 敏感配置加密密钥 (Fernet) diff --git a/app/main.py b/app/main.py index d82cb87..d3fe175 100644 --- a/app/main.py +++ b/app/main.py @@ -6,7 +6,8 @@ import logging from datetime import datetime import app.services.project_info as project_info -from app.api.v1.router import api_router +from app.api.problem_details import install_problem_details_handlers +from app.api.v1.rest_router import api_router from app.infra.db.timescaledb.database import db as tsdb from app.infra.db.postgresql.database import db as pgdb from app.infra.db.dynamic_manager import project_connection_manager @@ -64,11 +65,13 @@ app = FastAPI( docs_url=None if is_production else "/docs", redoc_url=None if is_production else "/redoc", openapi_url=None if is_production else "/openapi.json", + redirect_slashes=False, ) # Include Routers app.include_router(api_router, prefix="/api/v1") +install_problem_details_handlers(app) # Legcy Routers without version prefix # app.include_router(api_router) diff --git a/cli/tests/unit/test_tjwater_cli.py b/cli/tests/unit/test_tjwater_cli.py index 8e16ec2..eaa5e93 100644 --- a/cli/tests/unit/test_tjwater_cli.py +++ b/cli/tests/unit/test_tjwater_cli.py @@ -32,24 +32,18 @@ def test_load_auth_context_supports_aliases(monkeypatch): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") monkeypatch.setenv("TJWATER_PROJECT_ID", "p1") - monkeypatch.setenv("TJWATER_USERNAME", "tester") - monkeypatch.setenv("TJWATER_NETWORK", "net1") auth = core.load_auth_context(auth_stdin=False) assert auth.server == "http://server" assert auth.access_token == "abc" assert auth.project_id == "p1" - assert auth.username == "tester" - assert auth.network == "net1" def test_build_runtime_context_uses_default_server(monkeypatch): monkeypatch.delenv("TJWATER_SERVER", raising=False) monkeypatch.delenv("TJWATER_ACCESS_TOKEN", raising=False) monkeypatch.delenv("TJWATER_PROJECT_ID", raising=False) - monkeypatch.delenv("TJWATER_USERNAME", raising=False) - monkeypatch.delenv("TJWATER_NETWORK", raising=False) monkeypatch.delenv("TJWATER_EXTRA_HEADERS", raising=False) runtime = core.build_runtime_context( @@ -68,7 +62,7 @@ def test_auth_stdin_can_be_reused_with_runtime_context_cache(monkeypatch): def fake_request_json(ctx, **kwargs): observed_runtime_ids.append(id(ctx)) assert ctx.auth.access_token == "token-1" - assert kwargs["params"] == {"network": "tjwater", "junction": "11"} + assert kwargs["params"] == {"junction": "11"} return {"id": "11"}, 5 monkeypatch.setattr(common, "request_json", fake_request_json) @@ -81,7 +75,6 @@ def test_auth_stdin_can_be_reused_with_runtime_context_cache(monkeypatch): "server": "http://server", "access_token": "token-1", "project_id": "project-1", - "network": "tjwater", } ), ) @@ -105,7 +98,6 @@ def test_network_get_junction_properties_uses_network_context(monkeypatch): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "tjwater") monkeypatch.setattr(common, "request_json", fake_request_json) result = runner.invoke(app, ["network", "get-junction-properties", "--junction", "J1"]) @@ -116,8 +108,8 @@ def test_network_get_junction_properties_uses_network_context(monkeypatch): assert payload["data"] == {"id": "J1"} assert captured == { "access_token": "abc", - "path": "/getjunctionproperties/", - "params": {"network": "tjwater", "junction": "J1"}, + "path": "/junctions/properties", + "params": {"junction": "J1"}, } @@ -132,7 +124,6 @@ def test_network_get_pipe_properties_uses_network_context(monkeypatch): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "tjwater") monkeypatch.setattr(common, "request_json", fake_request_json) result = runner.invoke(app, ["network", "get-pipe-properties", "--pipe", "P1"]) @@ -143,8 +134,8 @@ def test_network_get_pipe_properties_uses_network_context(monkeypatch): assert payload["data"] == {"id": "P1"} assert captured == { "access_token": "abc", - "path": "/getpipeproperties/", - "params": {"network": "tjwater", "pipe": "P1"}, + "path": "/pipes/properties", + "params": {"pipe": "P1"}, } @@ -159,7 +150,6 @@ def test_network_get_all_pipes_properties_uses_network_context(monkeypatch): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "tjwater") monkeypatch.setattr(common, "request_json", fake_request_json) result = runner.invoke(app, ["network", "get-all-pipes-properties"]) @@ -170,8 +160,8 @@ def test_network_get_all_pipes_properties_uses_network_context(monkeypatch): assert payload["data"] == [{"id": "P1"}] assert captured == { "access_token": "abc", - "path": "/getallpipeproperties/", - "params": {"network": "tjwater"}, + "path": "/pipes", + "params": {}, } @@ -186,7 +176,6 @@ def test_network_get_reservoir_properties_uses_network_context(monkeypatch): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "tjwater") monkeypatch.setattr(common, "request_json", fake_request_json) result = runner.invoke(app, ["network", "get-reservoir-properties", "--reservoir", "R1"]) @@ -197,8 +186,8 @@ def test_network_get_reservoir_properties_uses_network_context(monkeypatch): assert payload["data"] == {"id": "R1"} assert captured == { "access_token": "abc", - "path": "/getreservoirproperties/", - "params": {"network": "tjwater", "reservoir": "R1"}, + "path": "/reservoirs/properties", + "params": {"reservoir": "R1"}, } @@ -213,7 +202,6 @@ def test_network_get_all_reservoir_properties_uses_network_context(monkeypatch): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "tjwater") monkeypatch.setattr(common, "request_json", fake_request_json) result = runner.invoke(app, ["network", "get-all-reservoirs-properties"]) @@ -224,8 +212,8 @@ def test_network_get_all_reservoir_properties_uses_network_context(monkeypatch): assert payload["data"] == [{"id": "R1"}] assert captured == { "access_token": "abc", - "path": "/getallreservoirproperties/", - "params": {"network": "tjwater"}, + "path": "/reservoirs", + "params": {}, } @@ -240,7 +228,6 @@ def test_network_get_tank_properties_uses_network_context(monkeypatch): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "tjwater") monkeypatch.setattr(common, "request_json", fake_request_json) result = runner.invoke(app, ["network", "get-tank-properties", "--tank", "T1"]) @@ -251,8 +238,8 @@ def test_network_get_tank_properties_uses_network_context(monkeypatch): assert payload["data"] == {"id": "T1"} assert captured == { "access_token": "abc", - "path": "/gettankproperties/", - "params": {"network": "tjwater", "tank": "T1"}, + "path": "/tanks/properties", + "params": {"tank": "T1"}, } @@ -267,7 +254,6 @@ def test_network_get_all_tank_properties_uses_network_context(monkeypatch): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "tjwater") monkeypatch.setattr(common, "request_json", fake_request_json) result = runner.invoke(app, ["network", "get-all-tanks-properties"]) @@ -278,8 +264,8 @@ def test_network_get_all_tank_properties_uses_network_context(monkeypatch): assert payload["data"] == [{"id": "T1"}] assert captured == { "access_token": "abc", - "path": "/getalltankproperties/", - "params": {"network": "tjwater"}, + "path": "/tanks", + "params": {}, } @@ -294,7 +280,6 @@ def test_network_get_pump_properties_uses_network_context(monkeypatch): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "tjwater") monkeypatch.setattr(common, "request_json", fake_request_json) result = runner.invoke(app, ["network", "get-pump-properties", "--pump", "PU1"]) @@ -305,8 +290,8 @@ def test_network_get_pump_properties_uses_network_context(monkeypatch): assert payload["data"] == {"id": "PU1"} assert captured == { "access_token": "abc", - "path": "/getpumpproperties/", - "params": {"network": "tjwater", "pump": "PU1"}, + "path": "/pumps/properties", + "params": {"pump": "PU1"}, } @@ -321,7 +306,6 @@ def test_network_get_all_pump_properties_uses_network_context(monkeypatch): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "tjwater") monkeypatch.setattr(common, "request_json", fake_request_json) result = runner.invoke(app, ["network", "get-all-pumps-properties"]) @@ -332,8 +316,8 @@ def test_network_get_all_pump_properties_uses_network_context(monkeypatch): assert payload["data"] == [{"id": "PU1"}] assert captured == { "access_token": "abc", - "path": "/getallpumpproperties/", - "params": {"network": "tjwater"}, + "path": "/pumps", + "params": {}, } @@ -348,7 +332,6 @@ def test_network_get_valve_properties_uses_network_context(monkeypatch): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "tjwater") monkeypatch.setattr(common, "request_json", fake_request_json) result = runner.invoke(app, ["network", "get-valve-properties", "--valve", "V1"]) @@ -359,8 +342,8 @@ def test_network_get_valve_properties_uses_network_context(monkeypatch): assert payload["data"] == {"id": "V1"} assert captured == { "access_token": "abc", - "path": "/getvalveproperties/", - "params": {"network": "tjwater", "valve": "V1"}, + "path": "/valves/properties", + "params": {"valve": "V1"}, } @@ -375,7 +358,6 @@ def test_network_get_all_valve_properties_uses_network_context(monkeypatch): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "tjwater") monkeypatch.setattr(common, "request_json", fake_request_json) result = runner.invoke(app, ["network", "get-all-valves-properties"]) @@ -386,8 +368,8 @@ def test_network_get_all_valve_properties_uses_network_context(monkeypatch): assert payload["data"] == [{"id": "V1"}] assert captured == { "access_token": "abc", - "path": "/getallvalveproperties/", - "params": {"network": "tjwater"}, + "path": "/valves", + "params": {}, } @@ -525,7 +507,6 @@ def test_realtime_property_help_lists_supported_fields(): def test_analysis_burst_returns_next_step_to_fetch_scheme(monkeypatch, tmp_path: Path): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "demo") burst_path = tmp_path / "burst.json" burst_path.write_text('[{"id":"P1","size":3.5}]', encoding="utf-8") @@ -559,7 +540,6 @@ def test_analysis_burst_returns_next_step_to_fetch_scheme(monkeypatch, tmp_path: def test_analysis_contaminant_sends_required_scheme_name(monkeypatch): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "demo") captured = {} def fake_request(**kwargs): @@ -588,7 +568,6 @@ def test_analysis_contaminant_sends_required_scheme_name(monkeypatch): assert result.exit_code == 0 assert captured["params"] == { - "network": "demo", "start_time": "2025-01-02T03:04:05+08:00", "source": "N1", "concentration": 10.0, @@ -600,7 +579,6 @@ def test_analysis_contaminant_sends_required_scheme_name(monkeypatch): def test_analysis_flushing_sends_required_scheme_name(monkeypatch, tmp_path: Path): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "demo") captured = {} valve_path = tmp_path / "valve.json" valve_path.write_text('[{"valve":"V1","opening":0.5}]', encoding="utf-8") @@ -633,11 +611,10 @@ def test_analysis_flushing_sends_required_scheme_name(monkeypatch, tmp_path: Pat assert result.exit_code == 0 assert captured["params"] == { - "network": "demo", "start_time": "2025-01-02T03:04:05+08:00", "valves": ["V1"], "valves_k": [0.5], - "drainage_node_ID": "N1", + "drainage_node_id": "N1", "flush_flow": 100.0, "duration": 900, "scheme_name": "flush_case_01", @@ -647,7 +624,6 @@ def test_analysis_flushing_sends_required_scheme_name(monkeypatch, tmp_path: Pat def test_analysis_valve_close_sends_required_scheme_name(monkeypatch): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "demo") captured = {} def fake_request(**kwargs): @@ -676,7 +652,6 @@ def test_analysis_valve_close_sends_required_scheme_name(monkeypatch): assert result.exit_code == 0 assert captured["params"] == { - "network": "demo", "start_time": "2025-01-02T03:04:05+08:00", "valves": ["V1"], "duration": 900, @@ -687,7 +662,6 @@ def test_analysis_valve_close_sends_required_scheme_name(monkeypatch): def test_analysis_contaminant_requires_scheme(monkeypatch, capsys): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "demo") exit_code = main( [ @@ -713,7 +687,6 @@ def test_analysis_contaminant_requires_scheme(monkeypatch, capsys): def test_analysis_flushing_requires_scheme(monkeypatch, tmp_path: Path, capsys): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "demo") valve_path = tmp_path / "valve.json" valve_path.write_text('[{"valve":"V1","opening":0.5}]', encoding="utf-8") @@ -741,7 +714,6 @@ def test_analysis_flushing_requires_scheme(monkeypatch, tmp_path: Path, capsys): def test_analysis_valve_close_requires_scheme(monkeypatch, capsys): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "demo") exit_code = main( [ @@ -921,7 +893,6 @@ def test_main_bare_analysis_returns_typer_help_without_json_error(capsys): def test_simulation_run_translates_rfc3339(monkeypatch): monkeypatch.setenv("TJWATER_SERVER", "http://server") monkeypatch.setenv("TJWATER_ACCESS_TOKEN", "abc") - monkeypatch.setenv("TJWATER_NETWORK", "demo") captured = {} def fake_request(**kwargs): @@ -944,7 +915,6 @@ def test_simulation_run_translates_rfc3339(monkeypatch): assert result.exit_code == 0 assert captured["json"] == { - "name": "demo", "start_time": "2025-01-02T03:04:05+08:00", "duration": 30, } diff --git a/cli/tjwater_cli/commands_analysis.py b/cli/tjwater_cli/commands_analysis.py index d43b3eb..a933e74 100644 --- a/cli/tjwater_cli/commands_analysis.py +++ b/cli/tjwater_cli/commands_analysis.py @@ -27,8 +27,6 @@ from .core import ( parse_time_with_timezone, parse_valve_setting_file, request_json, - require_network, - require_username, resolve_scheme, ) from .option_types import DataSource, ValveMode @@ -41,11 +39,9 @@ def simulation_run( duration: Annotated[int, typer.Option("--duration", help="持续分钟数")], ) -> None: runtime = runtime_context(ctx) - network = require_network(runtime) parsed = parse_time_with_timezone(start_time, option_name="--start-time") end_time = (parsed + timedelta(minutes=duration)).isoformat() body = { - "name": network, "start_time": parsed.replace(microsecond=0).isoformat(), "duration": duration, } @@ -53,10 +49,9 @@ def simulation_run( ctx, summary="触发模拟成功", method="POST", - path="/simulations/run-by-date", + path="/simulation-runs", json_body=body, require_auth=True, - require_network_ctx=True, next_commands=[ f"tjwater-cli data timeseries realtime links --start-time {parsed.isoformat()} --end-time {end_time}", f"tjwater-cli data timeseries realtime nodes --start-time {parsed.isoformat()} --end-time {end_time}", @@ -76,9 +71,8 @@ def analysis_burst( ids, sizes = parse_burst_file(burst_file) scheme_name = resolve_scheme(runtime, scheme, required=True) params = { - "network": require_network(runtime), "modify_pattern_start_time": parse_time_with_timezone(start_time, option_name="--start-time").isoformat(), - "burst_ID": ids, + "burst_id": ids, "burst_size": sizes, "modify_total_duration": duration, "scheme_name": scheme_name, @@ -86,11 +80,10 @@ def analysis_burst( emit_api( ctx, summary="爆管分析执行成功", - method="GET", - path="/burst-analysis", + method="POST", + path="/burst-analyses", params=params, require_auth=True, - require_network_ctx=True, next_commands=[ f"tjwater-cli data scheme get --name {scheme_name}", "tjwater-cli data scheme list", @@ -110,7 +103,6 @@ def analysis_valve( scheme: Annotated[str | None, typer.Option("--scheme", help="close 模式的方案名称")] = None, ) -> None: runtime = runtime_context(ctx) - network = require_network(runtime) if mode == ValveMode.CLOSE: if not start_time or not valve: raise CLIError( @@ -120,7 +112,6 @@ def analysis_valve( exit_code=2, ) params = { - "network": network, "start_time": parse_time_with_timezone(start_time, option_name="--start-time").isoformat(), "valves": valve, "duration": duration or 900, @@ -129,11 +120,10 @@ def analysis_valve( emit_api( ctx, summary="阀门关闭分析执行成功", - method="GET", - path="/valve_close_analysis/", + method="POST", + path="/valve-isolation-analyses", params=params, require_auth=True, - require_network_ctx=True, ) return if mode == ValveMode.ISOLATION: @@ -144,17 +134,16 @@ def analysis_valve( message="isolation mode requires at least one --element", exit_code=2, ) - params = {"network": network, "accident_element": element} + params = {"accident_element": element} if disabled_valve: params["disabled_valves"] = disabled_valve emit_api( ctx, summary="阀门隔离分析执行成功", - method="GET", - path="/valve-isolation-analysis", + method="POST", + path="/valve-isolation-analyses", params=params, require_auth=True, - require_network_ctx=True, ) return raise AssertionError(f"unreachable valve mode: {mode}") @@ -173,11 +162,10 @@ def analysis_flushing( runtime = runtime_context(ctx) valves, openings = parse_valve_setting_file(valve_setting_file) params = { - "network": require_network(runtime), "start_time": parse_time_with_timezone(start_time, option_name="--start-time").isoformat(), "valves": valves, "valves_k": openings, - "drainage_node_ID": drainage_node, + "drainage_node_id": drainage_node, "flush_flow": flow, "duration": duration or 900, "scheme_name": resolve_scheme(runtime, scheme, required=True), @@ -185,11 +173,10 @@ def analysis_flushing( emit_api( ctx, summary="冲洗分析执行成功", - method="GET", - path="/flushing-analysis", + method="POST", + path="/flushing-analyses", params=params, require_auth=True, - require_network_ctx=True, ) @@ -203,15 +190,13 @@ def analysis_age( emit_api( ctx, summary="水龄分析执行成功", - method="GET", - path="/age_analysis/", + method="POST", + path="/water-age-analyses", params={ - "network": require_network(runtime), "start_time": parse_time_with_timezone(start_time, option_name="--start-time").isoformat(), "duration": duration, }, require_auth=True, - require_network_ctx=True, ) @@ -227,7 +212,6 @@ def analysis_contaminant( ) -> None: runtime = runtime_context(ctx) params = { - "network": require_network(runtime), "start_time": parse_time_with_timezone(start_time, option_name="--start-time").isoformat(), "source": source_node, "concentration": concentration, @@ -239,11 +223,10 @@ def analysis_contaminant( emit_api( ctx, summary="污染物模拟执行成功", - method="GET", - path="/contaminant-simulation", + method="POST", + path="/contaminant-simulations", params=params, require_auth=True, - require_network_ctx=True, ) @@ -256,21 +239,17 @@ def analysis_sensor_placement_kmeans( ) -> None: runtime = runtime_context(ctx) body = { - "name": require_network(runtime), "scheme_name": resolve_scheme(runtime, scheme, required=True), "sensor_number": count, "min_diameter": min_diameter, - "username": require_username(runtime), } emit_api( ctx, summary="传感器选址执行成功", method="POST", - path="/pressure_sensor_placement_kmeans/", + path="/pressure-sensor-placement-kmeans", json_body=body, require_auth=True, - require_network_ctx=True, - require_username_ctx=True, ) @@ -283,7 +262,6 @@ def analysis_leakage_identify( ) -> None: runtime = runtime_context(ctx) body = { - "network": require_network(runtime), "scada_start": parse_time_with_timezone(start_time, option_name="--start-time").isoformat(), "scada_end": parse_time_with_timezone(end_time, option_name="--end-time").isoformat(), "scheme_name": resolve_scheme(runtime, scheme, required=True), @@ -292,10 +270,9 @@ def analysis_leakage_identify( ctx, summary="漏损识别执行成功", method="POST", - path="/leakage/identify/", + path="/leakage-identifications", json_body=body, require_auth=True, - require_network_ctx=True, ) @@ -308,11 +285,9 @@ def analysis_leakage_schemes_list(ctx: typer.Context) -> None: method="GET", path="/schemes", params={ - "network": require_network(runtime), "scheme_type": "dma_leak_identification", }, require_auth=True, - require_network_ctx=True, ) @@ -328,11 +303,9 @@ def analysis_leakage_schemes_get( method="GET", path=f"/schemes/{scheme_name}", params={ - "network": require_network(runtime), "scheme_type": "dma_leak_identification", }, require_auth=True, - require_network_ctx=True, ) @@ -345,7 +318,6 @@ def analysis_burst_detection_detect( ) -> None: runtime = runtime_context(ctx) body = { - "network": require_network(runtime), "scada_start": parse_time_with_timezone(start_time, option_name="--start-time").isoformat(), "scada_end": parse_time_with_timezone(end_time, option_name="--end-time").isoformat(), "scheme_name": resolve_scheme(runtime, scheme, required=True), @@ -354,10 +326,9 @@ def analysis_burst_detection_detect( ctx, summary="爆管检测执行成功", method="POST", - path="/burst-detection/detect/", + path="/burst-detections", json_body=body, require_auth=True, - require_network_ctx=True, ) @@ -370,11 +341,9 @@ def analysis_burst_detection_schemes_list(ctx: typer.Context) -> None: method="GET", path="/schemes", params={ - "network": require_network(runtime), "scheme_type": "burst_detection", }, require_auth=True, - require_network_ctx=True, ) @@ -390,11 +359,9 @@ def analysis_burst_detection_schemes_get( method="GET", path=f"/schemes/{scheme_name}", params={ - "network": require_network(runtime), "scheme_type": "burst_detection", }, require_auth=True, - require_network_ctx=True, ) @@ -416,7 +383,6 @@ def analysis_burst_location_locate( pressure_payload = parse_optional_dataset_file(pressure_file, label="pressure") or {} flow_payload = parse_optional_dataset_file(flow_file, label="flow") or {} body = { - "network": require_network(runtime), "scheme_name": resolve_scheme(runtime, scheme, required=True), "data_source": data_source.value, "scada_burst_start": parse_time_with_timezone(start_time, option_name="--start-time").isoformat(), @@ -436,10 +402,9 @@ def analysis_burst_location_locate( ctx, summary="爆管定位执行成功", method="POST", - path="/burst-location/locate/", + path="/burst-locations", json_body=body, require_auth=True, - require_network_ctx=True, ) @@ -452,11 +417,9 @@ def analysis_burst_location_schemes_list(ctx: typer.Context) -> None: method="GET", path="/schemes", params={ - "network": require_network(runtime), "scheme_type": "burst_location", }, require_auth=True, - require_network_ctx=True, ) @@ -472,11 +435,9 @@ def analysis_burst_location_schemes_get( method="GET", path=f"/schemes/{scheme_name}", params={ - "network": require_network(runtime), "scheme_type": "burst_location", }, require_auth=True, - require_network_ctx=True, ) @@ -490,10 +451,9 @@ def analysis_risk_pipe_now( ctx, summary="读取当前管道风险成功", method="GET", - path="/getpiperiskprobabilitynow/", - params={"network": require_network(runtime), "pipe_id": pipe}, + path="/pipes/risk-probability-now", + params={"pipe_id": pipe}, require_auth=True, - require_network_ctx=True, ) @@ -507,32 +467,26 @@ def analysis_risk_pipe_history( ctx, summary="读取历史管道风险成功", method="GET", - path="/getpiperiskprobability/", - params={"network": require_network(runtime), "pipe_id": pipe}, + path="/pipes/risk-probability", + params={"pipe_id": pipe}, require_auth=True, - require_network_ctx=True, ) @analysis_risk_app.command("network") def analysis_risk_network(ctx: typer.Context) -> None: runtime = runtime_context(ctx) - network = require_network(runtime) probabilities, duration_prob = request_json( runtime, method="GET", - path="/getnetworkpiperiskprobabilitynow/", - params={"network": network}, + path="/network-pipe-risk-probability-nows", require_auth=True, - require_network_ctx=True, ) geometries, duration_geo = request_json( runtime, method="GET", - path="/getpiperiskprobabilitygeometries/", - params={"network": network}, + path="/pipes/risk-probability-geometries", require_auth=True, - require_network_ctx=True, ) emit_success( summary="读取全网风险成功", diff --git a/cli/tjwater_cli/commands_data.py b/cli/tjwater_cli/commands_data.py index 5e0810b..d08b14b 100644 --- a/cli/tjwater_cli/commands_data.py +++ b/cli/tjwater_cli/commands_data.py @@ -13,7 +13,7 @@ from .apps import ( data_timeseries_scheme_app, ) from .common import emit_api, runtime_context -from .core import CLIError, parse_time_with_timezone, require_network, resolve_scheme +from .core import CLIError, parse_time_with_timezone, resolve_scheme from .option_types import ( CompositeKind, ElementType, @@ -73,7 +73,7 @@ def data_realtime_links( ctx, summary="读取实时管道数据成功", method="GET", - path="/realtime/links", + path="/timeseries/realtime/links", params={ "start_time": parse_time_with_timezone(start_time, option_name="--start-time").isoformat(), "end_time": parse_time_with_timezone(end_time, option_name="--end-time").isoformat(), @@ -93,7 +93,7 @@ def data_realtime_nodes( ctx, summary="读取实时节点数据成功", method="GET", - path="/realtime/nodes", + path="/timeseries/realtime/nodes", params={ "start_time": parse_time_with_timezone(start_time, option_name="--start-time").isoformat(), "end_time": parse_time_with_timezone(end_time, option_name="--end-time").isoformat(), @@ -114,7 +114,7 @@ def data_realtime_simulation_by_id_time( ctx, summary="读取实时模拟数据成功", method="GET", - path="/realtime/query/by-id-time", + path="/timeseries/realtime/simulation-results", params={ "id": id, "type": type.value, @@ -137,7 +137,7 @@ def data_realtime_simulation_by_time_property( ctx, summary="读取实时属性聚合数据成功", method="GET", - path="/realtime/query/by-time-property", + path="/timeseries/realtime/records", params={ "type": type.value, "query_time": parse_time_with_timezone(time, option_name="--time").isoformat(), @@ -161,7 +161,7 @@ def data_scheme_links( ctx, summary="读取方案管道数据成功", method="GET", - path="/scheme/links", + path="/timeseries/schemes/links", params={ "scheme_name": resolve_scheme(runtime, scheme, required=True), "scheme_type": _scheme_type_option(scheme_type), @@ -189,7 +189,7 @@ def data_scheme_node_field( ctx, summary="读取方案节点字段成功", method="GET", - path=f"/scheme/nodes/{node}/field", + path=f"/timeseries/schemes/nodes/{node}/field", params={ "field": field, "scheme_name": resolve_scheme(runtime, scheme, required=True), @@ -233,7 +233,7 @@ def data_scheme_simulation( ctx, summary="读取方案单点模拟数据成功", method="GET", - path="/scheme/query/by-id-time", + path="/timeseries/schemes/simulation-results", params=params, require_auth=True, require_project=True, @@ -253,7 +253,7 @@ def data_scheme_simulation( ctx, summary="读取方案属性聚合数据成功", method="GET", - path="/scheme/query/by-scheme-time-property", + path="/timeseries/schemes/records", params=params, require_auth=True, require_project=True, @@ -270,7 +270,7 @@ def data_scada_query( end_time: Annotated[str, typer.Option("--end-time", help="结束时间")], field: Annotated[str | None, typer.Option("--field", help="字段名,仅支持 monitored_value|cleaned_value")] = None, ) -> None: - path = "/scada/by-ids-field-time-range" if field else "/scada/by-ids-time-range" + path = "/timeseries/scada-readings/fields" if field else "/timeseries/scada-readings" params = { "device_ids": ",".join(device_id), "start_time": parse_time_with_timezone(start_time, option_name="--start-time").isoformat(), @@ -334,7 +334,7 @@ def data_timeseries_composite( ctx, summary="读取复合 SCADA-模拟数据成功", method="GET", - path="/composite/scada-simulation", + path="/timeseries/views/scada-simulations", params=params, require_auth=True, require_project=True, @@ -357,7 +357,7 @@ def data_timeseries_composite( ctx, summary="读取复合元素模拟数据成功", method="GET", - path="/composite/element-simulation", + path="/timeseries/views/element-simulations", params=params, require_auth=True, require_project=True, @@ -377,7 +377,7 @@ def data_timeseries_composite( ctx, summary="读取元素关联 SCADA 数据成功", method="GET", - path="/composite/element-scada", + path="/timeseries/views/element-scada-readings", params=params, require_auth=True, require_project=True, @@ -398,21 +398,19 @@ def data_composite_pipeline_health( ctx, summary="读取管道健康预测成功", method="GET", - path="/composite/pipeline-health-prediction", + path="/pipeline-health-predictions", params={ - "network_name": require_network(runtime_context(ctx)), "query_time": parse_time_with_timezone(end_time, option_name="--end-time").isoformat(), }, require_auth=True, require_project=True, - require_network_ctx=True, ) def _scada_mapping(kind: str, action: str) -> tuple[str, dict[str, str]]: mapping = { - ("info", "get"): ("/getscadainfo/", {"id_param": "id"}), - ("info", "list"): ("/getallscadainfo/", {}), + ("info", "get"): ("/scada-info/detail", {"id_param": "id"}), + ("info", "list"): ("/scada-info", {}), } result = mapping.get((kind, action)) if result is None: @@ -433,7 +431,7 @@ def data_scada_get( ) -> None: runtime = runtime_context(ctx) path, meta = _scada_mapping(kind.value, "get") - params = {"network": require_network(runtime), meta["id_param"]: id} + params = {meta["id_param"]: id} emit_api( ctx, summary="读取 SCADA 数据成功", @@ -441,7 +439,6 @@ def data_scada_get( path=path, params=params, require_auth=True, - require_network_ctx=True, ) @@ -457,9 +454,7 @@ def data_scada_list( summary="读取 SCADA 列表成功", method="GET", path=path, - params={"network": require_network(runtime)}, require_auth=True, - require_network_ctx=True, ) @@ -470,10 +465,8 @@ def data_scheme_schema(ctx: typer.Context) -> None: ctx, summary="读取方案 schema 成功", method="GET", - path="/getschemeschema/", - params={"network": require_network(runtime)}, + path="/network-schemas/scheme", require_auth=True, - require_network_ctx=True, ) @@ -487,10 +480,9 @@ def data_scheme_get( ctx, summary="读取方案成功", method="GET", - path="/getscheme/", - params={"network": require_network(runtime), "schema_name": name}, + path="/schemes/detail", + params={"schema_name": name}, require_auth=True, - require_network_ctx=True, ) @@ -502,7 +494,5 @@ def data_scheme_list(ctx: typer.Context) -> None: summary="读取方案列表成功", method="GET", path="/schemes", - params={"network": require_network(runtime)}, require_auth=True, - require_network_ctx=True, ) diff --git a/cli/tjwater_cli/commands_readonly.py b/cli/tjwater_cli/commands_readonly.py index c57a7d5..035fc41 100644 --- a/cli/tjwater_cli/commands_readonly.py +++ b/cli/tjwater_cli/commands_readonly.py @@ -5,8 +5,8 @@ from typing import Annotated import typer from .apps import component_option_app, network_app -from .common import emit_api, runtime_context -from .core import CLIError, require_network +from .common import emit_api +from .core import CLIError from .option_types import ComponentOptionKind @@ -15,15 +15,13 @@ def network_get_junction_properties( ctx: typer.Context, junction: Annotated[str, typer.Option("--junction", help="节点 ID")], ) -> None: - runtime = runtime_context(ctx) emit_api( ctx, summary="读取节点属性成功", method="GET", - path="/getjunctionproperties/", - params={"network": require_network(runtime), "junction": junction}, + path="/junctions/properties", + params={"junction": junction}, require_auth=True, - require_network_ctx=True, ) @@ -32,29 +30,25 @@ def network_get_pipe_properties( ctx: typer.Context, pipe: Annotated[str, typer.Option("--pipe", help="管道 ID")], ) -> None: - runtime = runtime_context(ctx) emit_api( ctx, summary="读取管道属性成功", method="GET", - path="/getpipeproperties/", - params={"network": require_network(runtime), "pipe": pipe}, + path="/pipes/properties", + params={"pipe": pipe}, require_auth=True, - require_network_ctx=True, ) @network_app.command("get-all-pipes-properties") def network_get_all_pipes_properties(ctx: typer.Context) -> None: - runtime = runtime_context(ctx) emit_api( ctx, summary="读取全部管道属性成功", method="GET", - path="/getallpipeproperties/", - params={"network": require_network(runtime)}, + path="/pipes", + params={}, require_auth=True, - require_network_ctx=True, ) @@ -63,29 +57,25 @@ def network_get_reservoir_properties( ctx: typer.Context, reservoir: Annotated[str, typer.Option("--reservoir", help="水库 ID")], ) -> None: - runtime = runtime_context(ctx) emit_api( ctx, summary="读取水库属性成功", method="GET", - path="/getreservoirproperties/", - params={"network": require_network(runtime), "reservoir": reservoir}, + path="/reservoirs/properties", + params={"reservoir": reservoir}, require_auth=True, - require_network_ctx=True, ) @network_app.command("get-all-reservoirs-properties") def network_get_all_reservoir_properties(ctx: typer.Context) -> None: - runtime = runtime_context(ctx) emit_api( ctx, summary="读取全部水库属性成功", method="GET", - path="/getallreservoirproperties/", - params={"network": require_network(runtime)}, + path="/reservoirs", + params={}, require_auth=True, - require_network_ctx=True, ) @@ -94,29 +84,25 @@ def network_get_tank_properties( ctx: typer.Context, tank: Annotated[str, typer.Option("--tank", help="水箱 ID")], ) -> None: - runtime = runtime_context(ctx) emit_api( ctx, summary="读取水箱属性成功", method="GET", - path="/gettankproperties/", - params={"network": require_network(runtime), "tank": tank}, + path="/tanks/properties", + params={"tank": tank}, require_auth=True, - require_network_ctx=True, ) @network_app.command("get-all-tanks-properties") def network_get_all_tank_properties(ctx: typer.Context) -> None: - runtime = runtime_context(ctx) emit_api( ctx, summary="读取全部水箱属性成功", method="GET", - path="/getalltankproperties/", - params={"network": require_network(runtime)}, + path="/tanks", + params={}, require_auth=True, - require_network_ctx=True, ) @@ -125,29 +111,25 @@ def network_get_pump_properties( ctx: typer.Context, pump: Annotated[str, typer.Option("--pump", help="水泵 ID")], ) -> None: - runtime = runtime_context(ctx) emit_api( ctx, summary="读取水泵属性成功", method="GET", - path="/getpumpproperties/", - params={"network": require_network(runtime), "pump": pump}, + path="/pumps/properties", + params={"pump": pump}, require_auth=True, - require_network_ctx=True, ) @network_app.command("get-all-pumps-properties") def network_get_all_pump_properties(ctx: typer.Context) -> None: - runtime = runtime_context(ctx) emit_api( ctx, summary="读取全部水泵属性成功", method="GET", - path="/getallpumpproperties/", - params={"network": require_network(runtime)}, + path="/pumps", + params={}, require_auth=True, - require_network_ctx=True, ) @@ -156,29 +138,25 @@ def network_get_valve_properties( ctx: typer.Context, valve: Annotated[str, typer.Option("--valve", help="阀门 ID")], ) -> None: - runtime = runtime_context(ctx) emit_api( ctx, summary="读取阀门属性成功", method="GET", - path="/getvalveproperties/", - params={"network": require_network(runtime), "valve": valve}, + path="/valves/properties", + params={"valve": valve}, require_auth=True, - require_network_ctx=True, ) @network_app.command("get-all-valves-properties") def network_get_all_valve_properties(ctx: typer.Context) -> None: - runtime = runtime_context(ctx) emit_api( ctx, summary="读取全部阀门属性成功", method="GET", - path="/getallvalveproperties/", - params={"network": require_network(runtime)}, + path="/valves", + params={}, require_auth=True, - require_network_ctx=True, ) @@ -188,9 +166,8 @@ def component_option_schema( kind: Annotated[ComponentOptionKind, typer.Option("--kind", help="选项类型,仅支持 time|energy|pump-energy|network")], pump: Annotated[str | None, typer.Option("--pump", help="pump-energy 时需要的泵 ID")] = None, ) -> None: - runtime = runtime_context(ctx) path = _component_option_path(kind.value, schema=True) - params = {"network": require_network(runtime)} + params: dict[str, str] = {} if kind == ComponentOptionKind.PUMP_ENERGY and pump: params["pump"] = pump emit_api( @@ -200,7 +177,6 @@ def component_option_schema( path=path, params=params, require_auth=True, - require_network_ctx=True, ) @@ -210,9 +186,8 @@ def component_option_get( kind: Annotated[ComponentOptionKind, typer.Option("--kind", help="选项类型,仅支持 time|energy|pump-energy|network")], pump: Annotated[str | None, typer.Option("--pump", help="pump-energy 时需要的泵 ID")] = None, ) -> None: - runtime = runtime_context(ctx) path = _component_option_path(kind.value, schema=False) - params = {"network": require_network(runtime)} + params: dict[str, str] = {} if kind == ComponentOptionKind.PUMP_ENERGY: if not pump: raise CLIError( @@ -229,20 +204,19 @@ def component_option_get( path=path, params=params, require_auth=True, - require_network_ctx=True, ) def _component_option_path(kind: str, *, schema: bool) -> str: routes = { - ("time", True): "/gettimeschema", - ("time", False): "/gettimeproperties/", - ("energy", True): "/getenergyschema/", - ("energy", False): "/getenergyproperties/", - ("pump-energy", True): "/getpumpenergyschema/", - ("pump-energy", False): "/getpumpenergyproperties//", - ("network", True): "/getoptionschema/", - ("network", False): "/getoptionproperties/", + ("time", True): "/network-schemas/time", + ("time", False): "/network-options/time", + ("energy", True): "/network-schemas/energy", + ("energy", False): "/network-options/energy", + ("pump-energy", True): "/network-schemas/pump-energy", + ("pump-energy", False): "/network-options/pump-energy", + ("network", True): "/network-schemas/option", + ("network", False): "/network-options", } path = routes.get((kind, schema)) if path is None: diff --git a/cli/tjwater_cli/common.py b/cli/tjwater_cli/common.py index fef8b64..7a1e9c2 100644 --- a/cli/tjwater_cli/common.py +++ b/cli/tjwater_cli/common.py @@ -38,8 +38,6 @@ def emit_api( json_body: Any = None, require_auth: bool = True, require_project: bool = False, - require_network_ctx: bool = False, - require_username_ctx: bool = False, next_commands: list[str] | None = None, ) -> None: runtime = runtime_context(ctx) @@ -51,8 +49,6 @@ def emit_api( json_body=json_body, require_auth=require_auth, require_project=require_project, - require_network_ctx=require_network_ctx, - require_username_ctx=require_username_ctx, ) emit_success( summary=summary, diff --git a/cli/tjwater_cli/core.py b/cli/tjwater_cli/core.py index 2fb33da..eb5056b 100644 --- a/cli/tjwater_cli/core.py +++ b/cli/tjwater_cli/core.py @@ -17,8 +17,6 @@ SCHEMA_VERSION = "tjwater-cli/v1" CLI_NAME = "tjwater-cli" DEFAULT_TIMEOUT = 180 DEFAULT_SERVER = "http://192.168.1.114:8000" - - class CLIError(Exception): def __init__( self, @@ -46,8 +44,6 @@ class AuthContext: server: str | None = None access_token: str | None = None project_id: str | None = None - username: str | None = None - network: str | None = None headers: dict[str, str] = field(default_factory=dict) @@ -97,8 +93,6 @@ def load_auth_context(auth_stdin: bool = False) -> AuthContext: "server": os.getenv("TJWATER_SERVER"), "access_token": os.getenv("TJWATER_ACCESS_TOKEN"), "project_id": os.getenv("TJWATER_PROJECT_ID"), - "username": os.getenv("TJWATER_USERNAME"), - "network": os.getenv("TJWATER_NETWORK"), "headers": json.loads(extra_headers) if extra_headers else {}, } @@ -115,8 +109,6 @@ def load_auth_context(auth_stdin: bool = False) -> AuthContext: server=_pick(raw, "server", "base_url"), access_token=_pick(raw, "access_token", "token", "accessToken"), project_id=_pick(raw, "project_id", "projectId", "x_project_id"), - username=_pick(raw, "username", "preferred_username"), - network=_pick(raw, "network", "project_code", "projectCode", "project"), headers={str(key): str(value) for key, value in headers.items()}, ) @@ -175,30 +167,6 @@ def require_project_id(ctx: RuntimeContext) -> str: ) -def require_network(ctx: RuntimeContext) -> str: - if ctx.auth.network: - return ctx.auth.network - raise CLIError( - "认证失败", - code="NETWORK_CONTEXT_REQUIRED", - message="missing network in auth context for legacy network-based endpoints", - exit_code=3, - next_commands=["add network to auth context"], - ) - - -def require_username(ctx: RuntimeContext) -> str: - if ctx.auth.username: - return ctx.auth.username - raise CLIError( - "认证失败", - code="USERNAME_CONTEXT_REQUIRED", - message="missing username in auth context", - exit_code=3, - next_commands=["add username to auth context"], - ) - - def resolve_scheme(ctx: RuntimeContext, explicit_scheme: str | None, *, required: bool = False) -> str | None: scheme = explicit_scheme or ctx.scheme if required and not scheme: @@ -254,14 +222,14 @@ def parse_burst_file(path: Path) -> tuple[list[str], list[float]]: raw = read_json_input(path, label="burst") if isinstance(raw, dict) and "bursts" in raw: raw = raw["bursts"] - if isinstance(raw, dict) and "burst_ID" in raw and "burst_size" in raw: - ids = [str(item) for item in raw["burst_ID"]] + if isinstance(raw, dict) and "burst_id" in raw and "burst_size" in raw: + ids = [str(item) for item in raw["burst_id"]] sizes = [float(item) for item in raw["burst_size"]] if len(ids) != len(sizes): raise CLIError( "CLI 参数错误", code="BURST_FILE_INVALID", - message="burst file burst_ID and burst_size must have the same length", + message="burst file burst_id and burst_size must have the same length", exit_code=2, ) return ids, sizes @@ -282,7 +250,7 @@ def parse_burst_file(path: Path) -> tuple[list[str], list[float]]: raise CLIError( "CLI 参数错误", code="BURST_FILE_INVALID", - message="burst file must be a JSON array or object with burst_ID/burst_size", + message="burst file must be a JSON array or object with burst_id/burst_size", exit_code=2, ) @@ -404,12 +372,13 @@ def _parse_response_body(response: requests.Response) -> Any: return {} -def _with_network_param(params: dict[str, Any] | None, network: str) -> dict[str, Any]: - params = dict(params or {}) - if "network" in params or "network_name" in params or "name" in params: - return params - params["network"] = network - return params +def _prepare_public_request( + method: str, + path: str, + params: dict[str, Any] | None, + json_body: Any, +) -> tuple[str, str, dict[str, Any] | None, Any]: + return method.upper(), path.rstrip("/") or "/", params or None, json_body def request_json( @@ -421,18 +390,14 @@ def request_json( json_body: Any = None, require_auth: bool = True, require_project: bool = False, - require_network_ctx: bool = False, - require_username_ctx: bool = False, ) -> tuple[Any, int]: require_server(ctx) - network = None - if require_network_ctx: - network = require_network(ctx) - if require_username_ctx: - require_username(ctx) - if network and (params is not None or json_body is None): - params = _with_network_param(params, network) - + method, path, params, json_body = _prepare_public_request( + method, + path, + params, + json_body, + ) url = f"{require_server(ctx)}/api/v1{path}" headers = build_headers(ctx, require_auth=require_auth, require_project=require_project) started = time.monotonic() @@ -482,15 +447,14 @@ def request_bytes( params: dict[str, Any] | None = None, require_auth: bool = True, require_project: bool = False, - require_network_ctx: bool = False, ) -> tuple[bytes, int]: require_server(ctx) - network = None - if require_network_ctx: - network = require_network(ctx) - if network: - params = _with_network_param(params, network) - + method, path, params, _ = _prepare_public_request( + method, + path, + params, + None, + ) url = f"{require_server(ctx)}/api/v1{path}" headers = build_headers(ctx, require_auth=require_auth, require_project=require_project) started = time.monotonic() diff --git a/cli/tjwater_cli/registry.py b/cli/tjwater_cli/registry.py index 14a9e37..288344f 100644 --- a/cli/tjwater_cli/registry.py +++ b/cli/tjwater_cli/registry.py @@ -35,73 +35,73 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = { ("network", "get-junction-properties"): CommandDoc( path=("network", "get-junction-properties"), summary="读取节点属性", - description="调用 /getjunctionproperties/。", + description="调用 GET /api/v1/junctions/{junction_id}/properties。", options=(CommandOptionDoc("junction", "节点 ID", required=True),), examples=("tjwater-cli network get-junction-properties --junction J1",), ), ("network", "get-pipe-properties"): CommandDoc( path=("network", "get-pipe-properties"), summary="读取管道属性", - description="调用 /getpipeproperties/。", + description="调用 GET /api/v1/pipes/{pipe_id}/properties。", options=(CommandOptionDoc("pipe", "管道 ID", required=True),), examples=("tjwater-cli network get-pipe-properties --pipe P1",), ), ("network", "get-all-pipes-properties"): CommandDoc( path=("network", "get-all-pipes-properties"), summary="读取全部管道属性", - description="调用 /getallpipeproperties/。", + description="调用 GET /api/v1/pipes/properties。", examples=("tjwater-cli network get-all-pipes-properties",), ), ("network", "get-reservoir-properties"): CommandDoc( path=("network", "get-reservoir-properties"), summary="读取水库属性", - description="调用 /getreservoirproperties/。", + description="调用 GET /api/v1/reservoirs/{reservoir_id}/properties。", options=(CommandOptionDoc("reservoir", "水库 ID", required=True),), examples=("tjwater-cli network get-reservoir-properties --reservoir R1",), ), ("network", "get-all-reservoirs-properties"): CommandDoc( path=("network", "get-all-reservoirs-properties"), summary="读取全部水库属性", - description="调用 /getallreservoirproperties/。", + description="调用 GET /api/v1/reservoirs/properties。", examples=("tjwater-cli network get-all-reservoirs-properties",), ), ("network", "get-tank-properties"): CommandDoc( path=("network", "get-tank-properties"), summary="读取水箱属性", - description="调用 /gettankproperties/。", + description="调用 GET /api/v1/tanks/{tank_id}/properties。", options=(CommandOptionDoc("tank", "水箱 ID", required=True),), examples=("tjwater-cli network get-tank-properties --tank T1",), ), ("network", "get-all-tanks-properties"): CommandDoc( path=("network", "get-all-tanks-properties"), summary="读取全部水箱属性", - description="调用 /getalltankproperties/。", + description="调用 GET /api/v1/tanks/properties。", examples=("tjwater-cli network get-all-tanks-properties",), ), ("network", "get-pump-properties"): CommandDoc( path=("network", "get-pump-properties"), summary="读取水泵属性", - description="调用 /getpumpproperties/。", + description="调用 GET /api/v1/pumps/{pump_id}/properties。", options=(CommandOptionDoc("pump", "水泵 ID", required=True),), examples=("tjwater-cli network get-pump-properties --pump PU1",), ), ("network", "get-all-pumps-properties"): CommandDoc( path=("network", "get-all-pumps-properties"), summary="读取全部水泵属性", - description="调用 /getallpumpproperties/。", + description="调用 GET /api/v1/pumps/properties。", examples=("tjwater-cli network get-all-pumps-properties",), ), ("network", "get-valve-properties"): CommandDoc( path=("network", "get-valve-properties"), summary="读取阀门属性", - description="调用 /getvalveproperties/。", + description="调用 GET /api/v1/valves/{valve_id}/properties。", options=(CommandOptionDoc("valve", "阀门 ID", required=True),), examples=("tjwater-cli network get-valve-properties --valve V1",), ), ("network", "get-all-valves-properties"): CommandDoc( path=("network", "get-all-valves-properties"), summary="读取全部阀门属性", - description="调用 /getallvalveproperties/。", + description="调用 GET /api/v1/valves/properties。", examples=("tjwater-cli network get-all-valves-properties",), ), ("component", "option", "schema"): CommandDoc( @@ -137,7 +137,7 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = { ("simulation", "run"): CommandDoc( path=("simulation", "run"), summary="触发指定绝对时间的模拟运行", - description="把显式带时区的 RFC3339 start-time 直接传给 /simulations/run-by-date;服务端按带时区时间处理并统一按 UTC 存储结果,实时数据需后续通过 data timeseries 在对应时间段查询。duration 单位为分钟。", + description="把显式带时区的 RFC3339 start-time 直接传给 POST /api/v1/simulation-runs;服务端按带时区时间处理并统一按 UTC 存储结果,实时数据需后续通过 data timeseries 在对应时间段查询。duration 单位为分钟。", options=( CommandOptionDoc("start-time", "显式带时区的开始时间", required=True), CommandOptionDoc("duration", "持续分钟数", required=True), @@ -152,7 +152,7 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = { ("analysis", "burst"): CommandDoc( path=("analysis", "burst"), summary="执行爆管分析", - description="读取 burst-file 并转换为 burst_ID[] / burst_size[];接口本身只返回分析执行结果,方案数据需后续通过 data scheme 命令获取。duration 单位为秒。", + description="读取 burst-file 的 burst_id[] / burst_size[] 并调用 POST /api/v1/burst-analyses;接口本身只返回分析执行结果,方案数据需后续通过 data scheme 命令获取。duration 单位为秒。", options=( CommandOptionDoc("start-time", "显式带时区的开始时间", required=True), CommandOptionDoc("duration", "持续秒数", required=True), @@ -201,7 +201,7 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = { ("analysis", "age"): CommandDoc( path=("analysis", "age"), summary="执行水龄分析", - description="调用 /age_analysis/。duration 单位为秒。", + description="调用 POST /api/v1/water-age-analyses。duration 单位为秒。", options=( CommandOptionDoc("start-time", "显式带时区的开始时间", required=True), CommandOptionDoc("duration", "持续秒数", required=True), @@ -211,7 +211,7 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = { ("analysis", "contaminant"): CommandDoc( path=("analysis", "contaminant"), summary="执行污染物模拟", - description="调用 /contaminant-simulation。duration 单位为秒。", + description="调用 POST /api/v1/contaminant-simulations。duration 单位为秒。", options=( CommandOptionDoc("start-time", "显式带时区的开始时间", required=True), CommandOptionDoc("duration", "持续秒数", required=True), @@ -247,19 +247,19 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = { ("analysis", "leakage", "schemes", "list"): CommandDoc( path=("analysis", "leakage", "schemes", "list"), summary="列出漏损方案", - description="调用 /schemes,并传入 scheme_type=dma_leak_identification。", + description="调用 GET /api/v1/schemes,并传入 scheme_type=dma_leak_identification。", examples=("tjwater-cli analysis leakage schemes list",), ), ("analysis", "leakage", "schemes", "get"): CommandDoc( path=("analysis", "leakage", "schemes", "get"), summary="读取漏损方案详情", - description="调用 /schemes/{scheme_name},并传入 scheme_type=dma_leak_identification。", + description="调用 GET /api/v1/schemes/{scheme_name},并传入 scheme_type=dma_leak_identification。", examples=("tjwater-cli analysis leakage schemes get my_scheme",), ), ("analysis", "burst-detection", "detect"): CommandDoc( path=("analysis", "burst-detection", "detect"), summary="执行爆管检测", - description="调用 /burst-detection/detect/。", + description="调用 POST /api/v1/burst-detections。", options=( CommandOptionDoc("start-time", "显式带时区的 SCADA 开始时间", required=True), CommandOptionDoc("end-time", "显式带时区的 SCADA 结束时间", required=True), @@ -270,19 +270,19 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = { ("analysis", "burst-detection", "schemes", "list"): CommandDoc( path=("analysis", "burst-detection", "schemes", "list"), summary="列出爆管检测方案", - description="调用 /schemes,并传入 scheme_type=burst_detection。", + description="调用 GET /api/v1/schemes,并传入 scheme_type=burst_detection。", examples=("tjwater-cli analysis burst-detection schemes list",), ), ("analysis", "burst-detection", "schemes", "get"): CommandDoc( path=("analysis", "burst-detection", "schemes", "get"), summary="读取爆管检测方案详情", - description="调用 /schemes/{scheme_name},并传入 scheme_type=burst_detection。", + description="调用 GET /api/v1/schemes/{scheme_name},并传入 scheme_type=burst_detection。", examples=("tjwater-cli analysis burst-detection schemes get my_scheme",), ), ("analysis", "burst-location", "locate"): CommandDoc( path=("analysis", "burst-location", "locate"), summary="执行爆管定位", - description="调用 /burst-location/locate/;需要 burst-leakage。支持 monitoring 和 simulation 两种数据源。", + description="调用 POST /api/v1/burst-locations;需要 burst-leakage。支持 monitoring 和 simulation 两种数据源。", options=( CommandOptionDoc("start-time", "显式带时区的 SCADA 开始时间", required=True), CommandOptionDoc("end-time", "显式带时区的 SCADA 结束时间", required=True), @@ -303,26 +303,26 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = { ("analysis", "burst-location", "schemes", "list"): CommandDoc( path=("analysis", "burst-location", "schemes", "list"), summary="列出爆管定位方案", - description="调用 /schemes,并传入 scheme_type=burst_location。", + description="调用 GET /api/v1/schemes,并传入 scheme_type=burst_location。", examples=("tjwater-cli analysis burst-location schemes list",), ), ("analysis", "burst-location", "schemes", "get"): CommandDoc( path=("analysis", "burst-location", "schemes", "get"), summary="读取爆管定位方案详情", - description="调用 /schemes/{scheme_name},并传入 scheme_type=burst_location。", + description="调用 GET /api/v1/schemes/{scheme_name},并传入 scheme_type=burst_location。", examples=("tjwater-cli analysis burst-location schemes get my_scheme",), ), ("analysis", "risk", "pipe-now"): CommandDoc( path=("analysis", "risk", "pipe-now"), summary="读取单条管道当前风险", - description="调用 /getpiperiskprobabilitynow/。", + description="调用 GET /api/v1/pipes/risk-probability-now。", options=(CommandOptionDoc("pipe", "管道 ID", required=True),), examples=("tjwater-cli analysis risk pipe-now --pipe P1",), ), ("analysis", "risk", "pipe-history"): CommandDoc( path=("analysis", "risk", "pipe-history"), summary="读取单条管道历史风险", - description="调用 /getpiperiskprobability/。", + description="调用 GET /api/v1/pipes/risk-probability。", options=(CommandOptionDoc("pipe", "管道 ID", required=True),), examples=("tjwater-cli analysis risk pipe-history --pipe P1",), ), @@ -335,7 +335,7 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = { ("data", "timeseries", "realtime", "links"): CommandDoc( path=("data", "timeseries", "realtime", "links"), summary="查询实时管道时序", - description="调用 /realtime/links。", + description="调用 GET /api/v1/timeseries/realtime/links。", options=( CommandOptionDoc("start-time", "显式带时区的开始时间", required=True), CommandOptionDoc("end-time", "显式带时区的结束时间", required=True), @@ -345,7 +345,7 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = { ("data", "timeseries", "realtime", "nodes"): CommandDoc( path=("data", "timeseries", "realtime", "nodes"), summary="查询实时节点时序", - description="调用 /realtime/nodes。", + description="调用 GET /api/v1/timeseries/realtime/nodes。", options=( CommandOptionDoc("start-time", "显式带时区的开始时间", required=True), CommandOptionDoc("end-time", "显式带时区的结束时间", required=True), @@ -355,7 +355,7 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = { ("data", "timeseries", "realtime", "simulation-by-id-time"): CommandDoc( path=("data", "timeseries", "realtime", "simulation-by-id-time"), summary="按元素和时间查询实时模拟结果", - description="调用 /realtime/query/by-id-time。", + description="调用 GET /api/v1/timeseries/realtime/by-element。", options=( CommandOptionDoc("id", "元素 ID", required=True), CommandOptionDoc("type", "元素类型:pipe 或 junction;links/nodes 是独立子命令,不是 type 取值", required=True), @@ -369,7 +369,7 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = { ("data", "timeseries", "realtime", "simulation-by-time-property"): CommandDoc( path=("data", "timeseries", "realtime", "simulation-by-time-property"), summary="按时间和属性查询实时模拟结果", - description="调用 /realtime/query/by-time-property。pipe 属性:flow、friction、headloss、quality、reaction、setting、status、velocity;junction 属性:actual_demand、total_head、pressure、quality。", + description="调用 GET /api/v1/timeseries/realtime/by-property。pipe 属性:flow、friction、headloss、quality、reaction、setting、status、velocity;junction 属性:actual_demand、total_head、pressure、quality。", options=( CommandOptionDoc("type", "元素类型:pipe 或 junction;links/nodes 是独立子命令,不是 type 取值", required=True), CommandOptionDoc("time", "显式带时区的查询时间", required=True), @@ -380,7 +380,7 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = { ("data", "timeseries", "scheme", "links"): CommandDoc( path=("data", "timeseries", "scheme", "links"), summary="查询方案管道时序", - description="调用 /scheme/links。", + description="调用 GET /api/v1/timeseries/schemes/links。", options=( CommandOptionDoc("start-time", "显式带时区的开始时间", required=True), CommandOptionDoc("end-time", "显式带时区的结束时间", required=True), @@ -392,7 +392,7 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = { ("data", "timeseries", "scheme", "node-field"): CommandDoc( path=("data", "timeseries", "scheme", "node-field"), summary="查询方案节点字段时序", - description="调用 /scheme/nodes/{node_id}/field。field 仅支持 actual_demand、total_head、pressure、quality。", + description="调用 GET /api/v1/timeseries/schemes/nodes/{node_id}/{field}。field 仅支持 actual_demand、total_head、pressure、quality。", options=( CommandOptionDoc("node", "节点 ID", required=True), CommandOptionDoc("field", "字段名:actual_demand、total_head、pressure、quality", required=True), @@ -458,7 +458,7 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = { ("data", "timeseries", "composite", "pipeline-health"): CommandDoc( path=("data", "timeseries", "composite", "pipeline-health"), summary="查询管道健康预测", - description="调用 /composite/pipeline-health-prediction。", + description="调用 GET /api/v1/pipeline-health-predictions。", options=( CommandOptionDoc("pipe", "管道 ID", required=True), CommandOptionDoc("start-time", "显式带时区的开始时间", required=True), @@ -486,20 +486,20 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = { ("data", "scheme", "schema"): CommandDoc( path=("data", "scheme", "schema"), summary="读取方案 schema", - description="调用 /getschemeschema/。", + description="调用 GET /api/v1/network-schemas/scheme。", examples=("tjwater-cli data scheme schema",), ), ("data", "scheme", "get"): CommandDoc( path=("data", "scheme", "get"), summary="读取单条方案", - description="调用 /getscheme/。", + description="调用 GET /api/v1/schemes/detail。", options=(CommandOptionDoc("name", "方案名称", required=True),), examples=("tjwater-cli data scheme get --name my_scheme",), ), ("data", "scheme", "list"): CommandDoc( path=("data", "scheme", "list"), summary="列出方案", - description="调用 /schemes。", + description="调用 GET /api/v1/schemes。", examples=("tjwater-cli data scheme list",), ), } diff --git a/contracts/manifest.json b/contracts/manifest.json new file mode 100644 index 0000000..719a09e --- /dev/null +++ b/contracts/manifest.json @@ -0,0 +1,9 @@ +{ + "contract_version": "1.0.0", + "contracts": { + "server": { + "file": "server-v1.openapi.json", + "sha256": "d80a968d281fdb2953364a5979c2d61fda5151a1e1759c01cc96780b11a6d56c" + } + } +} diff --git a/contracts/server-v1.openapi.json b/contracts/server-v1.openapi.json new file mode 100644 index 0000000..15f2abe --- /dev/null +++ b/contracts/server-v1.openapi.json @@ -0,0 +1,51672 @@ +{ + "components": { + "schemas": { + "AccessContextResponse": { + "properties": { + "is_system_admin": { + "title": "Is System Admin", + "type": "boolean" + }, + "permissions": { + "items": { + "type": "string" + }, + "title": "Permissions", + "type": "array" + }, + "project_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Project Id" + }, + "project_role": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Project Role" + }, + "system_role": { + "title": "System Role", + "type": "string" + }, + "user_id": { + "format": "uuid", + "title": "User Id", + "type": "string" + }, + "username": { + "title": "Username", + "type": "string" + } + }, + "required": [ + "user_id", + "username", + "system_role", + "is_system_admin", + "permissions" + ], + "title": "AccessContextResponse", + "type": "object" + }, + "AdminProjectCreateRequest": { + "properties": { + "code": { + "maxLength": 50, + "minLength": 1, + "title": "Code", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "gs_workspace": { + "maxLength": 100, + "minLength": 1, + "title": "Gs Workspace", + "type": "string" + }, + "map_extent": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Map Extent" + }, + "name": { + "maxLength": 100, + "minLength": 1, + "title": "Name", + "type": "string" + }, + "status": { + "default": "active", + "enum": [ + "active", + "inactive", + "archived" + ], + "title": "Status", + "type": "string" + } + }, + "required": [ + "name", + "code", + "gs_workspace" + ], + "title": "AdminProjectCreateRequest", + "type": "object" + }, + "AdminProjectResponse": { + "properties": { + "code": { + "title": "Code", + "type": "string" + }, + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "gs_workspace": { + "title": "Gs Workspace", + "type": "string" + }, + "map_extent": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Map Extent" + }, + "name": { + "title": "Name", + "type": "string" + }, + "project_id": { + "format": "uuid", + "title": "Project Id", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + }, + "updated_at": { + "format": "date-time", + "title": "Updated At", + "type": "string" + } + }, + "required": [ + "project_id", + "name", + "code", + "gs_workspace", + "status", + "created_at", + "updated_at" + ], + "title": "AdminProjectResponse", + "type": "object" + }, + "AdminProjectUpdateRequest": { + "properties": { + "code": { + "anyOf": [ + { + "maxLength": 50, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Code" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "gs_workspace": { + "anyOf": [ + { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Gs Workspace" + }, + "map_extent": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Map Extent" + }, + "name": { + "anyOf": [ + { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name" + }, + "status": { + "anyOf": [ + { + "enum": [ + "active", + "inactive", + "archived" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Status" + } + }, + "title": "AdminProjectUpdateRequest", + "type": "object" + }, + "AgentAuthContextResponse": { + "properties": { + "is_superuser": { + "title": "Is Superuser", + "type": "boolean" + }, + "keycloak_sub": { + "title": "Keycloak Sub", + "type": "string" + }, + "network": { + "title": "Network", + "type": "string" + }, + "permissions": { + "items": { + "type": "string" + }, + "title": "Permissions", + "type": "array" + }, + "project_id": { + "title": "Project Id", + "type": "string" + }, + "project_role": { + "title": "Project Role", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + }, + "token_expires_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Token Expires At" + }, + "user_id": { + "title": "User Id", + "type": "string" + }, + "username": { + "title": "Username", + "type": "string" + } + }, + "required": [ + "user_id", + "keycloak_sub", + "username", + "role", + "is_superuser", + "project_id", + "network", + "project_role", + "permissions" + ], + "title": "AgentAuthContextResponse", + "type": "object" + }, + "AuditLogResponse": { + "description": "审计日志响应", + "properties": { + "action": { + "title": "Action", + "type": "string" + }, + "id": { + "format": "uuid", + "title": "Id", + "type": "string" + }, + "ip_address": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ip Address" + }, + "project_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Project Id" + }, + "request_data": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Request Data" + }, + "request_method": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Request Method" + }, + "request_path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Request Path" + }, + "resource_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Resource Id" + }, + "resource_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Resource Type" + }, + "response_status": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Response Status" + }, + "timestamp": { + "format": "date-time", + "title": "Timestamp", + "type": "string" + }, + "user_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "User Id" + } + }, + "required": [ + "id", + "user_id", + "project_id", + "action", + "resource_type", + "resource_id", + "ip_address", + "request_method", + "request_path", + "request_data", + "response_status", + "timestamp" + ], + "title": "AuditLogResponse", + "type": "object" + }, + "Body_patch_admin_projects_project_id_model_imports": { + "properties": { + "file": { + "description": "桌面端导出的 INP 模型文件", + "format": "binary", + "title": "File", + "type": "string" + } + }, + "required": [ + "file" + ], + "title": "Body_patch_admin_projects_project_id_model_imports", + "type": "object" + }, + "Body_post_admin_projects_project_id_model_imports": { + "properties": { + "file": { + "description": "桌面端导出的 INP 模型文件", + "format": "binary", + "title": "File", + "type": "string" + } + }, + "required": [ + "file" + ], + "title": "Body_post_admin_projects_project_id_model_imports", + "type": "object" + }, + "Body_post_timeseries_realtime_simulation_results": { + "properties": { + "link_result_list": { + "description": "管道模拟结果列表", + "items": { + "type": "object" + }, + "title": "Link Result List", + "type": "array" + }, + "node_result_list": { + "description": "节点模拟结果列表", + "items": { + "type": "object" + }, + "title": "Node Result List", + "type": "array" + } + }, + "required": [ + "node_result_list", + "link_result_list" + ], + "title": "Body_post_timeseries_realtime_simulation_results", + "type": "object" + }, + "Body_post_timeseries_schemes_simulation_results": { + "properties": { + "link_result_list": { + "description": "管道模拟结果列表", + "items": { + "type": "object" + }, + "title": "Link Result List", + "type": "array" + }, + "node_result_list": { + "description": "节点模拟结果列表", + "items": { + "type": "object" + }, + "title": "Node Result List", + "type": "array" + } + }, + "required": [ + "node_result_list", + "link_result_list" + ], + "title": "Body_post_timeseries_schemes_simulation_results", + "type": "object" + }, + "BurstDetectionRequestRest": { + "properties": { + "data_source": { + "default": "monitoring", + "description": "数据来源:monitoring(监测)或simulation(模拟)", + "title": "Data Source", + "type": "string" + }, + "iforest_params": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "description": "隔离森林算法参数", + "title": "Iforest Params" + }, + "mu": { + "default": 100, + "description": "异常值检测的参数", + "title": "Mu", + "type": "integer" + }, + "observed_pressure_data": { + "anyOf": [ + { + "additionalProperties": { + "items": {}, + "type": "array" + }, + "type": "object" + }, + { + "items": { + "type": "object" + }, + "type": "array" + }, + { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "压力观测数据。支持列式字典 {sensor_id: [values,...]}、逐时刻对象数组 [{sensor_id: value,...}, ...]、或二维数组 [[t1_s1, t1_s2], [t2_s1, t2_s2], ...]。", + "title": "Observed Pressure Data" + }, + "points_per_day": { + "default": 1440, + "description": "每天的数据点数", + "title": "Points Per Day", + "type": "integer" + }, + "sampling_interval_minutes": { + "anyOf": [ + { + "maximum": 1440.0, + "minimum": 1.0, + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "采样间隔(分钟);为空时根据压力 SCADA 传输频率自动推断", + "title": "Sampling Interval Minutes" + }, + "scada_end": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "SCADA数据结束时间", + "title": "Scada End" + }, + "scada_start": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "SCADA数据起始时间", + "title": "Scada Start" + }, + "scheme_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "方案名称", + "title": "Scheme Name" + }, + "sensor_nodes": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "传感器节点列表", + "title": "Sensor Nodes" + }, + "simulation_scheme_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "模拟方案名称", + "title": "Simulation Scheme Name" + }, + "simulation_scheme_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "模拟方案类型", + "title": "Simulation Scheme Type" + }, + "target_time": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "目标侦测时刻;为空时自动使用最近一个完整的监测时刻", + "title": "Target Time" + } + }, + "title": "BurstDetectionRequestRest", + "type": "object" + }, + "BurstLocationRequestRest": { + "properties": { + "basic_pressure": { + "default": 10.0, + "description": "基准压力(bar)", + "title": "Basic Pressure", + "type": "number" + }, + "burst_flow": { + "anyOf": [ + { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + { + "items": { + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "爆管时的流量数据", + "title": "Burst Flow" + }, + "burst_leakage": { + "description": "爆管时的漏水量", + "title": "Burst Leakage", + "type": "number" + }, + "burst_pressure": { + "anyOf": [ + { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + { + "items": { + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "爆管时的压力数据", + "title": "Burst Pressure" + }, + "data_source": { + "default": "monitoring", + "description": "数据来源:monitoring(监测)或simulation(模拟)", + "enum": [ + "monitoring", + "simulation" + ], + "title": "Data Source", + "type": "string" + }, + "flow_scada_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "流量SCADA传感器ID列表", + "title": "Flow Scada Ids" + }, + "min_dpressure": { + "default": 2.0, + "description": "最小压力差(bar)", + "title": "Min Dpressure", + "type": "number" + }, + "normal_flow": { + "anyOf": [ + { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + { + "items": { + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "正常时的流量数据", + "title": "Normal Flow" + }, + "normal_pressure": { + "anyOf": [ + { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + { + "items": { + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "正常时的压力数据", + "title": "Normal Pressure" + }, + "pressure_scada_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "压力SCADA传感器ID列表", + "title": "Pressure Scada Ids" + }, + "scada_burst_end": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "爆管/模拟方案结束时间", + "title": "Scada Burst End" + }, + "scada_burst_start": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "爆管/模拟方案开始时间", + "title": "Scada Burst Start" + }, + "scada_normal_end": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "监测数据正常工况结束时间", + "title": "Scada Normal End" + }, + "scada_normal_start": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "监测数据正常工况开始时间", + "title": "Scada Normal Start" + }, + "scheme_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "方案名称", + "title": "Scheme Name" + }, + "simulation_scheme_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "模拟方案名称", + "title": "Simulation Scheme Name" + }, + "simulation_scheme_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "模拟方案类型", + "title": "Simulation Scheme Type" + }, + "use_scada_flow": { + "default": false, + "description": "是否使用SCADA流量数据", + "title": "Use Scada Flow", + "type": "boolean" + } + }, + "required": [ + "burst_leakage" + ], + "title": "BurstLocationRequestRest", + "type": "object" + }, + "DailySchedulingAnalysisRest": { + "properties": { + "pump_control": { + "description": "泵控制策略", + "title": "Pump Control", + "type": "object" + }, + "reservoir_id": { + "description": "水库ID", + "title": "Reservoir Id", + "type": "string" + }, + "start_time": { + "description": "开始时间", + "title": "Start Time", + "type": "string" + }, + "tank_id": { + "description": "水箱ID", + "title": "Tank Id", + "type": "string" + }, + "time_delta": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 300, + "description": "时间步长 (秒)", + "title": "Time Delta" + }, + "water_plant_output_id": { + "description": "水厂出水ID", + "title": "Water Plant Output Id", + "type": "string" + } + }, + "required": [ + "start_time", + "pump_control", + "reservoir_id", + "tank_id", + "water_plant_output_id" + ], + "title": "DailySchedulingAnalysisRest", + "type": "object" + }, + "JsonValue": {}, + "LeakageIdentifyRequestRest": { + "properties": { + "dma_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "DMA区域数量", + "title": "Dma Count" + }, + "duration": { + "default": 24, + "description": "持续时间(小时)", + "title": "Duration", + "type": "number" + }, + "max_gen": { + "default": 100, + "description": "最大代数", + "title": "Max Gen", + "type": "integer" + }, + "n_workers": { + "default": 4, + "description": "工作线程数", + "title": "N Workers", + "type": "integer" + }, + "observed_pressure_data": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "items": {}, + "type": "array" + }, + "type": "object" + }, + { + "items": { + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "观测的压力数据", + "title": "Observed Pressure Data" + }, + "output_dir": { + "default": "db_inp", + "description": "输出目录", + "title": "Output Dir", + "type": "string" + }, + "output_flow_unit": { + "default": "m3/s", + "description": "输出流量单位", + "title": "Output Flow Unit", + "type": "string" + }, + "pop_size": { + "default": 50, + "description": "种群大小", + "title": "Pop Size", + "type": "integer" + }, + "q_sum": { + "default": 0.2, + "description": "总流量(m3/s)", + "title": "Q Sum", + "type": "number" + }, + "q_sum_unit": { + "default": "m3/s", + "description": "流量单位", + "title": "Q Sum Unit", + "type": "string" + }, + "scada_end": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "SCADA数据结束时间", + "title": "Scada End" + }, + "scada_start": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "SCADA数据起始时间", + "title": "Scada Start" + }, + "scheme_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "方案名称", + "title": "Scheme Name" + }, + "sensor_nodes": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "传感器节点列表", + "title": "Sensor Nodes" + }, + "start_time": { + "default": 0, + "description": "起始时间(小时)", + "title": "Start Time", + "type": "number" + }, + "timestep": { + "default": 5, + "description": "时间步长(分钟)", + "title": "Timestep", + "type": "number" + } + }, + "title": "LeakageIdentifyRequestRest", + "type": "object" + }, + "MetadataUserResponse": { + "properties": { + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "email": { + "title": "Email", + "type": "string" + }, + "id": { + "format": "uuid", + "title": "Id", + "type": "string" + }, + "is_active": { + "title": "Is Active", + "type": "boolean" + }, + "is_superuser": { + "title": "Is Superuser", + "type": "boolean" + }, + "keycloak_id": { + "format": "uuid", + "title": "Keycloak Id", + "type": "string" + }, + "last_login_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Last Login At" + }, + "role": { + "title": "Role", + "type": "string" + }, + "updated_at": { + "format": "date-time", + "title": "Updated At", + "type": "string" + }, + "username": { + "title": "Username", + "type": "string" + } + }, + "required": [ + "id", + "keycloak_id", + "username", + "email", + "role", + "is_active", + "is_superuser", + "created_at", + "updated_at" + ], + "title": "MetadataUserResponse", + "type": "object" + }, + "MetadataUserSyncRequest": { + "properties": { + "email": { + "maxLength": 100, + "minLength": 1, + "title": "Email", + "type": "string" + }, + "is_active": { + "default": true, + "title": "Is Active", + "type": "boolean" + }, + "keycloak_id": { + "format": "uuid", + "title": "Keycloak Id", + "type": "string" + }, + "role": { + "default": "user", + "enum": [ + "admin", + "user" + ], + "title": "Role", + "type": "string" + }, + "username": { + "maxLength": 50, + "minLength": 1, + "title": "Username", + "type": "string" + } + }, + "required": [ + "keycloak_id", + "username", + "email" + ], + "title": "MetadataUserSyncRequest", + "type": "object" + }, + "MetadataUserSyncResult": { + "properties": { + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error" + }, + "keycloak_id": { + "format": "uuid", + "title": "Keycloak Id", + "type": "string" + }, + "success": { + "title": "Success", + "type": "boolean" + }, + "user": { + "anyOf": [ + { + "$ref": "#/components/schemas/MetadataUserResponse" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "keycloak_id", + "success" + ], + "title": "MetadataUserSyncResult", + "type": "object" + }, + "MetadataUserUpdateRequest": { + "properties": { + "is_active": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Is Active" + }, + "role": { + "anyOf": [ + { + "enum": [ + "admin", + "user" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Role" + } + }, + "title": "MetadataUserUpdateRequest", + "type": "object" + }, + "MetadataUsersBatchSyncRequest": { + "properties": { + "users": { + "items": { + "$ref": "#/components/schemas/MetadataUserSyncRequest" + }, + "maxItems": 500, + "minItems": 1, + "title": "Users", + "type": "array" + } + }, + "required": [ + "users" + ], + "title": "MetadataUsersBatchSyncRequest", + "type": "object" + }, + "Page_AdminProjectResponse_": { + "properties": { + "items": { + "items": { + "$ref": "#/components/schemas/AdminProjectResponse" + }, + "title": "Items", + "type": "array" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "offset": { + "title": "Offset", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "items", + "total", + "limit", + "offset" + ], + "title": "Page[AdminProjectResponse]", + "type": "object" + }, + "Page_AuditLogResponse_": { + "properties": { + "items": { + "items": { + "$ref": "#/components/schemas/AuditLogResponse" + }, + "title": "Items", + "type": "array" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "offset": { + "title": "Offset", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "items", + "total", + "limit", + "offset" + ], + "title": "Page[AuditLogResponse]", + "type": "object" + }, + "Page_MetadataUserResponse_": { + "properties": { + "items": { + "items": { + "$ref": "#/components/schemas/MetadataUserResponse" + }, + "title": "Items", + "type": "array" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "offset": { + "title": "Offset", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "items", + "total", + "limit", + "offset" + ], + "title": "Page[MetadataUserResponse]", + "type": "object" + }, + "Page_MetadataUserSyncResult_": { + "properties": { + "items": { + "items": { + "$ref": "#/components/schemas/MetadataUserSyncResult" + }, + "title": "Items", + "type": "array" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "offset": { + "title": "Offset", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "items", + "total", + "limit", + "offset" + ], + "title": "Page[MetadataUserSyncResult]", + "type": "object" + }, + "Page_ProjectDatabaseResponse_": { + "properties": { + "items": { + "items": { + "$ref": "#/components/schemas/ProjectDatabaseResponse" + }, + "title": "Items", + "type": "array" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "offset": { + "title": "Offset", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "items", + "total", + "limit", + "offset" + ], + "title": "Page[ProjectDatabaseResponse]", + "type": "object" + }, + "Page_ProjectMemberResponse_": { + "properties": { + "items": { + "items": { + "$ref": "#/components/schemas/ProjectMemberResponse" + }, + "title": "Items", + "type": "array" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "offset": { + "title": "Offset", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "items", + "total", + "limit", + "offset" + ], + "title": "Page[ProjectMemberResponse]", + "type": "object" + }, + "Page_ProjectSummaryResponse_": { + "properties": { + "items": { + "items": { + "$ref": "#/components/schemas/ProjectSummaryResponse" + }, + "title": "Items", + "type": "array" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "offset": { + "title": "Offset", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "items", + "total", + "limit", + "offset" + ], + "title": "Page[ProjectSummaryResponse]", + "type": "object" + }, + "Page_dict_Any__Any__": { + "properties": { + "items": { + "items": { + "type": "object" + }, + "title": "Items", + "type": "array" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "offset": { + "title": "Offset", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "items", + "total", + "limit", + "offset" + ], + "title": "Page[dict[Any, Any]]", + "type": "object" + }, + "Page_dict_str__Any__": { + "properties": { + "items": { + "items": { + "type": "object" + }, + "title": "Items", + "type": "array" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "offset": { + "title": "Offset", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "items", + "total", + "limit", + "offset" + ], + "title": "Page[dict[str, Any]]", + "type": "object" + }, + "Page_dict_str__list_str___": { + "properties": { + "items": { + "items": { + "additionalProperties": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": "object" + }, + "title": "Items", + "type": "array" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "offset": { + "title": "Offset", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "items", + "total", + "limit", + "offset" + ], + "title": "Page[dict[str, list[str]]]", + "type": "object" + }, + "Page_list_str__": { + "properties": { + "items": { + "items": { + "items": { + "type": "string" + }, + "type": "array" + }, + "title": "Items", + "type": "array" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "offset": { + "title": "Offset", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "items", + "total", + "limit", + "offset" + ], + "title": "Page[list[str]]", + "type": "object" + }, + "Page_str_": { + "properties": { + "items": { + "items": { + "type": "string" + }, + "title": "Items", + "type": "array" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "offset": { + "title": "Offset", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "items", + "total", + "limit", + "offset" + ], + "title": "Page[str]", + "type": "object" + }, + "Page_tuple_int__str__": { + "properties": { + "items": { + "items": { + "maxItems": 2, + "minItems": 2, + "prefixItems": [ + { + "type": "integer" + }, + { + "type": "string" + } + ], + "type": "array" + }, + "title": "Items", + "type": "array" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "offset": { + "title": "Offset", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "items", + "total", + "limit", + "offset" + ], + "title": "Page[tuple[int, str]]", + "type": "object" + }, + "PressureRegulationRest": { + "properties": { + "duration": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 900, + "description": "持续时间 (秒)", + "title": "Duration" + }, + "pump_control": { + "description": "泵控制策略", + "title": "Pump Control", + "type": "object" + }, + "scheme_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "方案名称", + "title": "Scheme Name" + }, + "start_time": { + "description": "开始时间", + "title": "Start Time", + "type": "string" + }, + "tank_init_level": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "description": "水箱初始水位", + "title": "Tank Init Level" + } + }, + "required": [ + "start_time", + "pump_control" + ], + "title": "PressureRegulationRest", + "type": "object" + }, + "PressureSensorPlacement": { + "properties": { + "min_diameter": { + "default": 0, + "description": "最小管径限制", + "title": "Min Diameter", + "type": "integer" + }, + "name": { + "description": "管网名称(或数据库名称)", + "title": "Name", + "type": "string" + }, + "scheme_name": { + "description": "方案名称", + "title": "Scheme Name", + "type": "string" + }, + "sensor_number": { + "description": "传感器数量", + "title": "Sensor Number", + "type": "integer" + }, + "username": { + "description": "用户名", + "title": "Username", + "type": "string" + } + }, + "required": [ + "name", + "scheme_name", + "sensor_number", + "username" + ], + "title": "PressureSensorPlacement", + "type": "object" + }, + "ProblemDetails": { + "description": "RFC 9457 compatible error response used by the REST contract.", + "properties": { + "code": { + "title": "Code", + "type": "string" + }, + "detail": { + "title": "Detail", + "type": "string" + }, + "errors": { + "items": { + "type": "object" + }, + "title": "Errors", + "type": "array" + }, + "instance": { + "title": "Instance", + "type": "string" + }, + "status": { + "title": "Status", + "type": "integer" + }, + "title": { + "title": "Title", + "type": "string" + }, + "trace_id": { + "title": "Trace Id", + "type": "string" + }, + "type": { + "title": "Type", + "type": "string" + } + }, + "required": [ + "type", + "title", + "status", + "detail", + "instance", + "code", + "trace_id" + ], + "title": "ProblemDetails", + "type": "object" + }, + "ProjectDatabaseHealthRequest": { + "properties": { + "dsn": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Dsn" + } + }, + "title": "ProjectDatabaseHealthRequest", + "type": "object" + }, + "ProjectDatabaseHealthResponse": { + "properties": { + "db_role": { + "title": "Db Role", + "type": "string" + }, + "db_type": { + "title": "Db Type", + "type": "string" + }, + "detail": { + "title": "Detail", + "type": "string" + }, + "ok": { + "title": "Ok", + "type": "boolean" + }, + "project_id": { + "format": "uuid", + "title": "Project Id", + "type": "string" + } + }, + "required": [ + "project_id", + "db_role", + "db_type", + "ok", + "detail" + ], + "title": "ProjectDatabaseHealthResponse", + "type": "object" + }, + "ProjectDatabaseResponse": { + "properties": { + "db_role": { + "title": "Db Role", + "type": "string" + }, + "db_type": { + "title": "Db Type", + "type": "string" + }, + "has_dsn": { + "title": "Has Dsn", + "type": "boolean" + }, + "id": { + "format": "uuid", + "title": "Id", + "type": "string" + }, + "pool_max_size": { + "title": "Pool Max Size", + "type": "integer" + }, + "pool_min_size": { + "title": "Pool Min Size", + "type": "integer" + }, + "project_id": { + "format": "uuid", + "title": "Project Id", + "type": "string" + } + }, + "required": [ + "id", + "project_id", + "db_role", + "db_type", + "pool_min_size", + "pool_max_size", + "has_dsn" + ], + "title": "ProjectDatabaseResponse", + "type": "object" + }, + "ProjectDatabaseUpsertRequest": { + "properties": { + "db_role": { + "enum": [ + "biz_data", + "iot_data" + ], + "title": "Db Role", + "type": "string" + }, + "dsn": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Dsn" + }, + "pool_max_size": { + "default": 10, + "minimum": 1.0, + "title": "Pool Max Size", + "type": "integer" + }, + "pool_min_size": { + "default": 2, + "minimum": 1.0, + "title": "Pool Min Size", + "type": "integer" + } + }, + "required": [ + "db_role" + ], + "title": "ProjectDatabaseUpsertRequest", + "type": "object" + }, + "ProjectManagementRest": { + "properties": { + "pump_control": { + "description": "泵控制策略", + "title": "Pump Control", + "type": "object" + }, + "region_demand": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "description": "区域需水量控制", + "title": "Region Demand" + }, + "start_time": { + "description": "开始时间", + "title": "Start Time", + "type": "string" + }, + "tank_init_level": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "description": "水箱初始水位", + "title": "Tank Init Level" + } + }, + "required": [ + "start_time", + "pump_control" + ], + "title": "ProjectManagementRest", + "type": "object" + }, + "ProjectMemberCreateRequest": { + "properties": { + "project_role": { + "default": "viewer", + "enum": [ + "member", + "viewer" + ], + "title": "Project Role", + "type": "string" + }, + "user_id": { + "format": "uuid", + "title": "User Id", + "type": "string" + } + }, + "required": [ + "user_id" + ], + "title": "ProjectMemberCreateRequest", + "type": "object" + }, + "ProjectMemberResponse": { + "properties": { + "email": { + "title": "Email", + "type": "string" + }, + "id": { + "format": "uuid", + "title": "Id", + "type": "string" + }, + "is_active": { + "title": "Is Active", + "type": "boolean" + }, + "project_id": { + "format": "uuid", + "title": "Project Id", + "type": "string" + }, + "project_role": { + "title": "Project Role", + "type": "string" + }, + "user_id": { + "format": "uuid", + "title": "User Id", + "type": "string" + }, + "username": { + "title": "Username", + "type": "string" + } + }, + "required": [ + "id", + "user_id", + "project_id", + "project_role", + "username", + "email", + "is_active" + ], + "title": "ProjectMemberResponse", + "type": "object" + }, + "ProjectMemberUpdateRequest": { + "properties": { + "project_role": { + "enum": [ + "member", + "viewer" + ], + "title": "Project Role", + "type": "string" + } + }, + "required": [ + "project_role" + ], + "title": "ProjectMemberUpdateRequest", + "type": "object" + }, + "ProjectMetaResponse": { + "properties": { + "code": { + "title": "Code", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "gs_workspace": { + "title": "Gs Workspace", + "type": "string" + }, + "map_extent": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Map Extent" + }, + "name": { + "title": "Name", + "type": "string" + }, + "project_id": { + "format": "uuid", + "title": "Project Id", + "type": "string" + }, + "project_role": { + "title": "Project Role", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "required": [ + "project_id", + "name", + "code", + "gs_workspace", + "status", + "project_role" + ], + "title": "ProjectMetaResponse", + "type": "object" + }, + "ProjectSummaryResponse": { + "properties": { + "code": { + "title": "Code", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "gs_workspace": { + "title": "Gs Workspace", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "project_id": { + "format": "uuid", + "title": "Project Id", + "type": "string" + }, + "project_role": { + "title": "Project Role", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "required": [ + "project_id", + "name", + "code", + "gs_workspace", + "status", + "project_role" + ], + "title": "ProjectSummaryResponse", + "type": "object" + }, + "PumpFailureState": { + "properties": { + "pump_status": { + "description": "泵状态字典", + "title": "Pump Status", + "type": "object" + }, + "time": { + "description": "故障发生时间", + "title": "Time", + "type": "string" + } + }, + "required": [ + "time", + "pump_status" + ], + "title": "PumpFailureState", + "type": "object" + }, + "RunSimulationManuallyByDateRest": { + "properties": { + "duration": { + "description": "持续时间 (分钟)", + "exclusiveMinimum": 0.0, + "title": "Duration", + "type": "integer" + }, + "start_time": { + "description": "开始时间 (ISO 8601 / RFC3339,必须显式带时区)", + "title": "Start Time", + "type": "string" + } + }, + "required": [ + "start_time", + "duration" + ], + "title": "RunSimulationManuallyByDateRest", + "type": "object" + }, + "SchedulingAnalysisRest": { + "properties": { + "pump_control": { + "description": "泵控制策略", + "title": "Pump Control", + "type": "object" + }, + "start_time": { + "description": "开始时间", + "title": "Start Time", + "type": "string" + }, + "tank_id": { + "description": "水箱ID", + "title": "Tank Id", + "type": "string" + }, + "time_delta": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 300, + "description": "时间步长 (秒)", + "title": "Time Delta" + }, + "water_plant_output_id": { + "description": "水厂出水ID", + "title": "Water Plant Output Id", + "type": "string" + } + }, + "required": [ + "start_time", + "pump_control", + "tank_id", + "water_plant_output_id" + ], + "title": "SchedulingAnalysisRest", + "type": "object" + }, + "SensorPlacementExportRequest": { + "properties": { + "adjustment_status": { + "additionalProperties": { + "enum": [ + "current", + "original", + "added", + "replaced" + ], + "type": "string" + }, + "maxProperties": 200, + "title": "Adjustment Status", + "type": "object" + }, + "sensor_location": { + "items": { + "type": "string" + }, + "maxItems": 200, + "minItems": 1, + "title": "Sensor Location", + "type": "array" + } + }, + "required": [ + "sensor_location" + ], + "title": "SensorPlacementExportRequest", + "type": "object" + }, + "SensorPlacementOptimizeRequestRest": { + "properties": { + "method": { + "enum": [ + "sensitivity", + "kmeans" + ], + "title": "Method", + "type": "string" + }, + "min_diameter": { + "default": 0, + "minimum": 0.0, + "title": "Min Diameter", + "type": "integer" + }, + "scheme_name": { + "maxLength": 32, + "minLength": 1, + "title": "Scheme Name", + "type": "string" + }, + "sensor_count": { + "exclusiveMinimum": 0.0, + "maximum": 200.0, + "title": "Sensor Count", + "type": "integer" + }, + "sensor_type": { + "const": "pressure", + "title": "Sensor Type", + "type": "string" + } + }, + "required": [ + "scheme_name", + "sensor_type", + "method", + "sensor_count" + ], + "title": "SensorPlacementOptimizeRequestRest", + "type": "object" + }, + "SensorPlacementSchemeResponse": { + "properties": { + "can_edit": { + "default": false, + "title": "Can Edit", + "type": "boolean" + }, + "create_time": { + "format": "date-time", + "title": "Create Time", + "type": "string" + }, + "id": { + "title": "Id", + "type": "integer" + }, + "min_diameter": { + "title": "Min Diameter", + "type": "integer" + }, + "scheme_name": { + "title": "Scheme Name", + "type": "string" + }, + "sensor_location": { + "items": { + "type": "string" + }, + "title": "Sensor Location", + "type": "array" + }, + "sensor_number": { + "title": "Sensor Number", + "type": "integer" + }, + "sensor_points": { + "items": { + "$ref": "#/components/schemas/SensorPointResponse" + }, + "title": "Sensor Points", + "type": "array" + }, + "username": { + "title": "Username", + "type": "string" + } + }, + "required": [ + "id", + "scheme_name", + "sensor_number", + "min_diameter", + "username", + "create_time", + "sensor_location", + "sensor_points" + ], + "title": "SensorPlacementSchemeResponse", + "type": "object" + }, + "SensorPlacementUpdateRequest": { + "properties": { + "expected_sensor_location": { + "items": { + "type": "string" + }, + "maxItems": 200, + "minItems": 1, + "title": "Expected Sensor Location", + "type": "array" + }, + "sensor_location": { + "items": { + "type": "string" + }, + "maxItems": 200, + "minItems": 1, + "title": "Sensor Location", + "type": "array" + } + }, + "required": [ + "expected_sensor_location", + "sensor_location" + ], + "title": "SensorPlacementUpdateRequest", + "type": "object" + }, + "SensorPointResponse": { + "properties": { + "elevation": { + "title": "Elevation", + "type": "number" + }, + "latitude": { + "title": "Latitude", + "type": "number" + }, + "longitude": { + "title": "Longitude", + "type": "number" + }, + "map_x": { + "title": "Map X", + "type": "number" + }, + "map_y": { + "title": "Map Y", + "type": "number" + }, + "node_id": { + "title": "Node Id", + "type": "string" + }, + "project_x": { + "title": "Project X", + "type": "number" + }, + "project_y": { + "title": "Project Y", + "type": "number" + } + }, + "required": [ + "node_id", + "project_x", + "project_y", + "map_x", + "map_y", + "longitude", + "latitude", + "elevation" + ], + "title": "SensorPointResponse", + "type": "object" + }, + "SessionAuditEventRequest": { + "properties": { + "event": { + "enum": [ + "login", + "logout" + ], + "title": "Event", + "type": "string" + } + }, + "required": [ + "event" + ], + "title": "SessionAuditEventRequest", + "type": "object" + }, + "TiandituGeocodeRequest": { + "properties": { + "keyword": { + "description": "地理编码地址关键字", + "minLength": 1, + "title": "Keyword", + "type": "string" + } + }, + "required": [ + "keyword" + ], + "title": "TiandituGeocodeRequest", + "type": "object" + }, + "WebSearchRequest": { + "properties": { + "count": { + "default": 10, + "description": "返回结果数量", + "maximum": 50.0, + "minimum": 1.0, + "title": "Count", + "type": "integer" + }, + "exclude": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "排除搜索域名", + "title": "Exclude" + }, + "freshness": { + "anyOf": [ + { + "enum": [ + "noLimit", + "oneDay", + "oneWeek", + "oneMonth", + "oneYear" + ], + "type": "string" + }, + { + "type": "string" + } + ], + "default": "noLimit", + "description": "时间范围:noLimit、oneDay、oneWeek、oneMonth、oneYear 或日期范围", + "title": "Freshness" + }, + "include": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "限定搜索域名", + "title": "Include" + }, + "query": { + "description": "搜索关键词", + "minLength": 1, + "title": "Query", + "type": "string" + }, + "summary": { + "default": true, + "description": "是否返回网页摘要", + "title": "Summary", + "type": "boolean" + } + }, + "required": [ + "query" + ], + "title": "WebSearchRequest", + "type": "object" + } + }, + "securitySchemes": { + "OAuth2PasswordBearer": { + "flows": { + "password": { + "scopes": {}, + "tokenUrl": "keycloak" + } + }, + "type": "oauth2" + } + } + }, + "info": { + "description": "TJWater Server - 供水管网智能管理系统", + "title": "TJWater Server", + "version": "1.0.0" + }, + "openapi": "3.1.0", + "paths": { + "/api/v1/access-context": { + "get": { + "operationId": "get_access_context", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "X-Project-Id" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccessContextResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Get Access Context", + "tags": [ + "Access Control" + ] + } + }, + "/api/v1/admin/projects": { + "get": { + "operationId": "get_admin_projects", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_AdminProjectResponse_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "List Admin Projects", + "tags": [ + "Metadata Admin" + ] + }, + "post": { + "operationId": "post_admin_projects", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProjectCreateRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProjectResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Create Admin Project", + "tags": [ + "Metadata Admin" + ] + } + }, + "/api/v1/admin/projects/{project_id}": { + "patch": { + "operationId": "patch_admin_projects_project_id", + "parameters": [ + { + "in": "path", + "name": "project_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Project Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProjectUpdateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProjectResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Update Admin Project", + "tags": [ + "Metadata Admin" + ] + } + }, + "/api/v1/admin/projects/{project_id}/databases": { + "get": { + "operationId": "get_admin_projects_project_id_databases", + "parameters": [ + { + "in": "path", + "name": "project_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Project Id", + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_ProjectDatabaseResponse_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "List Project Databases", + "tags": [ + "Metadata Admin" + ] + }, + "put": { + "operationId": "put_admin_projects_project_id_databases", + "parameters": [ + { + "in": "path", + "name": "project_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Project Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectDatabaseUpsertRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectDatabaseResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Upsert Project Database", + "tags": [ + "Metadata Admin" + ] + } + }, + "/api/v1/admin/projects/{project_id}/databases/{db_role}": { + "delete": { + "operationId": "delete_admin_projects_project_id_databases_db_role", + "parameters": [ + { + "in": "path", + "name": "project_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Project Id", + "type": "string" + } + }, + { + "in": "path", + "name": "db_role", + "required": true, + "schema": { + "enum": [ + "biz_data", + "iot_data" + ], + "title": "Db Role", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Delete Project Database", + "tags": [ + "Metadata Admin" + ] + } + }, + "/api/v1/admin/projects/{project_id}/databases/{db_role}/health-checks": { + "post": { + "operationId": "post_admin_projects_project_id_databases_db_role_health_checks", + "parameters": [ + { + "in": "path", + "name": "project_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Project Id", + "type": "string" + } + }, + { + "in": "path", + "name": "db_role", + "required": true, + "schema": { + "enum": [ + "biz_data", + "iot_data" + ], + "title": "Db Role", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProjectDatabaseHealthRequest" + }, + { + "type": "null" + } + ], + "title": "Payload" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectDatabaseHealthResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Check Project Database Health", + "tags": [ + "Metadata Admin" + ] + } + }, + "/api/v1/admin/projects/{project_id}/members": { + "get": { + "operationId": "get_admin_projects_project_id_members", + "parameters": [ + { + "in": "path", + "name": "project_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Project Id", + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_ProjectMemberResponse_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "List Project Members", + "tags": [ + "Metadata Admin" + ] + }, + "post": { + "operationId": "post_admin_projects_project_id_members", + "parameters": [ + { + "in": "path", + "name": "project_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Project Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectMemberCreateRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectMemberResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Add Project Member", + "tags": [ + "Metadata Admin" + ] + } + }, + "/api/v1/admin/projects/{project_id}/members/{user_id}": { + "delete": { + "operationId": "delete_admin_projects_project_id_members_user_id", + "parameters": [ + { + "in": "path", + "name": "project_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Project Id", + "type": "string" + } + }, + { + "in": "path", + "name": "user_id", + "required": true, + "schema": { + "format": "uuid", + "title": "User Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Remove Project Member", + "tags": [ + "Metadata Admin" + ] + }, + "patch": { + "operationId": "patch_admin_projects_project_id_members_user_id", + "parameters": [ + { + "in": "path", + "name": "project_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Project Id", + "type": "string" + } + }, + { + "in": "path", + "name": "user_id", + "required": true, + "schema": { + "format": "uuid", + "title": "User Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectMemberUpdateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectMemberResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Update Project Member", + "tags": [ + "Metadata Admin" + ] + } + }, + "/api/v1/admin/projects/{project_id}/model-imports": { + "patch": { + "operationId": "patch_admin_projects_project_id_model_imports", + "parameters": [ + { + "in": "path", + "name": "project_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Project Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_patch_admin_projects_project_id_model_imports" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Patch Admin Projects Project Id Model Imports", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "更新桌面端水力模型", + "tags": [ + "Model Administration" + ] + }, + "post": { + "operationId": "post_admin_projects_project_id_model_imports", + "parameters": [ + { + "in": "path", + "name": "project_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Project Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_post_admin_projects_project_id_model_imports" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Admin Projects Project Id Model Imports", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "导入桌面端水力模型", + "tags": [ + "Model Administration" + ] + } + }, + "/api/v1/admin/user-syncs": { + "post": { + "operationId": "post_admin_user_syncs", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataUserSyncRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataUserResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Sync Metadata User", + "tags": [ + "Metadata Admin" + ] + } + }, + "/api/v1/admin/user-syncs/batches": { + "post": { + "operationId": "post_admin_user_syncs_batches", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataUsersBatchSyncRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_MetadataUserSyncResult_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Sync Metadata Users Batch", + "tags": [ + "Metadata Admin" + ] + } + }, + "/api/v1/admin/users": { + "get": { + "operationId": "get_admin_users", + "parameters": [ + { + "in": "query", + "name": "skip", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Skip", + "type": "integer" + } + }, + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_MetadataUserResponse_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "List Metadata Users", + "tags": [ + "Metadata Admin" + ] + } + }, + "/api/v1/admin/users/me": { + "get": { + "operationId": "get_admin_users_me", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataUserResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Get Metadata Admin Me", + "tags": [ + "Metadata Admin" + ] + } + }, + "/api/v1/admin/users/{user_id}": { + "get": { + "operationId": "get_admin_users_user_id", + "parameters": [ + { + "in": "path", + "name": "user_id", + "required": true, + "schema": { + "format": "uuid", + "title": "User Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataUserResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Get Metadata User", + "tags": [ + "Metadata Admin" + ] + }, + "patch": { + "operationId": "patch_admin_users_user_id", + "parameters": [ + { + "in": "path", + "name": "user_id", + "required": true, + "schema": { + "format": "uuid", + "title": "User Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataUserUpdateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataUserResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Update Metadata User", + "tags": [ + "Metadata Admin" + ] + } + }, + "/api/v1/agent-auth-context": { + "get": { + "operationId": "get_agent_auth_context", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentAuthContextResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Get Agent Auth Context", + "tags": [ + "Agent Auth" + ] + } + }, + "/api/v1/all-extension-data-keys": { + "get": { + "description": "获取指定网络的所有扩展数据的键列表", + "operationId": "get_all_extension_data_keys", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_str_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有扩展数据键", + "tags": [ + "Extension" + ] + } + }, + "/api/v1/all-extension-datas": { + "get": { + "description": "获取指定网络的所有扩展数据", + "operationId": "get_all_extension_datas", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get All Extension Datas", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有扩展数据", + "tags": [ + "Extension" + ] + } + }, + "/api/v1/all-redis": { + "delete": { + "description": "清空整个Redis数据库的所有缓存", + "operationId": "delete_all_redis", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "清除所有缓存", + "tags": [ + "Cache" + ] + } + }, + "/api/v1/all-scada-properties": { + "get": { + "description": "获取指定水网中所有SCADA点的属性信息", + "operationId": "get_all_scada_properties", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有SCADA点属性", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/all-vertices": { + "get": { + "description": "获取网络中的所有图形元素详细信息", + "operationId": "get_all_vertices", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有图形元素", + "tags": [ + "Visuals" + ] + } + }, + "/api/v1/audit-events": { + "post": { + "operationId": "post_audit_events", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionAuditEventRequest" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Record Session Event", + "tags": [ + "Audit Logs" + ] + } + }, + "/api/v1/audit-logs": { + "get": { + "description": "查询审计日志(仅管理员)", + "operationId": "get_audit_logs", + "parameters": [ + { + "description": "按用户ID过滤", + "in": "query", + "name": "user_id", + "required": false, + "schema": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "按用户ID过滤", + "title": "User Id" + } + }, + { + "description": "按项目ID过滤", + "in": "query", + "name": "project_id", + "required": false, + "schema": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "按项目ID过滤", + "title": "Project Id" + } + }, + { + "description": "按操作类型过滤", + "in": "query", + "name": "action", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "按操作类型过滤", + "title": "Action" + } + }, + { + "description": "按资源类型过滤", + "in": "query", + "name": "resource_type", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "按资源类型过滤", + "title": "Resource Type" + } + }, + { + "description": "开始时间", + "in": "query", + "name": "start_time", + "required": false, + "schema": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "开始时间", + "title": "Start Time" + } + }, + { + "description": "结束时间", + "in": "query", + "name": "end_time", + "required": false, + "schema": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "结束时间", + "title": "End Time" + } + }, + { + "description": "跳过记录数", + "in": "query", + "name": "skip", + "required": false, + "schema": { + "default": 0, + "description": "跳过记录数", + "minimum": 0, + "title": "Skip", + "type": "integer" + } + }, + { + "description": "限制记录数", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "description": "限制记录数", + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_AuditLogResponse_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "查询审计日志", + "tags": [ + "Audit Logs" + ] + } + }, + "/api/v1/audit-logs/count": { + "get": { + "description": "获取审计日志总数(仅管理员)", + "operationId": "get_audit_logs_count", + "parameters": [ + { + "description": "按用户ID过滤", + "in": "query", + "name": "user_id", + "required": false, + "schema": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "按用户ID过滤", + "title": "User Id" + } + }, + { + "description": "按项目ID过滤", + "in": "query", + "name": "project_id", + "required": false, + "schema": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "按项目ID过滤", + "title": "Project Id" + } + }, + { + "description": "按操作类型过滤", + "in": "query", + "name": "action", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "按操作类型过滤", + "title": "Action" + } + }, + { + "description": "按资源类型过滤", + "in": "query", + "name": "resource_type", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "按资源类型过滤", + "title": "Resource Type" + } + }, + { + "description": "开始时间", + "in": "query", + "name": "start_time", + "required": false, + "schema": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "开始时间", + "title": "Start Time" + } + }, + { + "description": "结束时间", + "in": "query", + "name": "end_time", + "required": false, + "schema": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "结束时间", + "title": "End Time" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Audit Logs Count", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取审计日志总数", + "tags": [ + "Audit Logs" + ] + } + }, + "/api/v1/audit-logs/mine": { + "get": { + "description": "查询当前用户的审计日志", + "operationId": "get_audit_logs_mine", + "parameters": [ + { + "description": "按操作类型过滤", + "in": "query", + "name": "action", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "按操作类型过滤", + "title": "Action" + } + }, + { + "description": "开始时间", + "in": "query", + "name": "start_time", + "required": false, + "schema": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "开始时间", + "title": "Start Time" + } + }, + { + "description": "结束时间", + "in": "query", + "name": "end_time", + "required": false, + "schema": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "结束时间", + "title": "End Time" + } + }, + { + "description": "跳过记录数", + "in": "query", + "name": "skip", + "required": false, + "schema": { + "default": 0, + "description": "跳过记录数", + "minimum": 0, + "title": "Skip", + "type": "integer" + } + }, + { + "description": "限制记录数", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "description": "限制记录数", + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_AuditLogResponse_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "查询我的审计日志", + "tags": [ + "Audit Logs" + ] + } + }, + "/api/v1/backdrops/properties": { + "get": { + "description": "获取指定网络的背景属性信息", + "operationId": "get_backdrops_properties", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Backdrops Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取背景属性", + "tags": [ + "Visuals" + ] + }, + "patch": { + "description": "更新指定网络的背景属性", + "operationId": "patch_backdrops_properties", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置背景属性", + "tags": [ + "Visuals" + ] + } + }, + "/api/v1/burst-analyses": { + "post": { + "description": "高级版本的爆管分析,支持在指定时间点修改泵控制模式和阀门开度,以分析这些改变对爆管影响的作用。支持固定泵和变速泵的独立控制。", + "operationId": "post_burst_analyses", + "parameters": [ + { + "description": "模式修改开始时间(ISO 8601格式)", + "in": "query", + "name": "modify_pattern_start_time", + "required": true, + "schema": { + "description": "模式修改开始时间(ISO 8601格式)", + "title": "Modify Pattern Start Time", + "type": "string" + } + }, + { + "description": "爆管节点/管段ID列表", + "in": "query", + "name": "burst_id", + "required": true, + "schema": { + "description": "爆管节点/管段ID列表", + "items": { + "type": "string" + }, + "title": "Burst Id", + "type": "array" + } + }, + { + "description": "对应各爆管点的爆管流量大小列表(L/s)", + "in": "query", + "name": "burst_size", + "required": true, + "schema": { + "description": "对应各爆管点的爆管流量大小列表(L/s)", + "items": { + "type": "number" + }, + "title": "Burst Size", + "type": "array" + } + }, + { + "description": "模拟总时长(秒)", + "in": "query", + "name": "modify_total_duration", + "required": true, + "schema": { + "description": "模拟总时长(秒)", + "title": "Modify Total Duration", + "type": "integer" + } + }, + { + "description": "分析方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "分析方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Burst Analyses", + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "爆管分析(高级)", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/burst-detections": { + "post": { + "description": "基于压力观测数据和其他参数执行爆管检测分析", + "operationId": "post_burst_detections", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BurstDetectionRequestRest", + "description": "爆管检测请求数据" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Burst Detections", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "执行爆管检测", + "tags": [ + "Burst Detection" + ] + } + }, + "/api/v1/burst-locations": { + "get": { + "description": "获取网络中所有爆管定位的分析结果", + "operationId": "get_burst_locations", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_Any__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有爆管定位结果", + "tags": [ + "Misc" + ] + }, + "post": { + "description": "基于压力和流量数据定位管网中的爆管位置", + "operationId": "post_burst_locations", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BurstLocationRequestRest", + "description": "爆管定位请求数据" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Burst Locations", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "执行爆管定位", + "tags": [ + "Burst Location" + ] + } + }, + "/api/v1/burst-locations/database-view": { + "get": { + "description": "使用连接池查询所有爆管定位结果", + "operationId": "get_burst_locations_database_view", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取爆管定位结果", + "tags": [ + "Project Data" + ] + } + }, + "/api/v1/burst-locations/{burst_incident}": { + "get": { + "description": "根据爆管事件ID查询对应的爆管定位结果", + "operationId": "get_burst_locations_burst_incident", + "parameters": [ + { + "description": "爆管事件ID", + "in": "path", + "name": "burst_incident", + "required": true, + "schema": { + "description": "爆管事件ID", + "title": "Burst Incident", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "按事件查询爆管定位结果", + "tags": [ + "Project Data" + ] + } + }, + "/api/v1/contaminant-simulations": { + "post": { + "description": "对管网中的污染物扩散进行模拟,评估污染源对管网的影响范围和浓度分布。支持指定污染源位置、污染浓度和扩散模式。", + "operationId": "post_contaminant_simulations", + "parameters": [ + { + "description": "污染开始时间(ISO 8601格式)", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "污染开始时间(ISO 8601格式)", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "污染源节点ID", + "in": "query", + "name": "source", + "required": true, + "schema": { + "description": "污染源节点ID", + "title": "Source", + "type": "string" + } + }, + { + "description": "污染浓度(mg/L)", + "in": "query", + "name": "concentration", + "required": true, + "schema": { + "description": "污染浓度(mg/L)", + "title": "Concentration", + "type": "number" + } + }, + { + "description": "模拟持续时间(秒)", + "in": "query", + "name": "duration", + "required": true, + "schema": { + "description": "模拟持续时间(秒)", + "title": "Duration", + "type": "integer" + } + }, + { + "description": "模拟方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "模拟方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "description": "污染源模式ID(可选)", + "in": "query", + "name": "pattern", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "污染源模式ID(可选)", + "title": "Pattern" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "污染物模拟", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/controls/properties": { + "get": { + "description": "获取指定网络中的控制属性信息", + "operationId": "get_controls_properties", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Controls Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取控制属性", + "tags": [ + "Controls & Rules" + ] + }, + "patch": { + "description": "更新指定网络中的控制属性", + "operationId": "patch_controls_properties", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置控制属性", + "tags": [ + "Controls & Rules" + ] + } + }, + "/api/v1/current-operation-ids": { + "get": { + "description": "获取网络当前的操作ID", + "operationId": "get_current_operation_ids", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Current Operation Ids", + "type": "integer" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取当前操作ID", + "tags": [ + "Snapshots" + ] + } + }, + "/api/v1/curves": { + "delete": { + "description": "从网络中删除指定的曲线", + "operationId": "delete_curves", + "parameters": [ + { + "description": "曲线ID", + "in": "query", + "name": "curve", + "required": true, + "schema": { + "description": "曲线ID", + "title": "Curve", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除曲线", + "tags": [ + "Curves" + ] + }, + "get": { + "description": "获取网络中的所有曲线列表", + "operationId": "get_curves", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_str_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有曲线", + "tags": [ + "Curves" + ] + }, + "post": { + "description": "在网络中添加一条新的曲线", + "operationId": "post_curves", + "parameters": [ + { + "description": "曲线ID", + "in": "query", + "name": "curve", + "required": true, + "schema": { + "description": "曲线ID", + "title": "Curve", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加曲线", + "tags": [ + "Curves" + ] + } + }, + "/api/v1/curves/existence": { + "get": { + "description": "检查指定的曲线是否存在", + "operationId": "get_curves_existence", + "parameters": [ + { + "description": "曲线ID", + "in": "query", + "name": "curve", + "required": true, + "schema": { + "description": "曲线ID", + "title": "Curve", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Curves Existence", + "type": "boolean" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查曲线存在性", + "tags": [ + "Curves" + ] + } + }, + "/api/v1/curves/properties": { + "get": { + "description": "获取指定曲线的属性信息", + "operationId": "get_curves_properties", + "parameters": [ + { + "description": "曲线ID", + "in": "query", + "name": "curve", + "required": true, + "schema": { + "description": "曲线ID", + "title": "Curve", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Curves Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取曲线属性", + "tags": [ + "Curves" + ] + }, + "patch": { + "description": "更新指定曲线的属性", + "operationId": "patch_curves_properties", + "parameters": [ + { + "description": "曲线ID", + "in": "query", + "name": "curve", + "required": true, + "schema": { + "description": "曲线ID", + "title": "Curve", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置曲线属性", + "tags": [ + "Curves" + ] + } + }, + "/api/v1/daily-scheduling-analyses": { + "post": { + "description": "对管网的每日供水排程进行分析,优化水库、水厂、水箱和用户需求的协调,制定合理的每日排程方案。", + "operationId": "post_daily_scheduling_analyses", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DailySchedulingAnalysisRest", + "description": "日排程分析参数" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Daily Scheduling Analyses", + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "日排程分析", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/demands/properties": { + "get": { + "description": "获取指定水网中节点的需水量属性信息", + "operationId": "get_demands_properties", + "parameters": [ + { + "description": "节点ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点ID", + "title": "Junction", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Demands Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取需水量属性", + "tags": [ + "Demands" + ] + }, + "patch": { + "description": "设置指定水网中节点的需水量属性信息", + "operationId": "patch_demands_properties", + "parameters": [ + { + "description": "节点ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点ID", + "title": "Junction", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置需水量属性", + "tags": [ + "Demands" + ] + } + }, + "/api/v1/demands/to-network": { + "post": { + "description": "将需水量均匀分配到整个水网的所有需水节点", + "operationId": "post_demands_to_network", + "parameters": [ + { + "description": "总需水量(m³/h)", + "in": "query", + "name": "demand", + "required": true, + "schema": { + "description": "总需水量(m³/h)", + "exclusiveMinimum": 0.0, + "title": "Demand", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "number" + }, + "title": "Response Post Demands To Network", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "计算需水量到整网分配", + "tags": [ + "Demands" + ] + } + }, + "/api/v1/demands/to-nodes": { + "post": { + "description": "将总需水量按指定方式分配到多个节点", + "operationId": "post_demands_to_nodes", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "number" + }, + "title": "Response Post Demands To Nodes", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "计算需水量到节点分配", + "tags": [ + "Demands" + ] + } + }, + "/api/v1/demands/to-region": { + "post": { + "description": "将总需水量按区域特征分配到该区域内的节点", + "operationId": "post_demands_to_region", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "number" + }, + "title": "Response Post Demands To Region", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "计算需水量到区域分配", + "tags": [ + "Demands" + ] + } + }, + "/api/v1/district-metering-area-generation-runs": { + "post": { + "description": "根据参数自动生成水网的DMA分区方案", + "operationId": "post_district_metering_area_generation_runs", + "parameters": [ + { + "description": "分区数量", + "in": "query", + "name": "part_count", + "required": true, + "schema": { + "description": "分区数量", + "exclusiveMinimum": 0, + "title": "Part Count", + "type": "integer" + } + }, + { + "description": "分区类型", + "in": "query", + "name": "part_type", + "required": true, + "schema": { + "description": "分区类型", + "title": "Part Type", + "type": "integer" + } + }, + { + "description": "膨胀参数", + "in": "query", + "name": "inflate_delta", + "required": true, + "schema": { + "description": "膨胀参数", + "title": "Inflate Delta", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "生成DMA分区", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/district-metering-areas": { + "delete": { + "description": "删除指定的区域计量(DMA)", + "operationId": "delete_district_metering_areas", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除DMA", + "tags": [ + "Regions & DMAs" + ] + }, + "get": { + "description": "获取指定水网中所有DMA的详细信息", + "operationId": "get_district_metering_areas", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有DMA", + "tags": [ + "Regions & DMAs" + ] + }, + "patch": { + "description": "修改指定DMA的属性信息", + "operationId": "patch_district_metering_areas", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置DMA属性", + "tags": [ + "Regions & DMAs" + ] + }, + "post": { + "description": "向水网添加一个新的区域计量(DMA)", + "operationId": "post_district_metering_areas", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加新DMA", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/district-metering-areas/detail": { + "get": { + "description": "获取指定ID的区域计量(DMA)详细信息", + "operationId": "get_district_metering_areas_detail", + "parameters": [ + { + "description": "DMA ID", + "in": "query", + "name": "id", + "required": true, + "schema": { + "description": "DMA ID", + "title": "Id", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get District Metering Areas Detail", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取DMA信息", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/district-metering-areas/for-network": { + "post": { + "description": "为整个水网计算区域计量(DMA)分区方案", + "operationId": "post_district_metering_areas_for_network", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_list_str__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "计算整网DMA分区", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/district-metering-areas/for-nodes": { + "post": { + "description": "为指定节点集计算区域计量(DMA)分区方案", + "operationId": "post_district_metering_areas_for_nodes", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_list_str__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "计算节点DMA分区", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/district-metering-areas/for-region": { + "post": { + "description": "为指定区域计算区域计量(DMA)分区方案", + "operationId": "post_district_metering_areas_for_region", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_list_str__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "计算区域内DMA分区", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/district-metering-areas/ids": { + "get": { + "description": "获取指定水网中所有DMA的ID列表", + "operationId": "get_district_metering_areas_ids", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_str_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有DMA ID", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/element-properties": { + "get": { + "description": "获取指定元素的属性信息", + "operationId": "get_element_properties", + "parameters": [ + { + "description": "元素ID", + "in": "query", + "name": "element", + "required": true, + "schema": { + "description": "元素ID", + "title": "Element", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Element Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取元素属性", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/element-properties-with-types": { + "get": { + "description": "获取指定类型的元素属性信息", + "operationId": "get_element_properties_with_types", + "parameters": [ + { + "description": "元素类型", + "in": "query", + "name": "elementtype", + "required": true, + "schema": { + "description": "元素类型", + "title": "Elementtype", + "type": "string" + } + }, + { + "description": "元素ID", + "in": "query", + "name": "element", + "required": true, + "schema": { + "description": "元素ID", + "title": "Element", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Element Properties With Types", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取指定类型元素属性", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/element-type-values": { + "get": { + "description": "获取指定元素的类型数值标识", + "operationId": "get_element_type_values", + "parameters": [ + { + "description": "元素ID", + "in": "query", + "name": "element", + "required": true, + "schema": { + "description": "元素ID", + "title": "Element", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Element Type Values", + "type": "integer" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取元素类型值", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/element-types": { + "get": { + "description": "获取指定元素的类型(节点或管线)", + "operationId": "get_element_types", + "parameters": [ + { + "description": "元素ID", + "in": "query", + "name": "element", + "required": true, + "schema": { + "description": "元素ID", + "title": "Element", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Element Types", + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取元素类型", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/emitters/properties": { + "get": { + "description": "获取指定连接点的发射器属性信息", + "operationId": "get_emitters_properties", + "parameters": [ + { + "description": "连接点ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "连接点ID", + "title": "Junction", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Emitters Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取发射器属性", + "tags": [ + "Quality" + ] + }, + "patch": { + "description": "更新指定连接点的发射器属性", + "operationId": "patch_emitters_properties", + "parameters": [ + { + "description": "连接点ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "连接点ID", + "title": "Junction", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置发射器属性", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/energy-properties": { + "patch": { + "description": "更新指定网络中的能耗选项属性", + "operationId": "patch_energy_properties", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置能耗选项属性", + "tags": [ + "Options" + ] + } + }, + "/api/v1/extension-datas": { + "get": { + "description": "获取指定网络中指定键的扩展数据值", + "operationId": "get_extension_datas", + "parameters": [ + { + "description": "扩展数据键", + "in": "query", + "name": "key", + "required": true, + "schema": { + "description": "扩展数据键", + "title": "Key", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Response Get Extension Datas" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取指定扩展数据", + "tags": [ + "Extension" + ] + }, + "patch": { + "description": "设置指定网络中的扩展数据", + "operationId": "patch_extension_datas", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置扩展数据", + "tags": [ + "Extension" + ] + } + }, + "/api/v1/flushing-analyses": { + "post": { + "description": "高级版本的冲洗分析,支持同时开启多个阀门进行冲洗,指定排污节点,并设置固定的冲洗流量。返回纯文本格式的分析结果。", + "operationId": "post_flushing_analyses", + "parameters": [ + { + "description": "冲洗开始时间(ISO 8601格式)", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "冲洗开始时间(ISO 8601格式)", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "要开启的阀门ID列表", + "in": "query", + "name": "valves", + "required": true, + "schema": { + "description": "要开启的阀门ID列表", + "items": { + "type": "string" + }, + "title": "Valves", + "type": "array" + } + }, + { + "description": "对应各阀门的开度列表(0-1)", + "in": "query", + "name": "valves_k", + "required": true, + "schema": { + "description": "对应各阀门的开度列表(0-1)", + "items": { + "type": "number" + }, + "title": "Valves K", + "type": "array" + } + }, + { + "description": "排污节点ID", + "in": "query", + "name": "drainage_node_id", + "required": true, + "schema": { + "description": "排污节点ID", + "title": "Drainage Node Id", + "type": "string" + } + }, + { + "description": "冲洗流量(L/s),0表示自动计算", + "in": "query", + "name": "flush_flow", + "required": false, + "schema": { + "default": 0, + "description": "冲洗流量(L/s),0表示自动计算", + "title": "Flush Flow", + "type": "number" + } + }, + { + "description": "模拟持续时间(秒),默认900秒", + "in": "query", + "name": "duration", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "模拟持续时间(秒),默认900秒", + "title": "Duration" + } + }, + { + "description": "冲洗方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "冲洗方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "冲洗分析(高级)", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/geocoding-requests": { + "post": { + "description": "调用天地图地理编码服务,将结构化地址转换为经纬度", + "operationId": "post_geocoding_requests", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TiandituGeocodeRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Geocoding Requests", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Tianditu Geocoding", + "tags": [ + "Geocoding" + ] + } + }, + "/api/v1/inp-runs": { + "post": { + "description": "运行指定INP文件格式的管网模型进行水力模拟。INP文件应该放在inp文件夹中,参数为文件名不含扩展名。", + "operationId": "post_inp_runs", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Inp Runs", + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "运行INP文件", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/junctions": { + "delete": { + "description": "从供水网络中删除指定的节点。", + "operationId": "delete_junctions", + "parameters": [ + { + "description": "节点 ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点 ID", + "title": "Junction", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除节点", + "tags": [ + "Junctions" + ] + }, + "get": { + "description": "获取指定项目中所有节点的属性信息。", + "operationId": "get_junctions", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有节点属性", + "tags": [ + "Junctions" + ] + }, + "post": { + "description": "在供水网络中添加新的节点,指定节点ID和空间坐标。", + "operationId": "post_junctions", + "parameters": [ + { + "description": "节点 ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点 ID", + "title": "Junction", + "type": "string" + } + }, + { + "description": "X 坐标", + "in": "query", + "name": "x", + "required": true, + "schema": { + "description": "X 坐标", + "title": "X", + "type": "number" + } + }, + { + "description": "Y 坐标", + "in": "query", + "name": "y", + "required": true, + "schema": { + "description": "Y 坐标", + "title": "Y", + "type": "number" + } + }, + { + "description": "标高(海拔高度)", + "in": "query", + "name": "z", + "required": true, + "schema": { + "description": "标高(海拔高度)", + "title": "Z", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加节点", + "tags": [ + "Junctions" + ] + } + }, + "/api/v1/junctions/coord": { + "get": { + "description": "获取指定节点的 X 和 Y 坐标。", + "operationId": "get_junctions_coord", + "parameters": [ + { + "description": "节点 ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点 ID", + "title": "Junction", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "number" + }, + "title": "Response Get Junctions Coord", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取节点坐标", + "tags": [ + "Junctions" + ] + }, + "patch": { + "description": "设置指定节点的 X 和 Y 坐标。", + "operationId": "patch_junctions_coord", + "parameters": [ + { + "description": "节点 ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点 ID", + "title": "Junction", + "type": "string" + } + }, + { + "description": "X 坐标值", + "in": "query", + "name": "x", + "required": true, + "schema": { + "description": "X 坐标值", + "title": "X", + "type": "number" + } + }, + { + "description": "Y 坐标值", + "in": "query", + "name": "y", + "required": true, + "schema": { + "description": "Y 坐标值", + "title": "Y", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置节点坐标", + "tags": [ + "Junctions" + ] + } + }, + "/api/v1/junctions/demand": { + "get": { + "description": "获取指定节点的需水量。", + "operationId": "get_junctions_demand", + "parameters": [ + { + "description": "节点 ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点 ID", + "title": "Junction", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Junctions Demand", + "type": "number" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取节点需水量", + "tags": [ + "Junctions" + ] + }, + "patch": { + "description": "设置指定节点的需水量。", + "operationId": "patch_junctions_demand", + "parameters": [ + { + "description": "节点 ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点 ID", + "title": "Junction", + "type": "string" + } + }, + { + "description": "需水量值", + "in": "query", + "name": "demand", + "required": true, + "schema": { + "description": "需水量值", + "title": "Demand", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置节点需水量", + "tags": [ + "Junctions" + ] + } + }, + "/api/v1/junctions/elevation": { + "get": { + "description": "获取指定节点的标高(海拔高度)。", + "operationId": "get_junctions_elevation", + "parameters": [ + { + "description": "节点 ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点 ID", + "title": "Junction", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Junctions Elevation", + "type": "number" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取节点标高", + "tags": [ + "Junctions" + ] + }, + "patch": { + "description": "设置指定节点的标高值。", + "operationId": "patch_junctions_elevation", + "parameters": [ + { + "description": "节点 ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点 ID", + "title": "Junction", + "type": "string" + } + }, + { + "description": "标高(海拔高度)", + "in": "query", + "name": "elevation", + "required": true, + "schema": { + "description": "标高(海拔高度)", + "title": "Elevation", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置节点标高", + "tags": [ + "Junctions" + ] + } + }, + "/api/v1/junctions/existence": { + "get": { + "description": "检查指定ID是否为水网中的接点(需求点)", + "operationId": "get_junctions_existence", + "parameters": [ + { + "description": "节点ID", + "in": "query", + "name": "node", + "required": true, + "schema": { + "description": "节点ID", + "title": "Node", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Junctions Existence", + "type": "boolean" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查是否为接点", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/junctions/pattern": { + "get": { + "description": "获取指定节点的需水模式标识。", + "operationId": "get_junctions_pattern", + "parameters": [ + { + "description": "节点 ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点 ID", + "title": "Junction", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Junctions Pattern", + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取节点需水模式", + "tags": [ + "Junctions" + ] + }, + "patch": { + "description": "设置指定节点的需水模式标识。", + "operationId": "patch_junctions_pattern", + "parameters": [ + { + "description": "节点 ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点 ID", + "title": "Junction", + "type": "string" + } + }, + { + "description": "需水模式标识", + "in": "query", + "name": "pattern", + "required": true, + "schema": { + "description": "需水模式标识", + "title": "Pattern", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置节点需水模式", + "tags": [ + "Junctions" + ] + } + }, + "/api/v1/junctions/properties": { + "get": { + "description": "获取指定节点的所有属性信息。", + "operationId": "get_junctions_properties", + "parameters": [ + { + "description": "节点 ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点 ID", + "title": "Junction", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Junctions Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取节点属性", + "tags": [ + "Junctions" + ] + }, + "patch": { + "description": "批量设置指定节点的多个属性。", + "operationId": "patch_junctions_properties", + "parameters": [ + { + "description": "节点 ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点 ID", + "title": "Junction", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "批量设置节点属性", + "tags": [ + "Junctions" + ] + } + }, + "/api/v1/junctions/x": { + "get": { + "description": "获取指定节点的 X 坐标值。", + "operationId": "get_junctions_x", + "parameters": [ + { + "description": "节点 ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点 ID", + "title": "Junction", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Junctions X", + "type": "number" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取节点 X 坐标", + "tags": [ + "Junctions" + ] + }, + "patch": { + "description": "设置指定节点的 X 坐标值。", + "operationId": "patch_junctions_x", + "parameters": [ + { + "description": "节点 ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点 ID", + "title": "Junction", + "type": "string" + } + }, + { + "description": "X 坐标值", + "in": "query", + "name": "x", + "required": true, + "schema": { + "description": "X 坐标值", + "title": "X", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置节点 X 坐标", + "tags": [ + "Junctions" + ] + } + }, + "/api/v1/junctions/y": { + "get": { + "description": "获取指定节点的 Y 坐标值。", + "operationId": "get_junctions_y", + "parameters": [ + { + "description": "节点 ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点 ID", + "title": "Junction", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Junctions Y", + "type": "number" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取节点 Y 坐标", + "tags": [ + "Junctions" + ] + }, + "patch": { + "description": "设置指定节点的 Y 坐标值。", + "operationId": "patch_junctions_y", + "parameters": [ + { + "description": "节点 ID", + "in": "query", + "name": "junction", + "required": true, + "schema": { + "description": "节点 ID", + "title": "Junction", + "type": "string" + } + }, + { + "description": "Y 坐标值", + "in": "query", + "name": "y", + "required": true, + "schema": { + "description": "Y 坐标值", + "title": "Y", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置节点 Y 坐标", + "tags": [ + "Junctions" + ] + } + }, + "/api/v1/labels": { + "delete": { + "description": "从网络中删除指定的标签", + "operationId": "delete_labels", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除标签", + "tags": [ + "Visuals" + ] + }, + "post": { + "description": "在网络中添加一个新的标签", + "operationId": "post_labels", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加标签", + "tags": [ + "Visuals" + ] + } + }, + "/api/v1/labels/properties": { + "get": { + "description": "获取指定坐标处的标签属性信息", + "operationId": "get_labels_properties", + "parameters": [ + { + "description": "X坐标", + "in": "query", + "name": "x", + "required": true, + "schema": { + "description": "X坐标", + "title": "X", + "type": "number" + } + }, + { + "description": "Y坐标", + "in": "query", + "name": "y", + "required": true, + "schema": { + "description": "Y坐标", + "title": "Y", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Labels Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取标签属性", + "tags": [ + "Visuals" + ] + }, + "patch": { + "description": "更新指定标签的属性", + "operationId": "patch_labels_properties", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置标签属性", + "tags": [ + "Visuals" + ] + } + }, + "/api/v1/leakage-identifications": { + "post": { + "description": "基于压力观测数据和遗传算法识别管网中的漏损位置和大小", + "operationId": "post_leakage_identifications", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LeakageIdentifyRequestRest", + "description": "漏损识别请求数据" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Leakage Identifications", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "执行漏损识别", + "tags": [ + "Leakage" + ] + } + }, + "/api/v1/link-properties": { + "get": { + "description": "获取指定管线的所有属性信息", + "operationId": "get_link_properties", + "parameters": [ + { + "description": "管线ID", + "in": "query", + "name": "link", + "required": true, + "schema": { + "description": "管线ID", + "title": "Link", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Link Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管线属性", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/link-types": { + "get": { + "description": "获取指定管线的类型(管道/泵/阀门)", + "operationId": "get_link_types", + "parameters": [ + { + "description": "管线ID", + "in": "query", + "name": "link", + "required": true, + "schema": { + "description": "管线ID", + "title": "Link", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Link Types", + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管线类型", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/links": { + "delete": { + "description": "删除指定的管线(管道/泵/阀门)", + "operationId": "delete_links", + "parameters": [ + { + "description": "管线ID", + "in": "query", + "name": "link", + "required": true, + "schema": { + "description": "管线ID", + "title": "Link", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除管线", + "tags": [ + "Network General" + ] + }, + "get": { + "description": "获取指定水网中的所有管线ID列表", + "operationId": "get_links", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_str_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有管线", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/links/existence": { + "get": { + "description": "检查指定ID是否为水网中的有效管线", + "operationId": "get_links_existence", + "parameters": [ + { + "description": "管线ID", + "in": "query", + "name": "link", + "required": true, + "schema": { + "description": "管线ID", + "title": "Link", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Links Existence", + "type": "boolean" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查管线有效性", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/major-pipe-nodes": { + "get": { + "description": "获取直径大于等于指定值的管道的节点ID", + "operationId": "get_major_pipe_nodes", + "parameters": [ + { + "description": "最小直径(mm)", + "in": "query", + "name": "diameter", + "required": true, + "schema": { + "description": "最小直径(mm)", + "exclusiveMinimum": 0, + "title": "Diameter", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Response Get Major Pipe Nodes" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取主要管道节点", + "tags": [ + "Geometry & Coordinates" + ] + } + }, + "/api/v1/majornode-coords": { + "get": { + "description": "获取直径大于等于指定值的节点坐标", + "operationId": "get_majornode_coords", + "parameters": [ + { + "description": "最小直径(mm)", + "in": "query", + "name": "diameter", + "required": true, + "schema": { + "description": "最小直径(mm)", + "exclusiveMinimum": 0, + "title": "Diameter", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "title": "Response Get Majornode Coords", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取主要节点坐标", + "tags": [ + "Geometry & Coordinates" + ] + } + }, + "/api/v1/mixing-configurations": { + "delete": { + "description": "从网络中删除指定的混合", + "operationId": "delete_mixing_configurations", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除混合", + "tags": [ + "Quality" + ] + }, + "patch": { + "description": "更新指定水池的混合属性", + "operationId": "patch_mixing_configurations", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置混合属性", + "tags": [ + "Quality" + ] + }, + "post": { + "description": "在网络中添加一个新的混合", + "operationId": "post_mixing_configurations", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加混合", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/mixing-configurations/detail": { + "get": { + "description": "获取指定水池的混合属性信息", + "operationId": "get_mixing_configurations_detail", + "parameters": [ + { + "description": "水池ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水池ID", + "title": "Tank", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Mixing Configurations Detail", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取混合属性", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/network-command-batches": { + "post": { + "description": "执行多个网络操作命令", + "operationId": "post_network_command_batches", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "执行批量命令", + "tags": [ + "Snapshots" + ] + } + }, + "/api/v1/network-command-batches/compressed": { + "post": { + "description": "执行压缩的批量命令", + "operationId": "post_network_command_batches_compressed", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "执行压缩批量命令", + "tags": [ + "Snapshots" + ] + } + }, + "/api/v1/network-in-extents": { + "get": { + "description": "获取指定地理范围内的网络节点和管线", + "operationId": "get_network_in_extents", + "parameters": [ + { + "description": "范围左下角X坐标", + "in": "query", + "name": "x1", + "required": true, + "schema": { + "description": "范围左下角X坐标", + "title": "X1", + "type": "number" + } + }, + { + "description": "范围左下角Y坐标", + "in": "query", + "name": "y1", + "required": true, + "schema": { + "description": "范围左下角Y坐标", + "title": "Y1", + "type": "number" + } + }, + { + "description": "范围右上角X坐标", + "in": "query", + "name": "x2", + "required": true, + "schema": { + "description": "范围右上角X坐标", + "title": "X2", + "type": "number" + } + }, + { + "description": "范围右上角Y坐标", + "in": "query", + "name": "y2", + "required": true, + "schema": { + "description": "范围右上角Y坐标", + "title": "Y2", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Network In Extents", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取范围内的网络元素", + "tags": [ + "Geometry & Coordinates" + ] + } + }, + "/api/v1/network-link-nodes": { + "get": { + "description": "获取指定水网所有管线的起点和终点节点", + "operationId": "get_network_link_nodes", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Response Get Network Link Nodes" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取网络管线节点", + "tags": [ + "Geometry & Coordinates" + ] + } + }, + "/api/v1/network-options": { + "get": { + "description": "获取指定网络中的选项属性信息", + "operationId": "get_network_options", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Network Options", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取选项属性", + "tags": [ + "Options" + ] + }, + "patch": { + "description": "更新指定网络中的选项属性", + "operationId": "patch_network_options", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置选项属性", + "tags": [ + "Options" + ] + } + }, + "/api/v1/network-options/energy": { + "get": { + "description": "获取指定网络中的能耗选项属性信息", + "operationId": "get_network_options_energy", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Network Options Energy", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取能耗选项属性", + "tags": [ + "Options" + ] + } + }, + "/api/v1/network-options/pump-energy": { + "get": { + "description": "获取指定泵的能耗属性信息", + "operationId": "get_network_options_pump_energy", + "parameters": [ + { + "description": "泵ID", + "in": "query", + "name": "pump", + "required": true, + "schema": { + "description": "泵ID", + "title": "Pump", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Network Options Pump Energy", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取泵能耗属性", + "tags": [ + "Options" + ] + }, + "patch": { + "description": "更新指定泵的能耗属性", + "operationId": "patch_network_options_pump_energy", + "parameters": [ + { + "description": "泵ID", + "in": "query", + "name": "pump", + "required": true, + "schema": { + "description": "泵ID", + "title": "Pump", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置泵能耗属性", + "tags": [ + "Options" + ] + } + }, + "/api/v1/network-options/time": { + "get": { + "description": "获取指定网络中的时间选项属性信息", + "operationId": "get_network_options_time", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Network Options Time", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取时间选项属性", + "tags": [ + "Options" + ] + } + }, + "/api/v1/network-pipe-risk-probability-nows": { + "get": { + "description": "获取指定网络中所有管道的当前风险概率值", + "operationId": "get_network_pipe_risk_probability_nows", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取整个网络的管道风险概率", + "tags": [ + "Risk" + ] + } + }, + "/api/v1/network-schemas/backdrop": { + "get": { + "description": "获取网络中背景对象的架构定义", + "operationId": "get_network_schemas_backdrop", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Backdrop", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取背景架构", + "tags": [ + "Visuals" + ] + } + }, + "/api/v1/network-schemas/control": { + "get": { + "description": "获取网络中控制对象的架构定义", + "operationId": "get_network_schemas_control", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Control", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取控制架构", + "tags": [ + "Controls & Rules" + ] + } + }, + "/api/v1/network-schemas/curve": { + "get": { + "description": "获取网络中曲线对象的架构定义", + "operationId": "get_network_schemas_curve", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Curve", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取曲线架构", + "tags": [ + "Curves" + ] + } + }, + "/api/v1/network-schemas/demand": { + "get": { + "description": "获取指定水网中需水量(Demand)的属性架构定义", + "operationId": "get_network_schemas_demand", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Demand", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取需水量属性架构", + "tags": [ + "Demands" + ] + } + }, + "/api/v1/network-schemas/district-metering-area": { + "get": { + "description": "获取指定水网的区域计量(DMA)属性架构定义", + "operationId": "get_network_schemas_district_metering_area", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas District Metering Area", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取DMA属性架构", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/network-schemas/emitter": { + "get": { + "description": "获取网络中发射器对象的架构定义", + "operationId": "get_network_schemas_emitter", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Emitter", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取发射器架构", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/network-schemas/energy": { + "get": { + "description": "获取网络中能耗选项的架构定义", + "operationId": "get_network_schemas_energy", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Energy", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取能耗选项架构", + "tags": [ + "Options" + ] + } + }, + "/api/v1/network-schemas/junction": { + "get": { + "description": "获取指定项目的节点属性架构和数据类型定义。", + "operationId": "get_network_schemas_junction", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Junction", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取节点架构", + "tags": [ + "Junctions" + ] + } + }, + "/api/v1/network-schemas/label": { + "get": { + "description": "获取网络中标签对象的架构定义", + "operationId": "get_network_schemas_label", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Label", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取标签架构", + "tags": [ + "Visuals" + ] + } + }, + "/api/v1/network-schemas/mixing": { + "get": { + "description": "获取网络中混合对象的架构定义", + "operationId": "get_network_schemas_mixing", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Mixing", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取混合架构", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/network-schemas/option": { + "get": { + "description": "获取网络中选项对象的架构定义", + "operationId": "get_network_schemas_option", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Option", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取选项架构", + "tags": [ + "Options" + ] + } + }, + "/api/v1/network-schemas/pattern": { + "get": { + "description": "获取网络中模式对象的架构定义", + "operationId": "get_network_schemas_pattern", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Pattern", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取模式架构", + "tags": [ + "Patterns" + ] + } + }, + "/api/v1/network-schemas/pipe": { + "get": { + "description": "获取管道对象的模式定义,包含所有可用字段及其类型", + "operationId": "get_network_schemas_pipe", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Pipe", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管道模式", + "tags": [ + "Pipes" + ] + } + }, + "/api/v1/network-schemas/pipe-reaction": { + "get": { + "description": "获取网络中管道反应对象的架构定义", + "operationId": "get_network_schemas_pipe_reaction", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Pipe Reaction", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管道反应架构", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/network-schemas/pump": { + "get": { + "description": "获取水泵对象的模式定义,包含所有可用字段及其类型", + "operationId": "get_network_schemas_pump", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Pump", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水泵模式", + "tags": [ + "Pumps" + ] + } + }, + "/api/v1/network-schemas/pump-energy": { + "get": { + "description": "获取网络中泵能耗选项的架构定义", + "operationId": "get_network_schemas_pump_energy", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Pump Energy", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取泵能耗选项架构", + "tags": [ + "Options" + ] + } + }, + "/api/v1/network-schemas/quality": { + "get": { + "description": "获取网络中水质对象的架构定义", + "operationId": "get_network_schemas_quality", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Quality", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水质架构", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/network-schemas/reaction": { + "get": { + "description": "获取网络中反应对象的架构定义", + "operationId": "get_network_schemas_reaction", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Reaction", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取反应架构", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/network-schemas/region": { + "get": { + "description": "获取指定水网的区域属性架构定义", + "operationId": "get_network_schemas_region", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Region", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取区域属性架构", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/network-schemas/reservoir": { + "get": { + "description": "获取指定供水网络中所有水库的模式/属性字段定义", + "operationId": "get_network_schemas_reservoir", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Reservoir", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水库模式", + "tags": [ + "Reservoirs" + ] + } + }, + "/api/v1/network-schemas/scada-device": { + "get": { + "description": "获取SCADA设备的数据架构\n\n返回SCADA设备表的字段定义和类型信息。\n\nArgs:\n network: 管网名称(或数据库名称)\n \nReturns:\n SCADA设备的字段架构信息", + "operationId": "get_network_schemas_scada_device", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Scada Device", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取SCADA设备架构", + "tags": [ + "SCADA设备" + ] + } + }, + "/api/v1/network-schemas/scada-device-data": { + "get": { + "description": "获取SCADA设备数据的表结构\n\n返回SCADA设备数据表的字段定义和类型信息。\n\nArgs:\n network: 管网名称(或数据库名称)\n \nReturns:\n SCADA设备数据的字段架构信息", + "operationId": "get_network_schemas_scada_device_data", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Scada Device Data", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取SCADA设备数据架构", + "tags": [ + "SCADA设备数据" + ] + } + }, + "/api/v1/network-schemas/scada-element": { + "get": { + "description": "获取SCADA元素映射的表结构\n\n返回SCADA元素映射表的字段定义和类型信息。\n\nArgs:\n network: 管网名称(或数据库名称)\n \nReturns:\n SCADA元素映射的字段架构信息", + "operationId": "get_network_schemas_scada_element", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Scada Element", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取SCADA元素架构", + "tags": [ + "SCADA元素映射" + ] + } + }, + "/api/v1/network-schemas/scheme": { + "get": { + "description": "获取指定网络的方案模式定义", + "operationId": "get_network_schemas_scheme", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Scheme", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取方案模式", + "tags": [ + "Schemes" + ] + } + }, + "/api/v1/network-schemas/service-area": { + "get": { + "description": "获取指定水网的服务区属性架构定义", + "operationId": "get_network_schemas_service_area", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Service Area", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取服务区属性架构", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/network-schemas/source": { + "get": { + "description": "获取网络中水源对象的架构定义", + "operationId": "get_network_schemas_source", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Source", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水源架构", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/network-schemas/tag": { + "get": { + "description": "获取指定水网的标签(Tag)属性架构定义", + "operationId": "get_network_schemas_tag", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Tag", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取标签属性架构", + "tags": [ + "Tags" + ] + } + }, + "/api/v1/network-schemas/tank": { + "get": { + "description": "获取指定网络的水箱数据结构模式定义", + "operationId": "get_network_schemas_tank", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Tank", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水箱模式", + "tags": [ + "Tanks" + ] + } + }, + "/api/v1/network-schemas/tank-reaction": { + "get": { + "description": "获取网络中水池反应对象的架构定义", + "operationId": "get_network_schemas_tank_reaction", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Tank Reaction", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水池反应架构", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/network-schemas/time": { + "get": { + "description": "获取网络中时间选项的架构定义", + "operationId": "get_network_schemas_time", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Time", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取时间选项架构", + "tags": [ + "Options" + ] + } + }, + "/api/v1/network-schemas/user": { + "get": { + "description": "获取指定网络的用户模式定义", + "operationId": "get_network_schemas_user", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas User", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取用户模式", + "tags": [ + "Users" + ] + } + }, + "/api/v1/network-schemas/valve": { + "get": { + "description": "获取指定水网中所有阀门的架构和字段定义", + "operationId": "get_network_schemas_valve", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Valve", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取阀门架构", + "tags": [ + "Valves" + ] + } + }, + "/api/v1/network-schemas/vertex": { + "get": { + "description": "获取网络中图形元素对象的架构定义", + "operationId": "get_network_schemas_vertex", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Vertex", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取图形元素架构", + "tags": [ + "Visuals" + ] + } + }, + "/api/v1/network-schemas/virtual-district": { + "get": { + "description": "获取指定水网的虚拟分区属性架构定义", + "operationId": "get_network_schemas_virtual_district", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Network Schemas Virtual District", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取虚拟分区属性架构", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/node-coords": { + "get": { + "description": "获取指定节点的地理坐标(X, Y)", + "operationId": "get_node_coords", + "parameters": [ + { + "description": "节点ID", + "in": "query", + "name": "node", + "required": true, + "schema": { + "description": "节点ID", + "title": "Node", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Response Get Node Coords" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取节点坐标", + "tags": [ + "Geometry & Coordinates" + ] + } + }, + "/api/v1/node-links": { + "get": { + "description": "获取指定节点连接的所有管线ID列表", + "operationId": "get_node_links", + "parameters": [ + { + "description": "节点ID", + "in": "query", + "name": "node", + "required": true, + "schema": { + "description": "节点ID", + "title": "Node", + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_str_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取节点的关联管线", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/node-properties": { + "get": { + "description": "获取指定节点的所有属性信息", + "operationId": "get_node_properties", + "parameters": [ + { + "description": "节点ID", + "in": "query", + "name": "node", + "required": true, + "schema": { + "description": "节点ID", + "title": "Node", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Node Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取节点属性", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/node-types": { + "get": { + "description": "获取指定节点的类型(接点/水源/蓄水池)", + "operationId": "get_node_types", + "parameters": [ + { + "description": "节点ID", + "in": "query", + "name": "node", + "required": true, + "schema": { + "description": "节点ID", + "title": "Node", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Node Types", + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取节点类型", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/nodes": { + "delete": { + "description": "删除指定的节点(接点/水源/蓄水池)", + "operationId": "delete_nodes", + "parameters": [ + { + "description": "节点ID", + "in": "query", + "name": "node", + "required": true, + "schema": { + "description": "节点ID", + "title": "Node", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除节点", + "tags": [ + "Network General" + ] + }, + "get": { + "description": "获取指定水网中的所有节点ID列表", + "operationId": "get_nodes", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_str_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有节点", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/nodes/existence": { + "get": { + "description": "检查指定ID是否为水网中的有效节点", + "operationId": "get_nodes_existence", + "parameters": [ + { + "description": "节点ID", + "in": "query", + "name": "node", + "required": true, + "schema": { + "description": "节点ID", + "title": "Node", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Nodes Existence", + "type": "boolean" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查节点有效性", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/operations": { + "patch": { + "description": "选择并恢复到指定的操作", + "operationId": "patch_operations", + "parameters": [ + { + "description": "操作ID", + "in": "query", + "name": "operation", + "required": true, + "schema": { + "description": "操作ID", + "title": "Operation", + "type": "integer" + } + }, + { + "description": "是否丢弃当前更改", + "in": "query", + "name": "discard", + "required": false, + "schema": { + "default": false, + "description": "是否丢弃当前更改", + "title": "Discard", + "type": "boolean" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "选择操作", + "tags": [ + "Snapshots" + ] + } + }, + "/api/v1/outputs": { + "get": { + "description": "导出指定路径的模拟输出文件内容。参数应为绝对路径。", + "operationId": "get_outputs", + "parameters": [ + { + "description": "模拟输出文件的绝对路径", + "in": "query", + "name": "output", + "required": true, + "schema": { + "description": "模拟输出文件的绝对路径", + "title": "Output", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Outputs", + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "导出模拟输出", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/patterns": { + "delete": { + "description": "从网络中删除指定的模式", + "operationId": "delete_patterns", + "parameters": [ + { + "description": "模式ID", + "in": "query", + "name": "pattern", + "required": true, + "schema": { + "description": "模式ID", + "title": "Pattern", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除模式", + "tags": [ + "Patterns" + ] + }, + "get": { + "description": "获取网络中的所有模式列表", + "operationId": "get_patterns", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_str_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有模式", + "tags": [ + "Patterns" + ] + }, + "post": { + "description": "在网络中添加一个新的模式", + "operationId": "post_patterns", + "parameters": [ + { + "description": "模式ID", + "in": "query", + "name": "pattern", + "required": true, + "schema": { + "description": "模式ID", + "title": "Pattern", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加模式", + "tags": [ + "Patterns" + ] + } + }, + "/api/v1/patterns/existence": { + "get": { + "description": "检查指定的模式是否存在", + "operationId": "get_patterns_existence", + "parameters": [ + { + "description": "模式ID", + "in": "query", + "name": "pattern", + "required": true, + "schema": { + "description": "模式ID", + "title": "Pattern", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Patterns Existence", + "type": "boolean" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查模式存在性", + "tags": [ + "Patterns" + ] + } + }, + "/api/v1/patterns/properties": { + "get": { + "description": "获取指定模式的属性信息", + "operationId": "get_patterns_properties", + "parameters": [ + { + "description": "模式ID", + "in": "query", + "name": "pattern", + "required": true, + "schema": { + "description": "模式ID", + "title": "Pattern", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Patterns Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取模式属性", + "tags": [ + "Patterns" + ] + }, + "patch": { + "description": "更新指定模式的属性", + "operationId": "patch_patterns_properties", + "parameters": [ + { + "description": "模式ID", + "in": "query", + "name": "pattern", + "required": true, + "schema": { + "description": "模式ID", + "title": "Pattern", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置模式属性", + "tags": [ + "Patterns" + ] + } + }, + "/api/v1/pipe-reactions": { + "patch": { + "description": "更新指定管道的反应属性", + "operationId": "patch_pipe_reactions", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置管道反应属性", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/pipe-reactions/detail": { + "get": { + "description": "获取指定管道的反应属性信息", + "operationId": "get_pipe_reactions_detail", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Pipe Reactions Detail", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管道反应属性", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/pipeline-health-predictions": { + "get": { + "description": "预测管道健康状况\n\n根据管网名称和当前时间,查询管道信息和实时数据,\n使用随机生存森林模型预测管道的生存概率。\n\nArgs:\n query_time: 查询时间\n network_name: 管网名称(或数据库名称)\n timescale_conn: TimescaleDB连接\n\nReturns:\n 预测结果列表,每个元素包含 link_id 和对应的生存函数\n\nRaises:\n HTTPException: 当模型文件不存在返回404错误,其他错误返回400或500错误", + "operationId": "get_pipeline_health_predictions", + "parameters": [ + { + "description": "查询时间", + "in": "query", + "name": "query_time", + "required": true, + "schema": { + "description": "查询时间", + "format": "date-time", + "title": "Query Time", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "预测管道健康状况", + "tags": [ + "TimescaleDB - Composite" + ] + } + }, + "/api/v1/pipes": { + "delete": { + "description": "从网络中删除指定的管道", + "operationId": "delete_pipes", + "parameters": [ + { + "description": "要删除的管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "要删除的管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除管道", + "tags": [ + "Pipes" + ] + }, + "get": { + "description": "获取网络中所有管道的属性信息列表", + "operationId": "get_pipes", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有管道属性", + "tags": [ + "Pipes" + ] + }, + "post": { + "description": "向网络中添加新的管道,需要提供管道的基本参数如长度、管径、粗糙度等", + "operationId": "post_pipes", + "parameters": [ + { + "description": "管道标识符", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道标识符", + "title": "Pipe", + "type": "string" + } + }, + { + "description": "管道起始节点ID", + "in": "query", + "name": "node1", + "required": true, + "schema": { + "description": "管道起始节点ID", + "title": "Node1", + "type": "string" + } + }, + { + "description": "管道终止节点ID", + "in": "query", + "name": "node2", + "required": true, + "schema": { + "description": "管道终止节点ID", + "title": "Node2", + "type": "string" + } + }, + { + "description": "管道长度(单位:米)", + "in": "query", + "name": "length", + "required": false, + "schema": { + "default": 0, + "description": "管道长度(单位:米)", + "title": "Length", + "type": "number" + } + }, + { + "description": "管道管径(单位:毫米)", + "in": "query", + "name": "diameter", + "required": false, + "schema": { + "default": 0, + "description": "管道管径(单位:毫米)", + "title": "Diameter", + "type": "number" + } + }, + { + "description": "管道粗糙度", + "in": "query", + "name": "roughness", + "required": false, + "schema": { + "default": 0, + "description": "管道粗糙度", + "title": "Roughness", + "type": "number" + } + }, + { + "description": "管道局部阻力系数", + "in": "query", + "name": "minor_loss", + "required": false, + "schema": { + "default": 0, + "description": "管道局部阻力系数", + "title": "Minor Loss", + "type": "number" + } + }, + { + "description": "管道状态(开启/关闭)", + "in": "query", + "name": "status", + "required": false, + "schema": { + "default": "OPEN", + "description": "管道状态(开启/关闭)", + "title": "Status", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加管道", + "tags": [ + "Pipes" + ] + } + }, + "/api/v1/pipes-risk-probabilities": { + "get": { + "description": "批量获取多条管道的风险概率值", + "operationId": "get_pipes_risk_probabilities", + "parameters": [ + { + "description": "逗号分隔的管道ID列表", + "in": "query", + "name": "pipe_ids", + "required": true, + "schema": { + "description": "逗号分隔的管道ID列表", + "title": "Pipe Ids", + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "批量获取多条管道风险概率", + "tags": [ + "Risk" + ] + } + }, + "/api/v1/pipes/diameter": { + "get": { + "description": "获取指定管道的管径", + "operationId": "get_pipes_diameter", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Response Get Pipes Diameter" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管道管径", + "tags": [ + "Pipes" + ] + }, + "patch": { + "description": "设置指定管道的管径", + "operationId": "patch_pipes_diameter", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "description": "新的管道管径(单位:毫米)", + "in": "query", + "name": "diameter", + "required": true, + "schema": { + "description": "新的管道管径(单位:毫米)", + "title": "Diameter", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置管道管径", + "tags": [ + "Pipes" + ] + } + }, + "/api/v1/pipes/existence": { + "get": { + "description": "检查指定ID是否为水网中的管道", + "operationId": "get_pipes_existence", + "parameters": [ + { + "description": "管线ID", + "in": "query", + "name": "link", + "required": true, + "schema": { + "description": "管线ID", + "title": "Link", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Pipes Existence", + "type": "boolean" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查是否为管道", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/pipes/length": { + "get": { + "description": "获取指定管道的长度", + "operationId": "get_pipes_length", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Response Get Pipes Length" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管道长度", + "tags": [ + "Pipes" + ] + }, + "patch": { + "description": "设置指定管道的长度", + "operationId": "patch_pipes_length", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "description": "新的管道长度(单位:米)", + "in": "query", + "name": "length", + "required": true, + "schema": { + "description": "新的管道长度(单位:米)", + "title": "Length", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置管道长度", + "tags": [ + "Pipes" + ] + } + }, + "/api/v1/pipes/minor-loss": { + "get": { + "description": "获取指定管道的局部阻力系数", + "operationId": "get_pipes_minor_loss", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Response Get Pipes Minor Loss" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管道局部阻力系数", + "tags": [ + "Pipes" + ] + }, + "patch": { + "description": "设置指定管道的局部阻力系数", + "operationId": "patch_pipes_minor_loss", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "description": "新的局部阻力系数值", + "in": "query", + "name": "minor_loss", + "required": true, + "schema": { + "description": "新的局部阻力系数值", + "title": "Minor Loss", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置管道局部阻力系数", + "tags": [ + "Pipes" + ] + } + }, + "/api/v1/pipes/node1": { + "get": { + "description": "获取指定管道的起始节点ID", + "operationId": "get_pipes_node1", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Response Get Pipes Node1" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管道起始节点", + "tags": [ + "Pipes" + ] + }, + "patch": { + "description": "设置指定管道的起始节点", + "operationId": "patch_pipes_node1", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "description": "新的起始节点ID", + "in": "query", + "name": "node1", + "required": true, + "schema": { + "description": "新的起始节点ID", + "title": "Node1", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置管道起始节点", + "tags": [ + "Pipes" + ] + } + }, + "/api/v1/pipes/node2": { + "get": { + "description": "获取指定管道的终止节点ID", + "operationId": "get_pipes_node2", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Response Get Pipes Node2" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管道终止节点", + "tags": [ + "Pipes" + ] + }, + "patch": { + "description": "设置指定管道的终止节点", + "operationId": "patch_pipes_node2", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "description": "新的终止节点ID", + "in": "query", + "name": "node2", + "required": true, + "schema": { + "description": "新的终止节点ID", + "title": "Node2", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置管道终止节点", + "tags": [ + "Pipes" + ] + } + }, + "/api/v1/pipes/properties": { + "get": { + "description": "获取指定管道的所有属性信息", + "operationId": "get_pipes_properties", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Pipes Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管道属性", + "tags": [ + "Pipes" + ] + }, + "patch": { + "description": "批量设置指定管道的多个属性", + "operationId": "patch_pipes_properties", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置管道属性", + "tags": [ + "Pipes" + ] + } + }, + "/api/v1/pipes/risk-probability": { + "get": { + "description": "获取指定管道的风险概率历史数据", + "operationId": "get_pipes_risk_probability", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe_id", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe Id", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Pipes Risk Probability", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管道风险概率历史", + "tags": [ + "Risk" + ] + } + }, + "/api/v1/pipes/risk-probability-geometries": { + "get": { + "description": "获取指定网络中管道的风险相关几何数据", + "operationId": "get_pipes_risk_probability_geometries", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Pipes Risk Probability Geometries", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管道风险几何信息", + "tags": [ + "Risk" + ] + } + }, + "/api/v1/pipes/risk-probability-now": { + "get": { + "description": "获取指定管道当前时刻的风险概率值", + "operationId": "get_pipes_risk_probability_now", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe_id", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe Id", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Pipes Risk Probability Now", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管道当前风险概率", + "tags": [ + "Risk" + ] + } + }, + "/api/v1/pipes/roughness": { + "get": { + "description": "获取指定管道的粗糙度", + "operationId": "get_pipes_roughness", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Response Get Pipes Roughness" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管道粗糙度", + "tags": [ + "Pipes" + ] + }, + "patch": { + "description": "设置指定管道的粗糙度", + "operationId": "patch_pipes_roughness", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "description": "新的管道粗糙度值", + "in": "query", + "name": "roughness", + "required": true, + "schema": { + "description": "新的管道粗糙度值", + "title": "Roughness", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置管道粗糙度", + "tags": [ + "Pipes" + ] + } + }, + "/api/v1/pipes/status": { + "get": { + "description": "获取指定管道的状态(开启或关闭)", + "operationId": "get_pipes_status", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Response Get Pipes Status" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管道状态", + "tags": [ + "Pipes" + ] + }, + "patch": { + "description": "设置指定管道的状态(开启或关闭)", + "operationId": "patch_pipes_status", + "parameters": [ + { + "description": "管道ID", + "in": "query", + "name": "pipe", + "required": true, + "schema": { + "description": "管道ID", + "title": "Pipe", + "type": "string" + } + }, + { + "description": "新的管道状态(开启/关闭)", + "in": "query", + "name": "status", + "required": true, + "schema": { + "description": "新的管道状态(开启/关闭)", + "title": "Status", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置管道状态", + "tags": [ + "Pipes" + ] + } + }, + "/api/v1/pressure-regulation-analyses": { + "post": { + "description": "高级版本的压力调节分析,通过JSON请求体提供详细的控制参数,包括固定泵和变速泵的独立控制、水箱初始水位等。", + "operationId": "post_pressure_regulation_analyses", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PressureRegulationRest", + "description": "压力调节控制参数" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Pressure Regulation Analyses", + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "压力调节(高级)", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/pressure-regulation-calculations": { + "post": { + "description": "对管网的压力进行调节分析,通过控制泵的运行来维持目标节点的目标压力。此为基础版本。", + "operationId": "post_pressure_regulation_calculations", + "parameters": [ + { + "description": "目标节点ID", + "in": "query", + "name": "target_node", + "required": true, + "schema": { + "description": "目标节点ID", + "title": "Target Node", + "type": "string" + } + }, + { + "description": "目标压力值(kPa)", + "in": "query", + "name": "target_pressure", + "required": true, + "schema": { + "description": "目标压力值(kPa)", + "title": "Target Pressure", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "压力调节(基础)", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/pressure-sensor-placement-kmeans": { + "post": { + "description": "高级版本的压力传感器放置分析,通过JSON请求体提供详细参数。基于KMeans聚类算法确定最优放置位置。", + "operationId": "post_pressure_sensor_placement_kmeans", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PressureSensorPlacement", + "description": "传感器放置分析参数" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "压力传感器放置-KMeans聚类分析(高级)", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/pressure-sensor-placement-kmeans-calculations": { + "post": { + "description": "基于KMeans聚类算法,为指定管网项目确定压力传感器的最优放置位置。此为基础版本。", + "operationId": "post_pressure_sensor_placement_kmeans_calculations", + "parameters": [ + { + "description": "放置方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "放置方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "description": "传感器数量", + "in": "query", + "name": "sensor_number", + "required": true, + "schema": { + "description": "传感器数量", + "title": "Sensor Number", + "type": "integer" + } + }, + { + "description": "最小管径限制(毫米)", + "in": "query", + "name": "min_diameter", + "required": true, + "schema": { + "description": "最小管径限制(毫米)", + "title": "Min Diameter", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "压力传感器放置-KMeans聚类分析(基础)", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/pressure-sensor-placement-sensitivities": { + "post": { + "description": "高级版本的压力传感器放置分析,通过JSON请求体提供详细参数。基于灵敏度分析方法确定最优放置位置。", + "operationId": "post_pressure_sensor_placement_sensitivities", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PressureSensorPlacement", + "description": "传感器放置分析参数" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "压力传感器放置-灵敏度分析(高级)", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/pressure-sensor-placement-sensitivity-calculations": { + "post": { + "description": "基于灵敏度分析方法,为指定管网项目确定最优的压力传感器放置位置。此为基础版本。", + "operationId": "post_pressure_sensor_placement_sensitivity_calculations", + "parameters": [ + { + "description": "放置方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "放置方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "description": "传感器数量", + "in": "query", + "name": "sensor_number", + "required": true, + "schema": { + "description": "传感器数量", + "title": "Sensor Number", + "type": "integer" + } + }, + { + "description": "最小管径限制(毫米)", + "in": "query", + "name": "min_diameter", + "required": true, + "schema": { + "description": "最小管径限制(毫米)", + "title": "Min Diameter", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "压力传感器放置-灵敏度分析(基础)", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/project-codes": { + "get": { + "description": "获取服务器上所有可用的供水管网项目名称列表。", + "operationId": "get_project_codes", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_str_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取项目列表", + "tags": [ + "Project" + ] + } + }, + "/api/v1/project-conversions": { + "post": { + "description": "将 EPANET 3.0 格式的 INP 内容转换为 2.x 格式。", + "operationId": "post_project_conversions", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "转换 INP V3 为 V2", + "tags": [ + "Project" + ] + } + }, + "/api/v1/project-copies": { + "post": { + "description": "将现有项目复制为新项目。", + "operationId": "post_project_copies", + "parameters": [ + { + "description": "管网名称(或数据库名称)", + "in": "query", + "name": "source", + "required": true, + "schema": { + "description": "管网名称(或数据库名称)", + "title": "Source", + "type": "string" + } + }, + { + "description": "管网名称(或数据库名称)", + "in": "query", + "name": "target", + "required": true, + "schema": { + "description": "管网名称(或数据库名称)", + "title": "Target", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "复制项目", + "tags": [ + "Project" + ] + } + }, + "/api/v1/project-managements": { + "post": { + "description": "高级版本的项目管理,通过JSON请求体提供详细的控制参数,包括泵控制策略、水箱初始水位和区域需水量控制。", + "operationId": "post_project_managements", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectManagementRest", + "description": "项目管理控制参数" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Project Managements", + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "项目管理(高级)", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/project-return-dict-runs": { + "post": { + "description": "基于指定的管网项目运行标准水力模拟,返回JSON格式的字典,包含输出数据和报告文本。", + "operationId": "post_project_return_dict_runs", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Project Return Dict Runs", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "运行项目模拟(返回字典)", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/project-runs": { + "post": { + "description": "基于指定的管网项目运行标准水力模拟,返回纯文本格式的模拟报告。", + "operationId": "post_project_runs", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "运行项目模拟", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/projects": { + "delete": { + "description": "永久删除指定的供水管网项目。此操作不可恢复。", + "operationId": "delete_projects", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除项目", + "tags": [ + "Project" + ] + }, + "get": { + "description": "获取当前用户有权限的所有项目列表", + "operationId": "get_projects", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_ProjectSummaryResponse_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "列出用户项目", + "tags": [ + "Metadata" + ] + }, + "post": { + "description": "创建一个新的供水管网项目。如果项目已存在,可能会覆盖或报错(取决于底层实现)。", + "operationId": "post_projects", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "创建新项目", + "tags": [ + "Project" + ] + } + }, + "/api/v1/projects/current": { + "delete": { + "description": "将指定项目从内存中卸载,释放资源。", + "operationId": "delete_projects_current", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "关闭项目", + "tags": [ + "Project" + ] + }, + "get": { + "description": "从数据库获取项目的详细信息,包括地图范围等。", + "operationId": "get_projects_current", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectMetaResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取项目信息", + "tags": [ + "Project" + ] + }, + "post": { + "description": "将指定项目加载到内存中,并初始化数据库连接池。", + "operationId": "post_projects_current", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "打开项目", + "tags": [ + "Project" + ] + } + }, + "/api/v1/projects/current/database-health": { + "get": { + "description": "检查项目数据库连接的健康状况", + "operationId": "get_projects_current_database_health", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查数据库健康状态", + "tags": [ + "Metadata" + ] + } + }, + "/api/v1/projects/current/exports/change-set": { + "get": { + "description": "导出项目的变更集 (ChangeSet),包含顶点、SCADA 元素、DMA、SA、VD 等信息。", + "operationId": "get_projects_current_exports_change_set", + "parameters": [ + { + "description": "版本号 (通常用于增量更新)", + "in": "query", + "name": "version", + "required": true, + "schema": { + "description": "版本号 (通常用于增量更新)", + "title": "Version", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "导出项目为 ChangeSet", + "tags": [ + "Project" + ] + } + }, + "/api/v1/projects/current/exports/inp": { + "post": { + "description": "将项目当前状态保存为 INP 文件到服务器文件系统。", + "operationId": "post_projects_current_exports_inp", + "parameters": [ + { + "description": "目标文件名", + "in": "query", + "name": "inp", + "required": true, + "schema": { + "description": "目标文件名", + "title": "Inp", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Projects Current Exports Inp", + "type": "boolean" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "导出项目到 INP 文件", + "tags": [ + "Project" + ] + } + }, + "/api/v1/projects/current/files/inp": { + "get": { + "description": "从服务器数据目录下载指定的 INP 文件。", + "operationId": "get_projects_current_files_inp", + "parameters": [ + { + "description": "文件名", + "in": "query", + "name": "name", + "required": true, + "schema": { + "description": "文件名", + "title": "Name", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "下载 INP 文件", + "tags": [ + "Project" + ] + } + }, + "/api/v1/projects/current/imports": { + "post": { + "description": "从服务器文件系统中读取指定的 INP 文件并加载到项目中。", + "operationId": "post_projects_current_imports", + "parameters": [ + { + "description": "INP 文件名 (不包含路径)", + "in": "query", + "name": "inp", + "required": true, + "schema": { + "description": "INP 文件名 (不包含路径)", + "title": "Inp", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Projects Current Imports", + "type": "boolean" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "读取 INP 文件到项目", + "tags": [ + "Project" + ] + } + }, + "/api/v1/projects/current/lock": { + "delete": { + "description": "释放对项目的锁定。", + "operationId": "delete_projects_current_lock", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "解锁项目", + "tags": [ + "Project" + ] + }, + "get": { + "description": "检查指定项目是否处于锁定状态。", + "operationId": "get_projects_current_lock", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查项目是否被锁定", + "tags": [ + "Project" + ] + }, + "post": { + "description": "锁定指定项目以防止并发修改。", + "operationId": "post_projects_current_lock", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "锁定项目", + "tags": [ + "Project" + ] + } + }, + "/api/v1/projects/current/lock/ownership": { + "get": { + "description": "检查指定项目是否被当前客户端 (IP) 锁定。", + "operationId": "get_projects_current_lock_ownership", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查项目是否被当前用户锁定", + "tags": [ + "Project" + ] + } + }, + "/api/v1/projects/current/metadata": { + "get": { + "description": "获取当前项目的元数据和配置信息", + "operationId": "get_projects_current_metadata", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectMetaResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取项目元数据", + "tags": [ + "Metadata" + ] + } + }, + "/api/v1/projects/current/status": { + "get": { + "description": "检查指定项目是否已被加载到内存中。", + "operationId": "get_projects_current_status", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查项目是否已打开", + "tags": [ + "Project" + ] + } + }, + "/api/v1/projects/existence": { + "get": { + "description": "检查指定名称的项目是否存在。", + "operationId": "get_projects_existence", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查项目是否存在", + "tags": [ + "Project" + ] + } + }, + "/api/v1/pump-failure-events": { + "post": { + "description": "记录和管理泵的故障状态,包括故障发生时间和受影响的泵列表。系统将记录故障日志并更新泵状态。", + "operationId": "post_pump_failure_events", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PumpFailureState", + "description": "泵故障状态信息" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Pump Failure Events", + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "泵故障管理", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/pumps": { + "delete": { + "description": "从网络中删除指定的水泵", + "operationId": "delete_pumps", + "parameters": [ + { + "description": "要删除的水泵ID", + "in": "query", + "name": "pump", + "required": true, + "schema": { + "description": "要删除的水泵ID", + "title": "Pump", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除水泵", + "tags": [ + "Pumps" + ] + }, + "get": { + "description": "获取网络中所有水泵的属性信息列表", + "operationId": "get_pumps", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有水泵属性", + "tags": [ + "Pumps" + ] + }, + "post": { + "description": "向网络中添加新的水泵,需要提供水泵的基本参数如功率等", + "operationId": "post_pumps", + "parameters": [ + { + "description": "水泵标识符", + "in": "query", + "name": "pump", + "required": true, + "schema": { + "description": "水泵标识符", + "title": "Pump", + "type": "string" + } + }, + { + "description": "水泵起始节点ID", + "in": "query", + "name": "node1", + "required": true, + "schema": { + "description": "水泵起始节点ID", + "title": "Node1", + "type": "string" + } + }, + { + "description": "水泵终止节点ID", + "in": "query", + "name": "node2", + "required": true, + "schema": { + "description": "水泵终止节点ID", + "title": "Node2", + "type": "string" + } + }, + { + "description": "水泵功率(单位:千瓦)", + "in": "query", + "name": "power", + "required": false, + "schema": { + "default": 0.0, + "description": "水泵功率(单位:千瓦)", + "title": "Power", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加水泵", + "tags": [ + "Pumps" + ] + } + }, + "/api/v1/pumps/existence": { + "get": { + "description": "检查指定ID是否为水网中的泵", + "operationId": "get_pumps_existence", + "parameters": [ + { + "description": "管线ID", + "in": "query", + "name": "link", + "required": true, + "schema": { + "description": "管线ID", + "title": "Link", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Pumps Existence", + "type": "boolean" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查是否为泵", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/pumps/node1": { + "get": { + "description": "获取指定水泵的起始节点ID", + "operationId": "get_pumps_node1", + "parameters": [ + { + "description": "水泵ID", + "in": "query", + "name": "pump", + "required": true, + "schema": { + "description": "水泵ID", + "title": "Pump", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Response Get Pumps Node1" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水泵起始节点", + "tags": [ + "Pumps" + ] + }, + "patch": { + "description": "设置指定水泵的起始节点", + "operationId": "patch_pumps_node1", + "parameters": [ + { + "description": "水泵ID", + "in": "query", + "name": "pump", + "required": true, + "schema": { + "description": "水泵ID", + "title": "Pump", + "type": "string" + } + }, + { + "description": "新的起始节点ID", + "in": "query", + "name": "node1", + "required": true, + "schema": { + "description": "新的起始节点ID", + "title": "Node1", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水泵起始节点", + "tags": [ + "Pumps" + ] + } + }, + "/api/v1/pumps/node2": { + "get": { + "description": "获取指定水泵的终止节点ID", + "operationId": "get_pumps_node2", + "parameters": [ + { + "description": "水泵ID", + "in": "query", + "name": "pump", + "required": true, + "schema": { + "description": "水泵ID", + "title": "Pump", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Response Get Pumps Node2" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水泵终止节点", + "tags": [ + "Pumps" + ] + }, + "patch": { + "description": "设置指定水泵的终止节点", + "operationId": "patch_pumps_node2", + "parameters": [ + { + "description": "水泵ID", + "in": "query", + "name": "pump", + "required": true, + "schema": { + "description": "水泵ID", + "title": "Pump", + "type": "string" + } + }, + { + "description": "新的终止节点ID", + "in": "query", + "name": "node2", + "required": true, + "schema": { + "description": "新的终止节点ID", + "title": "Node2", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水泵终止节点", + "tags": [ + "Pumps" + ] + } + }, + "/api/v1/pumps/properties": { + "get": { + "description": "获取指定水泵的所有属性信息", + "operationId": "get_pumps_properties", + "parameters": [ + { + "description": "水泵ID", + "in": "query", + "name": "pump", + "required": true, + "schema": { + "description": "水泵ID", + "title": "Pump", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Pumps Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水泵属性", + "tags": [ + "Pumps" + ] + }, + "patch": { + "description": "批量设置指定水泵的多个属性", + "operationId": "patch_pumps_properties", + "parameters": [ + { + "description": "水泵ID", + "in": "query", + "name": "pump", + "required": true, + "schema": { + "description": "水泵ID", + "title": "Pump", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水泵属性", + "tags": [ + "Pumps" + ] + } + }, + "/api/v1/quality-configurations/properties": { + "get": { + "description": "获取指定节点的水质属性信息", + "operationId": "get_quality_configurations_properties", + "parameters": [ + { + "description": "节点ID", + "in": "query", + "name": "node", + "required": true, + "schema": { + "description": "节点ID", + "title": "Node", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Quality Configurations Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水质属性", + "tags": [ + "Quality" + ] + }, + "patch": { + "description": "更新指定节点的水质属性", + "operationId": "patch_quality_configurations_properties", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水质属性", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/reactions": { + "patch": { + "description": "更新指定网络中的反应属性", + "operationId": "patch_reactions", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置反应属性", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/reactions/detail": { + "get": { + "description": "获取指定网络中的反应属性信息", + "operationId": "get_reactions_detail", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Reactions Detail", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取反应属性", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/redis": { + "get": { + "description": "获取Redis中所有的缓存键", + "operationId": "get_redis", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "查询缓存键列表", + "tags": [ + "Cache" + ] + } + }, + "/api/v1/redis-keys": { + "delete": { + "description": "根据模式清除匹配的Redis缓存键", + "operationId": "delete_redis_keys", + "parameters": [ + { + "description": "缓存键模式(支持通配符)", + "in": "query", + "name": "keys", + "required": true, + "schema": { + "description": "缓存键模式(支持通配符)", + "title": "Keys", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "清除匹配的缓存键", + "tags": [ + "Cache" + ] + } + }, + "/api/v1/redis-keys/detail": { + "delete": { + "description": "根据键名清除单个Redis缓存", + "operationId": "delete_redis_keys_detail", + "parameters": [ + { + "description": "缓存键名", + "in": "query", + "name": "key", + "required": true, + "schema": { + "description": "缓存键名", + "title": "Key", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "清除单个缓存键", + "tags": [ + "Cache" + ] + } + }, + "/api/v1/redos": { + "post": { + "description": "重做网络上被撤销的操作", + "operationId": "post_redos", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "重做操作", + "tags": [ + "Snapshots" + ] + } + }, + "/api/v1/regions": { + "delete": { + "description": "删除指定的区域", + "operationId": "delete_regions", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除区域", + "tags": [ + "Regions & DMAs" + ] + }, + "patch": { + "description": "修改指定区域的属性信息", + "operationId": "patch_regions", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置区域属性", + "tags": [ + "Regions & DMAs" + ] + }, + "post": { + "description": "向水网添加一个新的区域", + "operationId": "post_regions", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加新区域", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/regions/detail": { + "get": { + "description": "获取指定ID的区域详细信息", + "operationId": "get_regions_detail", + "parameters": [ + { + "description": "区域ID", + "in": "query", + "name": "id", + "required": true, + "schema": { + "description": "区域ID", + "title": "Id", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Regions Detail", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取区域信息", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/reservoirs": { + "delete": { + "description": "从指定供水网络中删除指定的水库/水源节点", + "operationId": "delete_reservoirs", + "parameters": [ + { + "description": "要删除的水库的唯一标识符", + "in": "query", + "name": "reservoir", + "required": true, + "schema": { + "description": "要删除的水库的唯一标识符", + "title": "Reservoir", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除水库", + "tags": [ + "Reservoirs" + ] + }, + "get": { + "description": "获取指定供水网络中所有水库的属性", + "operationId": "get_reservoirs", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有水库属性", + "tags": [ + "Reservoirs" + ] + }, + "post": { + "description": "在指定供水网络中添加新的水库/水源节点", + "operationId": "post_reservoirs", + "parameters": [ + { + "description": "水库的唯一标识符", + "in": "query", + "name": "reservoir", + "required": true, + "schema": { + "description": "水库的唯一标识符", + "title": "Reservoir", + "type": "string" + } + }, + { + "description": "水库的X坐标", + "in": "query", + "name": "x", + "required": true, + "schema": { + "description": "水库的X坐标", + "title": "X", + "type": "number" + } + }, + { + "description": "水库的Y坐标", + "in": "query", + "name": "y", + "required": true, + "schema": { + "description": "水库的Y坐标", + "title": "Y", + "type": "number" + } + }, + { + "description": "水库的水头/总水头(米)", + "in": "query", + "name": "head", + "required": true, + "schema": { + "description": "水库的水头/总水头(米)", + "title": "Head", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加水库", + "tags": [ + "Reservoirs" + ] + } + }, + "/api/v1/reservoirs/coord": { + "get": { + "description": "获取指定水库的平面坐标(X和Y坐标)", + "operationId": "get_reservoirs_coord", + "parameters": [ + { + "description": "水库的唯一标识符", + "in": "query", + "name": "reservoir", + "required": true, + "schema": { + "description": "水库的唯一标识符", + "title": "Reservoir", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Response Get Reservoirs Coord" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水库坐标", + "tags": [ + "Reservoirs" + ] + }, + "patch": { + "description": "更新指定水库的平面坐标(X和Y坐标)", + "operationId": "patch_reservoirs_coord", + "parameters": [ + { + "description": "水库的唯一标识符", + "in": "query", + "name": "reservoir", + "required": true, + "schema": { + "description": "水库的唯一标识符", + "title": "Reservoir", + "type": "string" + } + }, + { + "description": "新的X坐标值", + "in": "query", + "name": "x", + "required": true, + "schema": { + "description": "新的X坐标值", + "title": "X", + "type": "number" + } + }, + { + "description": "新的Y坐标值", + "in": "query", + "name": "y", + "required": true, + "schema": { + "description": "新的Y坐标值", + "title": "Y", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水库坐标", + "tags": [ + "Reservoirs" + ] + } + }, + "/api/v1/reservoirs/existence": { + "get": { + "description": "检查指定ID是否为水网中的水源(水库/河流)", + "operationId": "get_reservoirs_existence", + "parameters": [ + { + "description": "节点ID", + "in": "query", + "name": "node", + "required": true, + "schema": { + "description": "节点ID", + "title": "Node", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Reservoirs Existence", + "type": "boolean" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查是否为水源", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/reservoirs/head": { + "get": { + "description": "获取指定水库的供水水头/总水头值", + "operationId": "get_reservoirs_head", + "parameters": [ + { + "description": "水库的唯一标识符", + "in": "query", + "name": "reservoir", + "required": true, + "schema": { + "description": "水库的唯一标识符", + "title": "Reservoir", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Response Get Reservoirs Head" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水库水头", + "tags": [ + "Reservoirs" + ] + }, + "patch": { + "description": "更新指定水库的供水水头/总水头值", + "operationId": "patch_reservoirs_head", + "parameters": [ + { + "description": "水库的唯一标识符", + "in": "query", + "name": "reservoir", + "required": true, + "schema": { + "description": "水库的唯一标识符", + "title": "Reservoir", + "type": "string" + } + }, + { + "description": "新的水头值(米)", + "in": "query", + "name": "head", + "required": true, + "schema": { + "description": "新的水头值(米)", + "title": "Head", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水库水头", + "tags": [ + "Reservoirs" + ] + } + }, + "/api/v1/reservoirs/pattern": { + "get": { + "description": "获取指定水库的运行模式/供水模式", + "operationId": "get_reservoirs_pattern", + "parameters": [ + { + "description": "水库的唯一标识符", + "in": "query", + "name": "reservoir", + "required": true, + "schema": { + "description": "水库的唯一标识符", + "title": "Reservoir", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Response Get Reservoirs Pattern" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水库模式", + "tags": [ + "Reservoirs" + ] + }, + "patch": { + "description": "更新指定水库的运行模式/供水模式", + "operationId": "patch_reservoirs_pattern", + "parameters": [ + { + "description": "水库的唯一标识符", + "in": "query", + "name": "reservoir", + "required": true, + "schema": { + "description": "水库的唯一标识符", + "title": "Reservoir", + "type": "string" + } + }, + { + "description": "新的运行模式", + "in": "query", + "name": "pattern", + "required": true, + "schema": { + "description": "新的运行模式", + "title": "Pattern", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水库模式", + "tags": [ + "Reservoirs" + ] + } + }, + "/api/v1/reservoirs/properties": { + "get": { + "description": "获取指定水库的所有属性", + "operationId": "get_reservoirs_properties", + "parameters": [ + { + "description": "水库的唯一标识符", + "in": "query", + "name": "reservoir", + "required": true, + "schema": { + "description": "水库的唯一标识符", + "title": "Reservoir", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Reservoirs Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水库属性", + "tags": [ + "Reservoirs" + ] + }, + "patch": { + "description": "批量更新指定水库的多个属性", + "operationId": "patch_reservoirs_properties", + "parameters": [ + { + "description": "水库的唯一标识符", + "in": "query", + "name": "reservoir", + "required": true, + "schema": { + "description": "水库的唯一标识符", + "title": "Reservoir", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水库属性", + "tags": [ + "Reservoirs" + ] + } + }, + "/api/v1/reservoirs/x": { + "get": { + "description": "获取指定水库的X坐标位置", + "operationId": "get_reservoirs_x", + "parameters": [ + { + "description": "水库的唯一标识符", + "in": "query", + "name": "reservoir", + "required": true, + "schema": { + "description": "水库的唯一标识符", + "title": "Reservoir", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Response Get Reservoirs X" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水库X坐标", + "tags": [ + "Reservoirs" + ] + }, + "patch": { + "description": "更新指定水库的X坐标位置", + "operationId": "patch_reservoirs_x", + "parameters": [ + { + "description": "水库的唯一标识符", + "in": "query", + "name": "reservoir", + "required": true, + "schema": { + "description": "水库的唯一标识符", + "title": "Reservoir", + "type": "string" + } + }, + { + "description": "新的X坐标值", + "in": "query", + "name": "x", + "required": true, + "schema": { + "description": "新的X坐标值", + "title": "X", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水库X坐标", + "tags": [ + "Reservoirs" + ] + } + }, + "/api/v1/reservoirs/y": { + "get": { + "description": "获取指定水库的Y坐标位置", + "operationId": "get_reservoirs_y", + "parameters": [ + { + "description": "水库的唯一标识符", + "in": "query", + "name": "reservoir", + "required": true, + "schema": { + "description": "水库的唯一标识符", + "title": "Reservoir", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Response Get Reservoirs Y" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水库Y坐标", + "tags": [ + "Reservoirs" + ] + }, + "patch": { + "description": "更新指定水库的Y坐标位置", + "operationId": "patch_reservoirs_y", + "parameters": [ + { + "description": "水库的唯一标识符", + "in": "query", + "name": "reservoir", + "required": true, + "schema": { + "description": "水库的唯一标识符", + "title": "Reservoir", + "type": "string" + } + }, + { + "description": "新的Y坐标值", + "in": "query", + "name": "y", + "required": true, + "schema": { + "description": "新的Y坐标值", + "title": "Y", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水库Y坐标", + "tags": [ + "Reservoirs" + ] + } + }, + "/api/v1/restore-operations": { + "get": { + "description": "获取网络的恢复操作ID", + "operationId": "get_restore_operations", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Restore Operations", + "type": "integer" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取恢复操作ID", + "tags": [ + "Snapshots" + ] + }, + "patch": { + "description": "设置网络的恢复操作ID", + "operationId": "patch_restore_operations", + "parameters": [ + { + "description": "操作ID", + "in": "query", + "name": "operation", + "required": true, + "schema": { + "description": "操作ID", + "title": "Operation", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置恢复操作ID", + "tags": [ + "Snapshots" + ] + } + }, + "/api/v1/rule-properties": { + "get": { + "description": "获取指定网络中的规则属性信息", + "operationId": "get_rule_properties", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Rule Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取规则属性", + "tags": [ + "Controls & Rules" + ] + }, + "patch": { + "description": "更新指定网络中的规则属性", + "operationId": "patch_rule_properties", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置规则属性", + "tags": [ + "Controls & Rules" + ] + } + }, + "/api/v1/rule-schemas": { + "get": { + "description": "获取网络中规则对象的架构定义", + "operationId": "get_rule_schemas", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Rule Schemas", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取规则架构", + "tags": [ + "Controls & Rules" + ] + } + }, + "/api/v1/scada-device-cleaning-runs": { + "post": { + "description": "清空SCADA设备表\n\n删除指定管网中所有的SCADA设备。\n\nArgs:\n network: 管网名称(或数据库名称)\n \nReturns:\n 变更集合信息", + "operationId": "post_scada_device_cleaning_runs", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "清空SCADA设备表", + "tags": [ + "SCADA设备" + ] + } + }, + "/api/v1/scada-device-data-cleaning-runs": { + "post": { + "description": "清空SCADA设备数据表\n\n删除指定管网中所有SCADA设备的数据。\n\nArgs:\n network: 管网名称(或数据库名称)\n \nReturns:\n 变更集合信息", + "operationId": "post_scada_device_data_cleaning_runs", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "清空SCADA设备数据表", + "tags": [ + "SCADA设备数据" + ] + } + }, + "/api/v1/scada-device-datas": { + "delete": { + "description": "删除SCADA设备数据\n\n删除指定SCADA设备的数据记录。\n\nArgs:\n network: 管网名称(或数据库名称)\n req: 请求体,包含要删除的数据ID\n \nReturns:\n 变更集合信息", + "operationId": "delete_scada_device_datas", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除SCADA设备数据", + "tags": [ + "SCADA设备数据" + ] + }, + "patch": { + "description": "更新SCADA设备数据\n\n修改指定SCADA设备的数据。\n\nArgs:\n network: 管网名称(或数据库名称)\n req: 请求体,包含要更新的数据\n \nReturns:\n 变更集合信息", + "operationId": "patch_scada_device_datas", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "更新SCADA设备数据", + "tags": [ + "SCADA设备数据" + ] + }, + "post": { + "description": "添加新的SCADA设备数据\n\n为指定SCADA设备添加新的数据记录。\n\nArgs:\n network: 管网名称(或数据库名称)\n req: 请求体,包含新数据的内容\n \nReturns:\n 变更集合信息", + "operationId": "post_scada_device_datas", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加SCADA设备数据", + "tags": [ + "SCADA设备数据" + ] + } + }, + "/api/v1/scada-device-datas/detail": { + "get": { + "description": "获取单个SCADA设备的数据\n\n查询指定设备的监测数据或配置数据。\n\nArgs:\n network: 管网名称(或数据库名称)\n device_id: SCADA设备ID\n \nReturns:\n SCADA设备数据", + "operationId": "get_scada_device_datas_detail", + "parameters": [ + { + "description": "SCADA设备ID", + "in": "query", + "name": "device_id", + "required": true, + "schema": { + "description": "SCADA设备ID", + "title": "Device Id", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Scada Device Datas Detail", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取SCADA设备数据", + "tags": [ + "SCADA设备数据" + ] + } + }, + "/api/v1/scada-devices": { + "delete": { + "description": "删除SCADA设备\n\n从指定管网中删除一个SCADA设备。\n\nArgs:\n network: 管网名称(或数据库名称)\n req: 请求体,包含要删除的设备ID\n \nReturns:\n 变更集合信息", + "operationId": "delete_scada_devices", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除SCADA设备", + "tags": [ + "SCADA设备" + ] + }, + "get": { + "description": "获取指定管网所有SCADA设备的完整信息\n\nArgs:\n network: 管网名称(或数据库名称)\n \nReturns:\n SCADA设备信息列表", + "operationId": "get_scada_devices", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有SCADA设备", + "tags": [ + "SCADA设备" + ] + }, + "patch": { + "description": "更新SCADA设备信息\n\n修改指定SCADA设备的属性。\n\nArgs:\n network: 管网名称(或数据库名称)\n req: 请求体,包含要更新的设备属性\n \nReturns:\n 变更集合信息", + "operationId": "patch_scada_devices", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "更新SCADA设备", + "tags": [ + "SCADA设备" + ] + }, + "post": { + "description": "添加新的SCADA设备\n\n在指定管网中添加一个新的SCADA设备。\n\nArgs:\n network: 管网名称(或数据库名称)\n req: 请求体,包含新设备的属性\n \nReturns:\n 变更集合信息", + "operationId": "post_scada_devices", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加SCADA设备", + "tags": [ + "SCADA设备" + ] + } + }, + "/api/v1/scada-devices/detail": { + "get": { + "description": "获取单个SCADA设备的信息\n\n根据设备ID查询该设备的详细信息。\n\nArgs:\n network: 管网名称(或数据库名称)\n id: SCADA设备ID\n \nReturns:\n SCADA设备信息", + "operationId": "get_scada_devices_detail", + "parameters": [ + { + "description": "SCADA设备ID", + "in": "query", + "name": "id", + "required": true, + "schema": { + "description": "SCADA设备ID", + "title": "Id", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Scada Devices Detail", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取SCADA设备", + "tags": [ + "SCADA设备" + ] + } + }, + "/api/v1/scada-devices/ids": { + "get": { + "description": "获取指定管网所有SCADA设备的ID列表\n\nArgs:\n network: 管网名称(或数据库名称)\n \nReturns:\n SCADA设备ID列表", + "operationId": "get_scada_devices_ids", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_str_" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有SCADA设备ID", + "tags": [ + "SCADA设备" + ] + } + }, + "/api/v1/scada-element-cleaning-runs": { + "post": { + "description": "清空SCADA元素映射表\n\n删除指定管网中所有的SCADA元素映射。\n\nArgs:\n network: 管网名称(或数据库名称)\n \nReturns:\n 变更集合信息", + "operationId": "post_scada_element_cleaning_runs", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "清空SCADA元素映射表", + "tags": [ + "SCADA元素映射" + ] + } + }, + "/api/v1/scada-elements": { + "delete": { + "description": "删除SCADA元素映射\n\n移除SCADA设备与管网元素的映射关系。\n\nArgs:\n network: 管网名称(或数据库名称)\n req: 请求体,包含要删除的映射ID\n \nReturns:\n 变更集合信息", + "operationId": "delete_scada_elements", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除SCADA元素映射", + "tags": [ + "SCADA元素映射" + ] + }, + "get": { + "description": "获取指定管网所有SCADA元素映射\n\n查询所有SCADA设备与管网元素(节点/管道)的映射关系。\n\nArgs:\n network: 管网名称(或数据库名称)\n \nReturns:\n SCADA元素映射列表", + "operationId": "get_scada_elements", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有SCADA元素映射", + "tags": [ + "SCADA元素映射" + ] + }, + "patch": { + "description": "更新SCADA元素映射\n\n修改SCADA设备与管网元素的映射关系。\n\nArgs:\n network: 管网名称(或数据库名称)\n req: 请求体,包含要更新的映射信息\n \nReturns:\n 变更集合信息", + "operationId": "patch_scada_elements", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "更新SCADA元素映射", + "tags": [ + "SCADA元素映射" + ] + }, + "post": { + "description": "添加新的SCADA元素映射\n\n创建SCADA设备与管网元素的新映射关系。\n\nArgs:\n network: 管网名称(或数据库名称)\n req: 请求体,包含新映射的信息\n \nReturns:\n 变更集合信息", + "operationId": "post_scada_elements", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加SCADA元素映射", + "tags": [ + "SCADA元素映射" + ] + } + }, + "/api/v1/scada-elements/detail": { + "get": { + "description": "获取单个SCADA元素映射的信息\n\n根据ID查询特定的SCADA设备与管网元素的映射关系。\n\nArgs:\n network: 管网名称(或数据库名称)\n id: SCADA元素映射ID\n \nReturns:\n SCADA元素映射信息", + "operationId": "get_scada_elements_detail", + "parameters": [ + { + "description": "SCADA元素映射ID", + "in": "query", + "name": "id", + "required": true, + "schema": { + "description": "SCADA元素映射ID", + "title": "Id", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Scada Elements Detail", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取单个SCADA元素映射", + "tags": [ + "SCADA元素映射" + ] + } + }, + "/api/v1/scada-info": { + "get": { + "description": "获取指定管网所有SCADA的信息\n\n查询该管网下所有已配置的SCADA的完整信息。\n\nArgs:\n network: 管网名称(或数据库名称)\n \nReturns:\n SCADA信息列表", + "operationId": "get_scada_info", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有SCADA信息", + "tags": [ + "SCADA信息" + ] + } + }, + "/api/v1/scada-info-schemas": { + "get": { + "description": "获取SCADA信息表的结构\n\n返回SCADA信息表的字段定义和类型信息。\n\nArgs:\n network: 管网名称(或数据库名称)\n \nReturns:\n SCADA信息的字段架构信息", + "operationId": "get_scada_info_schemas", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Scada Info Schemas", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取SCADA信息架构", + "tags": [ + "SCADA信息" + ] + } + }, + "/api/v1/scada-info/database-view": { + "get": { + "description": "使用连接池查询所有SCADA信息", + "operationId": "get_scada_info_database_view", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取SCADA信息", + "tags": [ + "Project Data" + ] + } + }, + "/api/v1/scada-info/detail": { + "get": { + "description": "获取单个SCADA信息\n\n根据ID查询SCADA的详细配置信息。\n\nArgs:\n network: 管网名称(或数据库名称)\n id: SCADA信息ID\n \nReturns:\n SCADA信息详情", + "operationId": "get_scada_info_detail", + "parameters": [ + { + "description": "SCADA信息ID", + "in": "query", + "name": "id", + "required": true, + "schema": { + "description": "SCADA信息ID", + "title": "Id", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Scada Info Detail", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取SCADA信息", + "tags": [ + "SCADA信息" + ] + } + }, + "/api/v1/scada-properties": { + "get": { + "description": "获取指定SCADA点的属性信息", + "operationId": "get_scada_properties", + "parameters": [ + { + "description": "SCADA点ID", + "in": "query", + "name": "scada", + "required": true, + "schema": { + "description": "SCADA点ID", + "title": "Scada", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Scada Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取SCADA点属性", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/scheduling-analyses": { + "post": { + "description": "对管网的供水排程进行分析,优化泵的运行时间和出水流量,平衡水厂出水、水箱进出水,满足用户需求。", + "operationId": "post_scheduling_analyses", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SchedulingAnalysisRest", + "description": "排程分析参数" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Scheduling Analyses", + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "排程分析", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/schemes": { + "get": { + "description": "获取指定网络的所有方案信息", + "operationId": "get_schemes", + "parameters": [ + { + "description": "方案类型;为空时返回全部类型", + "in": "query", + "name": "scheme_type", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "方案类型;为空时返回全部类型", + "title": "Scheme Type" + } + }, + { + "description": "查询日期(可选)", + "in": "query", + "name": "query_date", + "required": false, + "schema": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "查询日期(可选)", + "title": "Query Date" + } + }, + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_Any__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有方案", + "tags": [ + "Schemes" + ] + } + }, + "/api/v1/schemes/detail": { + "get": { + "description": "根据名称获取指定的方案信息", + "operationId": "get_schemes_detail", + "parameters": [ + { + "description": "方案名称", + "in": "query", + "name": "schema_name", + "required": true, + "schema": { + "description": "方案名称", + "title": "Schema Name", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Schemes Detail", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取单个方案", + "tags": [ + "Schemes" + ] + } + }, + "/api/v1/schemes/list-with-connection": { + "get": { + "description": "使用连接池查询所有方案信息", + "operationId": "get_schemes_list_with_connection", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取方案列表", + "tags": [ + "Project Data" + ] + } + }, + "/api/v1/schemes/{scheme_name}": { + "get": { + "description": "按方案类型获取指定方案详情", + "operationId": "get_schemes_scheme_name", + "parameters": [ + { + "description": "方案名称", + "in": "path", + "name": "scheme_name", + "required": true, + "schema": { + "description": "方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "description": "方案类型;为空时返回通用方案详情", + "in": "query", + "name": "scheme_type", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "方案类型;为空时返回通用方案详情", + "title": "Scheme Type" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Schemes Scheme Name", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取方案详情", + "tags": [ + "Schemes" + ] + } + }, + "/api/v1/sensor-placement-optimization-runs": { + "post": { + "operationId": "post_sensor_placement_optimization_runs", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SensorPlacementOptimizeRequestRest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SensorPlacementSchemeResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "创建并返回监测点优化方案", + "tags": [ + "Sensor Placement" + ] + } + }, + "/api/v1/sensor-placement-schemes": { + "get": { + "description": "获取网络中所有传感器的放置位置信息", + "operationId": "get_sensor_placement_schemes", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_Any__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有传感器位置", + "tags": [ + "Misc" + ] + }, + "post": { + "description": "创建新的传感器放置方案,支持灵敏度分析和KMeans聚类两种方法。根据指定的方法自动计算最优的传感器放置位置。", + "operationId": "post_sensor_placement_schemes", + "parameters": [ + { + "description": "放置方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "放置方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "description": "传感器类型", + "in": "query", + "name": "sensor_type", + "required": true, + "schema": { + "description": "传感器类型", + "title": "Sensor Type", + "type": "string" + } + }, + { + "description": "放置方法('sensitivity'或'kmeans')", + "in": "query", + "name": "method", + "required": true, + "schema": { + "description": "放置方法('sensitivity'或'kmeans')", + "title": "Method", + "type": "string" + } + }, + { + "description": "传感器数量", + "in": "query", + "name": "sensor_count", + "required": true, + "schema": { + "description": "传感器数量", + "title": "Sensor Count", + "type": "integer" + } + }, + { + "description": "最小管径限制(毫米),默认0", + "in": "query", + "name": "min_diameter", + "required": false, + "schema": { + "default": 0, + "description": "最小管径限制(毫米),默认0", + "title": "Min Diameter", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Sensor Placement Schemes", + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "传感器放置方案创建", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/sensor-placement-schemes/{scheme_id}": { + "get": { + "operationId": "get_sensor_placement_schemes_scheme_id", + "parameters": [ + { + "in": "path", + "name": "scheme_id", + "required": true, + "schema": { + "title": "Scheme Id", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SensorPlacementSchemeResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取监测点方案详情", + "tags": [ + "Sensor Placement" + ] + }, + "put": { + "operationId": "put_sensor_placement_schemes_scheme_id", + "parameters": [ + { + "in": "path", + "name": "scheme_id", + "required": true, + "schema": { + "title": "Scheme Id", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SensorPlacementUpdateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SensorPlacementSchemeResponse" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "覆盖保存监测点方案", + "tags": [ + "Sensor Placement" + ] + } + }, + "/api/v1/sensor-placement-schemes/{scheme_id}/exports/excel": { + "post": { + "operationId": "post_sensor_placement_schemes_scheme_id_exports_excel", + "parameters": [ + { + "in": "path", + "name": "scheme_id", + "required": true, + "schema": { + "title": "Scheme Id", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SensorPlacementExportRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "导出监测点工程清单", + "tags": [ + "Sensor Placement" + ] + } + }, + "/api/v1/service-area-calculations": { + "post": { + "description": "计算指定水网的服务区分区,返回全部时间步结果", + "operationId": "post_service_area_calculations", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__list_str___" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "计算服务区", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/service-area-generation-runs": { + "post": { + "description": "根据参数自动生成水网的服务区分区", + "operationId": "post_service_area_generation_runs", + "parameters": [ + { + "description": "膨胀参数", + "in": "query", + "name": "inflate_delta", + "required": true, + "schema": { + "description": "膨胀参数", + "title": "Inflate Delta", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "生成服务区分区", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/service-areas": { + "delete": { + "description": "删除指定的服务区", + "operationId": "delete_service_areas", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除服务区", + "tags": [ + "Regions & DMAs" + ] + }, + "get": { + "description": "获取指定水网中的所有服务区信息", + "operationId": "get_service_areas", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有服务区", + "tags": [ + "Regions & DMAs" + ] + }, + "patch": { + "description": "修改指定服务区的属性信息", + "operationId": "patch_service_areas", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置服务区属性", + "tags": [ + "Regions & DMAs" + ] + }, + "post": { + "description": "向水网添加一个新的服务区", + "operationId": "post_service_areas", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加新服务区", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/service-areas/detail": { + "get": { + "description": "获取指定ID的服务区详细信息", + "operationId": "get_service_areas_detail", + "parameters": [ + { + "description": "服务区ID", + "in": "query", + "name": "id", + "required": true, + "schema": { + "description": "服务区ID", + "title": "Id", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Service Areas Detail", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取服务区信息", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/simulation-runs": { + "post": { + "description": "根据指定的开始时间和持续时间,手动运行水力模拟。开始时间必须是显式带时区的 ISO 8601 / RFC3339 时间。", + "operationId": "post_simulation_runs", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunSimulationManuallyByDateRest", + "description": "模拟运行参数" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "string" + }, + "title": "Response Post Simulation Runs", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "手动运行日期指定模拟", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/snapshot-for-current-operations": { + "get": { + "description": "检查当前操作的快照是否存在", + "operationId": "get_snapshot_for_current_operations", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Snapshot For Current Operations", + "type": "boolean" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查当前操作快照是否存在", + "tags": [ + "Snapshots" + ] + }, + "post": { + "description": "为当前操作创建快照", + "operationId": "post_snapshot_for_current_operations", + "parameters": [ + { + "description": "快照标签", + "in": "query", + "name": "tag", + "required": true, + "schema": { + "description": "快照标签", + "title": "Tag", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "为当前操作创建快照", + "tags": [ + "Snapshots" + ] + } + }, + "/api/v1/snapshot-for-operations": { + "get": { + "description": "检查指定操作ID的快照是否存在", + "operationId": "get_snapshot_for_operations", + "parameters": [ + { + "description": "操作ID", + "in": "query", + "name": "operation", + "required": true, + "schema": { + "description": "操作ID", + "title": "Operation", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Snapshot For Operations", + "type": "boolean" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查操作快照是否存在", + "tags": [ + "Snapshots" + ] + }, + "post": { + "description": "为指定的操作创建快照", + "operationId": "post_snapshot_for_operations", + "parameters": [ + { + "description": "操作ID", + "in": "query", + "name": "operation", + "required": true, + "schema": { + "description": "操作ID", + "title": "Operation", + "type": "integer" + } + }, + { + "description": "快照标签", + "in": "query", + "name": "tag", + "required": true, + "schema": { + "description": "快照标签", + "title": "Tag", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "为操作创建快照", + "tags": [ + "Snapshots" + ] + } + }, + "/api/v1/snapshots": { + "get": { + "description": "获取网络中的所有快照", + "operationId": "get_snapshots", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_tuple_int__str__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取快照列表", + "tags": [ + "Snapshots" + ] + }, + "patch": { + "description": "选择并恢复到指定的快照", + "operationId": "patch_snapshots", + "parameters": [ + { + "description": "快照标签", + "in": "query", + "name": "tag", + "required": true, + "schema": { + "description": "快照标签", + "title": "Tag", + "type": "string" + } + }, + { + "description": "是否丢弃当前更改", + "in": "query", + "name": "discard", + "required": false, + "schema": { + "default": false, + "description": "是否丢弃当前更改", + "title": "Discard", + "type": "boolean" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "选择快照", + "tags": [ + "Snapshots" + ] + }, + "post": { + "description": "为网络创建一个快照", + "operationId": "post_snapshots", + "parameters": [ + { + "description": "快照标签", + "in": "query", + "name": "tag", + "required": true, + "schema": { + "description": "快照标签", + "title": "Tag", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "创建快照", + "tags": [ + "Snapshots" + ] + } + }, + "/api/v1/snapshots/existence": { + "get": { + "description": "检查指定标签的快照是否存在", + "operationId": "get_snapshots_existence", + "parameters": [ + { + "description": "快照标签", + "in": "query", + "name": "tag", + "required": true, + "schema": { + "description": "快照标签", + "title": "Tag", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Snapshots Existence", + "type": "boolean" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查快照是否存在", + "tags": [ + "Snapshots" + ] + } + }, + "/api/v1/sources": { + "delete": { + "description": "从网络中删除指定节点的水源", + "operationId": "delete_sources", + "parameters": [ + { + "description": "节点ID", + "in": "query", + "name": "node", + "required": true, + "schema": { + "description": "节点ID", + "title": "Node", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除水源", + "tags": [ + "Quality" + ] + }, + "patch": { + "description": "更新指定节点的水源属性", + "operationId": "patch_sources", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水源属性", + "tags": [ + "Quality" + ] + }, + "post": { + "description": "在网络中添加一个新的水源", + "operationId": "post_sources", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加水源", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/sources/detail": { + "get": { + "description": "获取指定节点的水源属性信息", + "operationId": "get_sources_detail", + "parameters": [ + { + "description": "节点ID", + "in": "query", + "name": "node", + "required": true, + "schema": { + "description": "节点ID", + "title": "Node", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Sources Detail", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水源属性", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/status": { + "get": { + "description": "获取指定管线的状态信息", + "operationId": "get_status", + "parameters": [ + { + "description": "管线ID", + "in": "query", + "name": "link", + "required": true, + "schema": { + "description": "管线ID", + "title": "Link", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Status", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管线状态", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/status-properties": { + "patch": { + "description": "设置指定管线的状态信息", + "operationId": "patch_status_properties", + "parameters": [ + { + "description": "管线ID", + "in": "query", + "name": "link", + "required": true, + "schema": { + "description": "管线ID", + "title": "Link", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置管线状态", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/status-schemas": { + "get": { + "description": "获取指定水网的状态(Status)属性架构定义", + "operationId": "get_status_schemas", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Status Schemas", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取状态属性架构", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/sub-district-metering-areas": { + "post": { + "description": "为指定DMA生成子DMA分区", + "operationId": "post_sub_district_metering_areas", + "parameters": [ + { + "description": "DMA ID", + "in": "query", + "name": "dma", + "required": true, + "schema": { + "description": "DMA ID", + "title": "Dma", + "type": "string" + } + }, + { + "description": "分区数量", + "in": "query", + "name": "part_count", + "required": true, + "schema": { + "description": "分区数量", + "exclusiveMinimum": 0, + "title": "Part Count", + "type": "integer" + } + }, + { + "description": "分区类型", + "in": "query", + "name": "part_type", + "required": true, + "schema": { + "description": "分区类型", + "title": "Part Type", + "type": "integer" + } + }, + { + "description": "膨胀参数", + "in": "query", + "name": "inflate_delta", + "required": true, + "schema": { + "description": "膨胀参数", + "title": "Inflate Delta", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "生成DMA子分区", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/tags": { + "get": { + "description": "获取指定水网中的所有标签信息", + "operationId": "get_tags", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有标签", + "tags": [ + "Tags" + ] + }, + "patch": { + "description": "为指定元素设置或修改标签信息", + "operationId": "patch_tags", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置标签", + "tags": [ + "Tags" + ] + } + }, + "/api/v1/tags/detail": { + "get": { + "description": "获取指定类型和ID的标签信息", + "operationId": "get_tags_detail", + "parameters": [ + { + "description": "标签类型", + "in": "query", + "name": "t_type", + "required": true, + "schema": { + "description": "标签类型", + "title": "T Type", + "type": "string" + } + }, + { + "description": "元素ID", + "in": "query", + "name": "id", + "required": true, + "schema": { + "description": "元素ID", + "title": "Id", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Tags Detail", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取标签信息", + "tags": [ + "Tags" + ] + } + }, + "/api/v1/tank-reactions": { + "patch": { + "description": "更新指定水池的反应属性", + "operationId": "patch_tank_reactions", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水池反应属性", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/tank-reactions/detail": { + "get": { + "description": "获取指定水池的反应属性信息", + "operationId": "get_tank_reactions_detail", + "parameters": [ + { + "description": "水池ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水池ID", + "title": "Tank", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Tank Reactions Detail", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水池反应属性", + "tags": [ + "Quality" + ] + } + }, + "/api/v1/tanks": { + "delete": { + "description": "删除指定网络中的水箱", + "operationId": "delete_tanks", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除水箱", + "tags": [ + "Tanks" + ] + }, + "get": { + "description": "获取指定网络中所有水箱的属性", + "operationId": "get_tanks", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有水箱属性", + "tags": [ + "Tanks" + ] + }, + "post": { + "description": "向指定网络中新增一个水箱", + "operationId": "post_tanks", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "description": "X坐标", + "in": "query", + "name": "x", + "required": true, + "schema": { + "description": "X坐标", + "title": "X", + "type": "number" + } + }, + { + "description": "Y坐标", + "in": "query", + "name": "y", + "required": true, + "schema": { + "description": "Y坐标", + "title": "Y", + "type": "number" + } + }, + { + "description": "标高", + "in": "query", + "name": "elevation", + "required": true, + "schema": { + "description": "标高", + "title": "Elevation", + "type": "number" + } + }, + { + "description": "初始水位", + "in": "query", + "name": "init_level", + "required": false, + "schema": { + "default": 0, + "description": "初始水位", + "title": "Init Level", + "type": "number" + } + }, + { + "description": "最小水位", + "in": "query", + "name": "min_level", + "required": false, + "schema": { + "default": 0, + "description": "最小水位", + "title": "Min Level", + "type": "number" + } + }, + { + "description": "最大水位", + "in": "query", + "name": "max_level", + "required": false, + "schema": { + "default": 0, + "description": "最大水位", + "title": "Max Level", + "type": "number" + } + }, + { + "description": "直径", + "in": "query", + "name": "diameter", + "required": false, + "schema": { + "default": 0, + "description": "直径", + "title": "Diameter", + "type": "number" + } + }, + { + "description": "最小体积", + "in": "query", + "name": "min_vol", + "required": false, + "schema": { + "default": 0, + "description": "最小体积", + "title": "Min Vol", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "新增水箱", + "tags": [ + "Tanks" + ] + } + }, + "/api/v1/tanks/coord": { + "get": { + "description": "获取指定水箱的X和Y坐标", + "operationId": "get_tanks_coord", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "number" + }, + "title": "Response Get Tanks Coord", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水箱坐标", + "tags": [ + "Tanks" + ] + }, + "patch": { + "description": "设置指定水箱的X和Y坐标", + "operationId": "patch_tanks_coord", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "description": "新的X坐标值", + "in": "query", + "name": "x", + "required": true, + "schema": { + "description": "新的X坐标值", + "title": "X", + "type": "number" + } + }, + { + "description": "新的Y坐标值", + "in": "query", + "name": "y", + "required": true, + "schema": { + "description": "新的Y坐标值", + "title": "Y", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水箱坐标", + "tags": [ + "Tanks" + ] + } + }, + "/api/v1/tanks/diameter": { + "get": { + "description": "获取指定水箱的直径值", + "operationId": "get_tanks_diameter", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Response Get Tanks Diameter" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水箱直径", + "tags": [ + "Tanks" + ] + }, + "patch": { + "description": "设置指定水箱的直径值", + "operationId": "patch_tanks_diameter", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "description": "新的直径值", + "in": "query", + "name": "diameter", + "required": true, + "schema": { + "description": "新的直径值", + "title": "Diameter", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水箱直径", + "tags": [ + "Tanks" + ] + } + }, + "/api/v1/tanks/elevation": { + "get": { + "description": "获取指定水箱的标高值", + "operationId": "get_tanks_elevation", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Response Get Tanks Elevation" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水箱标高", + "tags": [ + "Tanks" + ] + }, + "patch": { + "description": "设置指定水箱的标高值", + "operationId": "patch_tanks_elevation", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "description": "新的标高值", + "in": "query", + "name": "elevation", + "required": true, + "schema": { + "description": "新的标高值", + "title": "Elevation", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水箱标高", + "tags": [ + "Tanks" + ] + } + }, + "/api/v1/tanks/existence": { + "get": { + "description": "检查指定ID是否为水网中的蓄水池", + "operationId": "get_tanks_existence", + "parameters": [ + { + "description": "节点ID", + "in": "query", + "name": "node", + "required": true, + "schema": { + "description": "节点ID", + "title": "Node", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Tanks Existence", + "type": "boolean" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查是否为蓄水池", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/tanks/init-level": { + "get": { + "description": "获取指定水箱的初始水位值", + "operationId": "get_tanks_init_level", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Response Get Tanks Init Level" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水箱初始水位", + "tags": [ + "Tanks" + ] + }, + "patch": { + "description": "设置指定水箱的初始水位值", + "operationId": "patch_tanks_init_level", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "description": "新的初始水位值", + "in": "query", + "name": "init_level", + "required": true, + "schema": { + "description": "新的初始水位值", + "title": "Init Level", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水箱初始水位", + "tags": [ + "Tanks" + ] + } + }, + "/api/v1/tanks/max-level": { + "get": { + "description": "获取指定水箱的最大水位值", + "operationId": "get_tanks_max_level", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Response Get Tanks Max Level" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水箱最大水位", + "tags": [ + "Tanks" + ] + }, + "patch": { + "description": "设置指定水箱的最大水位值", + "operationId": "patch_tanks_max_level", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "description": "新的最大水位值", + "in": "query", + "name": "max_level", + "required": true, + "schema": { + "description": "新的最大水位值", + "title": "Max Level", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水箱最大水位", + "tags": [ + "Tanks" + ] + } + }, + "/api/v1/tanks/min-level": { + "get": { + "description": "获取指定水箱的最小水位值", + "operationId": "get_tanks_min_level", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Response Get Tanks Min Level" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水箱最小水位", + "tags": [ + "Tanks" + ] + }, + "patch": { + "description": "设置指定水箱的最小水位值", + "operationId": "patch_tanks_min_level", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "description": "新的最小水位值", + "in": "query", + "name": "min_level", + "required": true, + "schema": { + "description": "新的最小水位值", + "title": "Min Level", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水箱最小水位", + "tags": [ + "Tanks" + ] + } + }, + "/api/v1/tanks/min-vol": { + "get": { + "description": "获取指定水箱的最小体积值", + "operationId": "get_tanks_min_vol", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Response Get Tanks Min Vol" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水箱最小体积", + "tags": [ + "Tanks" + ] + }, + "patch": { + "description": "设置指定水箱的最小体积值", + "operationId": "patch_tanks_min_vol", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "description": "新的最小体积值", + "in": "query", + "name": "min_vol", + "required": true, + "schema": { + "description": "新的最小体积值", + "title": "Min Vol", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水箱最小体积", + "tags": [ + "Tanks" + ] + } + }, + "/api/v1/tanks/overflow": { + "get": { + "description": "获取指定水箱的溢流口配置", + "operationId": "get_tanks_overflow", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Response Get Tanks Overflow" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水箱溢流口", + "tags": [ + "Tanks" + ] + }, + "patch": { + "description": "设置指定水箱的溢流口配置", + "operationId": "patch_tanks_overflow", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "description": "新的溢流口配置", + "in": "query", + "name": "overflow", + "required": true, + "schema": { + "description": "新的溢流口配置", + "title": "Overflow", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水箱溢流口", + "tags": [ + "Tanks" + ] + } + }, + "/api/v1/tanks/properties": { + "get": { + "description": "获取指定水箱的所有属性", + "operationId": "get_tanks_properties", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Tanks Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水箱属性", + "tags": [ + "Tanks" + ] + }, + "patch": { + "description": "批量设置指定水箱的多个属性", + "operationId": "patch_tanks_properties", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水箱属性", + "tags": [ + "Tanks" + ] + } + }, + "/api/v1/tanks/vol-curve": { + "get": { + "description": "获取指定水箱的容积曲线标识", + "operationId": "get_tanks_vol_curve", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Response Get Tanks Vol Curve" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水箱容积曲线", + "tags": [ + "Tanks" + ] + }, + "patch": { + "description": "设置指定水箱的容积曲线标识", + "operationId": "patch_tanks_vol_curve", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "description": "新的容积曲线标识", + "in": "query", + "name": "vol_curve", + "required": true, + "schema": { + "description": "新的容积曲线标识", + "title": "Vol Curve", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水箱容积曲线", + "tags": [ + "Tanks" + ] + } + }, + "/api/v1/tanks/x": { + "get": { + "description": "获取指定水箱的X坐标值", + "operationId": "get_tanks_x", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Tanks X", + "type": "number" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水箱X坐标", + "tags": [ + "Tanks" + ] + }, + "patch": { + "description": "设置指定水箱的X坐标值", + "operationId": "patch_tanks_x", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "description": "新的X坐标值", + "in": "query", + "name": "x", + "required": true, + "schema": { + "description": "新的X坐标值", + "title": "X", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水箱X坐标", + "tags": [ + "Tanks" + ] + } + }, + "/api/v1/tanks/y": { + "get": { + "description": "获取指定水箱的Y坐标值", + "operationId": "get_tanks_y", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Tanks Y", + "type": "number" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水箱Y坐标", + "tags": [ + "Tanks" + ] + }, + "patch": { + "description": "设置指定水箱的Y坐标值", + "operationId": "patch_tanks_y", + "parameters": [ + { + "description": "水箱ID", + "in": "query", + "name": "tank", + "required": true, + "schema": { + "description": "水箱ID", + "title": "Tank", + "type": "string" + } + }, + { + "description": "新的Y坐标值", + "in": "query", + "name": "y", + "required": true, + "schema": { + "description": "新的Y坐标值", + "title": "Y", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水箱Y坐标", + "tags": [ + "Tanks" + ] + } + }, + "/api/v1/time-properties": { + "patch": { + "description": "更新指定网络中的时间选项属性", + "operationId": "patch_time_properties", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置时间选项属性", + "tags": [ + "Options" + ] + } + }, + "/api/v1/timeseries/realtime/links": { + "delete": { + "description": "按时间范围删除实时管道数据。start_time 和 end_time 必须显式带时区;允许传 UTC+8,服务端按请求中的绝对时间删除对应 UTC 数据。", + "operationId": "delete_timeseries_realtime_links", + "parameters": [ + { + "description": "时间范围开始时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "时间范围开始时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "format": "date-time", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "时间范围结束时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "in": "query", + "name": "end_time", + "required": true, + "schema": { + "description": "时间范围结束时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "format": "date-time", + "title": "End Time", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除实时管道数据", + "tags": [ + "TimescaleDB - Realtime" + ] + }, + "get": { + "description": "按时间范围查询实时管道数据。start_time 和 end_time 必须显式带时区;允许传 UTC+8,服务端会先归一化为 UTC 再执行查询。", + "operationId": "get_timeseries_realtime_links", + "parameters": [ + { + "description": "时间范围开始时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "时间范围开始时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "format": "date-time", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "时间范围结束时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "in": "query", + "name": "end_time", + "required": true, + "schema": { + "description": "时间范围结束时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "format": "date-time", + "title": "End Time", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "查询实时管道数据", + "tags": [ + "TimescaleDB - Realtime" + ] + } + }, + "/api/v1/timeseries/realtime/links/batches": { + "post": { + "description": "批量插入实时管道数据\n\n将管道的实时监测数据批量插入时间序列数据库。\n\nArgs:\n data: 管道数据列表\n \nReturns:\n 插入成功的记录数", + "operationId": "post_timeseries_realtime_links_batches", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "管道数据列表,每项包含管道ID、时间戳等信息", + "items": { + "type": "object" + }, + "title": "Data", + "type": "array" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "批量插入实时管道数据", + "tags": [ + "TimescaleDB - Realtime" + ] + } + }, + "/api/v1/timeseries/realtime/links/{link_id}/field": { + "patch": { + "description": "更新指定管道的字段值\n\n更新实时管道在特定时间的某个字段数据。\n\nArgs:\n link_id: 管道ID\n time: 数据时间戳\n field: 字段名称\n value: 字段新值\n \nReturns:\n 更新结果信息\n \nRaises:\n HTTPException: 当字段不存在或更新失败时返回400错误", + "operationId": "patch_timeseries_realtime_links_link_id_field", + "parameters": [ + { + "description": "管道ID", + "in": "path", + "name": "link_id", + "required": true, + "schema": { + "description": "管道ID", + "title": "Link Id", + "type": "string" + } + }, + { + "description": "要更新记录的时间戳。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "in": "query", + "name": "time", + "required": true, + "schema": { + "description": "要更新记录的时间戳。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "format": "date-time", + "title": "Time", + "type": "string" + } + }, + { + "description": "要更新的字段名称", + "in": "query", + "name": "field", + "required": true, + "schema": { + "description": "要更新的字段名称", + "title": "Field", + "type": "string" + } + }, + { + "description": "更新的字段值", + "in": "query", + "name": "value", + "required": true, + "schema": { + "description": "更新的字段值", + "title": "Value", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "更新实时管道字段", + "tags": [ + "TimescaleDB - Realtime" + ] + } + }, + "/api/v1/timeseries/realtime/nodes": { + "delete": { + "description": "按时间范围删除实时节点数据。start_time 和 end_time 必须显式带时区;允许传 UTC+8,服务端按请求中的绝对时间删除对应 UTC 数据。", + "operationId": "delete_timeseries_realtime_nodes", + "parameters": [ + { + "description": "时间范围开始时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "时间范围开始时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "format": "date-time", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "时间范围结束时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "in": "query", + "name": "end_time", + "required": true, + "schema": { + "description": "时间范围结束时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "format": "date-time", + "title": "End Time", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除实时节点数据", + "tags": [ + "TimescaleDB - Realtime" + ] + }, + "get": { + "description": "按时间范围查询实时节点数据。start_time 和 end_time 必须显式带时区;允许传 UTC+8,服务端会先归一化为 UTC 再执行查询。", + "operationId": "get_timeseries_realtime_nodes", + "parameters": [ + { + "description": "时间范围开始时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "时间范围开始时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "format": "date-time", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "时间范围结束时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "in": "query", + "name": "end_time", + "required": true, + "schema": { + "description": "时间范围结束时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "format": "date-time", + "title": "End Time", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "查询实时节点数据", + "tags": [ + "TimescaleDB - Realtime" + ] + } + }, + "/api/v1/timeseries/realtime/nodes/batches": { + "post": { + "description": "批量插入实时节点数据\n\n将节点的实时监测数据批量插入时间序列数据库。\n\nArgs:\n data: 节点数据列表\n \nReturns:\n 插入成功的记录数", + "operationId": "post_timeseries_realtime_nodes_batches", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "节点数据列表,每项包含节点ID、时间戳等信息", + "items": { + "type": "object" + }, + "title": "Data", + "type": "array" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "批量插入实时节点数据", + "tags": [ + "TimescaleDB - Realtime" + ] + } + }, + "/api/v1/timeseries/realtime/records": { + "get": { + "description": "查询指定时间点的实时属性值。query_time 必须显式带时区;允许传 UTC+8,服务端会先归一化为 UTC 再执行查询。", + "operationId": "get_timeseries_realtime_records", + "parameters": [ + { + "description": "查询时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "in": "query", + "name": "query_time", + "required": true, + "schema": { + "description": "查询时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "title": "Query Time", + "type": "string" + } + }, + { + "description": "数据类型,pipe(管道)或 junction(节点)", + "in": "query", + "name": "type", + "required": true, + "schema": { + "description": "数据类型,pipe(管道)或 junction(节点)", + "title": "Type", + "type": "string" + } + }, + { + "description": "要查询的属性名称", + "in": "query", + "name": "property", + "required": true, + "schema": { + "description": "要查询的属性名称", + "title": "Property", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "按时间和属性查询实时数据", + "tags": [ + "TimescaleDB - Realtime" + ] + } + }, + "/api/v1/timeseries/realtime/simulation-results": { + "get": { + "description": "查询指定元素在某一时间点的实时模拟结果。query_time 必须显式带时区;允许传 UTC+8,服务端会先归一化为 UTC 再执行查询。", + "operationId": "get_timeseries_realtime_simulation_results", + "parameters": [ + { + "description": "元素ID(管道ID或节点ID)", + "in": "query", + "name": "id", + "required": true, + "schema": { + "description": "元素ID(管道ID或节点ID)", + "title": "Id", + "type": "string" + } + }, + { + "description": "元素类型,pipe(管道)或 junction(节点)", + "in": "query", + "name": "type", + "required": true, + "schema": { + "description": "元素类型,pipe(管道)或 junction(节点)", + "title": "Type", + "type": "string" + } + }, + { + "description": "查询时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "in": "query", + "name": "query_time", + "required": true, + "schema": { + "description": "查询时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "title": "Query Time", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "按ID和时间查询实时模拟数据", + "tags": [ + "TimescaleDB - Realtime" + ] + }, + "post": { + "description": "存储实时模拟结果到时间序列数据库\n\n将节点和管道的实时模拟计算结果批量存储到TimescaleDB数据库。\n\nArgs:\n node_result_list: 节点模拟结果列表\n link_result_list: 管道模拟结果列表\n result_start_time: 模拟结果对应的起始时间\n \nReturns:\n 存储结果信息", + "operationId": "post_timeseries_realtime_simulation_results", + "parameters": [ + { + "description": "模拟结果开始时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "in": "query", + "name": "result_start_time", + "required": true, + "schema": { + "description": "模拟结果开始时间。ISO 8601 / RFC 3339 时间,必须显式带时区;可直接传 UTC+8,服务端会先转换为 UTC 再处理。", + "title": "Result Start Time", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_post_timeseries_realtime_simulation_results" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "存储实时模拟结果", + "tags": [ + "TimescaleDB - Realtime" + ] + } + }, + "/api/v1/timeseries/scada-cleaning-runs": { + "post": { + "description": "清洗SCADA监测数据\n\n根据device_ids查询monitored_value,清洗后更新cleaned_value。\n支持清洗指定设备或所有设备的数据。\n\nArgs:\n device_ids: 设备ID列表,用逗号分隔,或 'all' 表示清洗所有设备\n start_time: 清洗数据的开始时间\n end_time: 清洗数据的结束时间\n timescale_conn: TimescaleDB连接\n postgres_conn: PostgreSQL连接\n \nReturns:\n 清洗结果信息\n \nRaises:\n HTTPException: 当清洗过程出现错误时返回400错误", + "operationId": "post_timeseries_scada_cleaning_runs", + "parameters": [ + { + "description": "设备ID列表或 'all' 表示清洗所有设备", + "in": "query", + "name": "device_ids", + "required": true, + "schema": { + "description": "设备ID列表或 'all' 表示清洗所有设备", + "title": "Device Ids", + "type": "string" + } + }, + { + "description": "清洗数据的开始时间", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "清洗数据的开始时间", + "format": "date-time", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "清洗数据的结束时间", + "in": "query", + "name": "end_time", + "required": true, + "schema": { + "description": "清洗数据的结束时间", + "format": "date-time", + "title": "End Time", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "清洗SCADA监测数据", + "tags": [ + "TimescaleDB - Composite" + ] + } + }, + "/api/v1/timeseries/scada-readings": { + "delete": { + "description": "删除指定设备和时间范围内的SCADA数据\n\n删除在指定时间范围内的特定设备监测数据。\n\nArgs:\n device_id: 设备ID\n start_time: 删除开始时间\n end_time: 删除结束时间\n\nReturns:\n 删除结果信息", + "operationId": "delete_timeseries_scada_readings", + "parameters": [ + { + "description": "设备ID", + "in": "query", + "name": "device_id", + "required": true, + "schema": { + "description": "设备ID", + "title": "Device Id", + "type": "string" + } + }, + { + "description": "删除开始时间", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "删除开始时间", + "format": "date-time", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "删除结束时间", + "in": "query", + "name": "end_time", + "required": true, + "schema": { + "description": "删除结束时间", + "format": "date-time", + "title": "End Time", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "按设备ID和时间范围删除SCADA数据", + "tags": [ + "TimescaleDB - SCADA" + ] + }, + "get": { + "description": "按设备ID和时间范围查询SCADA监测数据\n\n查询多个设备在指定时间范围内的所有监测数据。\n\nArgs:\n start_time: 查询开始时间\n end_time: 查询结束时间\n device_ids: 设备ID列表,用逗号分隔\n\nReturns:\n SCADA监测数据列表", + "operationId": "get_timeseries_scada_readings", + "parameters": [ + { + "description": "查询开始时间", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "查询开始时间", + "format": "date-time", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "查询结束时间", + "in": "query", + "name": "end_time", + "required": true, + "schema": { + "description": "查询结束时间", + "format": "date-time", + "title": "End Time", + "type": "string" + } + }, + { + "description": "设备ID列表,逗号分隔,如 'device1,device2,device3'", + "in": "query", + "name": "device_ids", + "required": true, + "schema": { + "description": "设备ID列表,逗号分隔,如 'device1,device2,device3'", + "title": "Device Ids", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "按设备ID和时间范围查询SCADA数据", + "tags": [ + "TimescaleDB - SCADA" + ] + } + }, + "/api/v1/timeseries/scada-readings/batches": { + "post": { + "description": "批量插入SCADA监测数据\n\n将多个设备的实时监测数据批量插入时间序列数据库。\n\nArgs:\n data: SCADA设备监测数据列表,每项包含device_id、时间戳和监测值等信息\n\nReturns:\n 插入成功的记录数", + "operationId": "post_timeseries_scada_readings_batches", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "SCADA设备监测数据列表", + "items": { + "type": "object" + }, + "title": "Data", + "type": "array" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "批量插入SCADA监测数据", + "tags": [ + "TimescaleDB - SCADA" + ] + } + }, + "/api/v1/timeseries/scada-readings/fields": { + "get": { + "description": "按设备ID、字段和时间范围查询特定SCADA数据\n\n查询多个设备在指定时间范围内的特定字段监测数据。\n\nArgs:\n start_time: 查询开始时间\n end_time: 查询结束时间\n field: 字段名称\n device_ids: 设备ID列表,用逗号分隔\n\nReturns:\n SCADA字段数据列表\n\nRaises:\n HTTPException: 当字段不存在或查询参数无效时返回400错误", + "operationId": "get_timeseries_scada_readings_fields", + "parameters": [ + { + "description": "查询开始时间", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "查询开始时间", + "format": "date-time", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "查询结束时间", + "in": "query", + "name": "end_time", + "required": true, + "schema": { + "description": "查询结束时间", + "format": "date-time", + "title": "End Time", + "type": "string" + } + }, + { + "description": "要查询的字段名称", + "in": "query", + "name": "field", + "required": true, + "schema": { + "description": "要查询的字段名称", + "title": "Field", + "type": "string" + } + }, + { + "description": "设备ID列表,逗号分隔,如 'device1,device2,device3'", + "in": "query", + "name": "device_ids", + "required": true, + "schema": { + "description": "设备ID列表,逗号分隔,如 'device1,device2,device3'", + "title": "Device Ids", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "按设备ID、字段和时间范围查询SCADA数据", + "tags": [ + "TimescaleDB - SCADA" + ] + } + }, + "/api/v1/timeseries/scada-readings/{device_id}/field": { + "patch": { + "description": "更新指定设备的字段值\n\n更新SCADA设备在特定时间的某个字段监测数据。\n\nArgs:\n device_id: 设备ID\n time: 数据时间戳\n field: 字段名称\n value: 字段新值\n\nReturns:\n 更新结果信息\n\nRaises:\n HTTPException: 当字段不存在或更新失败时返回400错误", + "operationId": "patch_timeseries_scada_readings_device_id_field", + "parameters": [ + { + "description": "设备ID", + "in": "path", + "name": "device_id", + "required": true, + "schema": { + "description": "设备ID", + "title": "Device Id", + "type": "string" + } + }, + { + "description": "更新数据的时间戳", + "in": "query", + "name": "time", + "required": true, + "schema": { + "description": "更新数据的时间戳", + "format": "date-time", + "title": "Time", + "type": "string" + } + }, + { + "description": "要更新的字段名称", + "in": "query", + "name": "field", + "required": true, + "schema": { + "description": "要更新的字段名称", + "title": "Field", + "type": "string" + } + }, + { + "description": "更新的字段值", + "in": "query", + "name": "value", + "required": true, + "schema": { + "description": "更新的字段值", + "title": "Value", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "更新SCADA设备字段", + "tags": [ + "TimescaleDB - SCADA" + ] + } + }, + "/api/v1/timeseries/schemes/links": { + "delete": { + "description": "删除指定方案和时间范围内的管道数据\n\n删除在指定方案和时间范围内的所有管道模拟数据。\n\nArgs:\n scheme_type: 方案类型\n scheme_name: 方案名称\n start_time: 删除开始时间\n end_time: 删除结束时间\n\nReturns:\n 删除结果信息", + "operationId": "delete_timeseries_schemes_links", + "parameters": [ + { + "description": "方案类型", + "in": "query", + "name": "scheme_type", + "required": true, + "schema": { + "description": "方案类型", + "title": "Scheme Type", + "type": "string" + } + }, + { + "description": "方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "description": "删除开始时间", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "删除开始时间", + "format": "date-time", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "删除结束时间", + "in": "query", + "name": "end_time", + "required": true, + "schema": { + "description": "删除结束时间", + "format": "date-time", + "title": "End Time", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除方案管道数据", + "tags": [ + "TimescaleDB - Scheme" + ] + }, + "get": { + "description": "查询指定方案和时间范围内的管道数据\n\n根据方案和时间范围查询管道的模拟值。\n\nArgs:\n scheme_type: 方案类型\n scheme_name: 方案名称\n start_time: 查询开始时间\n end_time: 查询结束时间\n\nReturns:\n 方案管道数据列表", + "operationId": "get_timeseries_schemes_links", + "parameters": [ + { + "description": "方案类型", + "in": "query", + "name": "scheme_type", + "required": true, + "schema": { + "description": "方案类型", + "title": "Scheme Type", + "type": "string" + } + }, + { + "description": "方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "description": "查询开始时间", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "查询开始时间", + "format": "date-time", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "查询结束时间", + "in": "query", + "name": "end_time", + "required": true, + "schema": { + "description": "查询结束时间", + "format": "date-time", + "title": "End Time", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "查询方案管道数据", + "tags": [ + "TimescaleDB - Scheme" + ] + } + }, + "/api/v1/timeseries/schemes/links/batches": { + "post": { + "description": "批量插入方案管道数据\n\n将特定方案的管道模拟数据批量插入时间序列数据库。\n\nArgs:\n data: 方案管道数据列表\n\nReturns:\n 插入成功的记录数", + "operationId": "post_timeseries_schemes_links_batches", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "方案管道数据列表", + "items": { + "type": "object" + }, + "title": "Data", + "type": "array" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "批量插入方案管道数据", + "tags": [ + "TimescaleDB - Scheme" + ] + } + }, + "/api/v1/timeseries/schemes/links/{link_id}/field": { + "get": { + "description": "查询指定方案管道的特定字段数据\n\n查询特定方案中指定管道在时间范围内的特定字段值。\n\nArgs:\n link_id: 管道ID\n scheme_type: 方案类型\n scheme_name: 方案名称\n start_time: 查询开始时间\n end_time: 查询结束时间\n field: 字段名称\n\nReturns:\n 字段数据列表\n\nRaises:\n HTTPException: 当查询参数无效时返回400错误", + "operationId": "get_timeseries_schemes_links_link_id_field", + "parameters": [ + { + "description": "管道ID", + "in": "path", + "name": "link_id", + "required": true, + "schema": { + "description": "管道ID", + "title": "Link Id", + "type": "string" + } + }, + { + "description": "方案类型", + "in": "query", + "name": "scheme_type", + "required": true, + "schema": { + "description": "方案类型", + "title": "Scheme Type", + "type": "string" + } + }, + { + "description": "方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "description": "查询开始时间", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "查询开始时间", + "format": "date-time", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "查询结束时间", + "in": "query", + "name": "end_time", + "required": true, + "schema": { + "description": "查询结束时间", + "format": "date-time", + "title": "End Time", + "type": "string" + } + }, + { + "description": "要查询的字段名称", + "in": "query", + "name": "field", + "required": true, + "schema": { + "description": "要查询的字段名称", + "title": "Field", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "查询方案管道字段数据", + "tags": [ + "TimescaleDB - Scheme" + ] + }, + "patch": { + "description": "更新指定方案管道的字段值\n\n更新特定方案中指定管道在某个时间的字段数据。\n\nArgs:\n link_id: 管道ID\n scheme_type: 方案类型\n scheme_name: 方案名称\n time: 数据时间戳\n field: 字段名称\n value: 字段新值\n\nReturns:\n 更新结果信息\n\nRaises:\n HTTPException: 当字段不存在或更新失败时返回400错误", + "operationId": "patch_timeseries_schemes_links_link_id_field", + "parameters": [ + { + "description": "管道ID", + "in": "path", + "name": "link_id", + "required": true, + "schema": { + "description": "管道ID", + "title": "Link Id", + "type": "string" + } + }, + { + "description": "方案类型", + "in": "query", + "name": "scheme_type", + "required": true, + "schema": { + "description": "方案类型", + "title": "Scheme Type", + "type": "string" + } + }, + { + "description": "方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "description": "更新数据的时间戳", + "in": "query", + "name": "time", + "required": true, + "schema": { + "description": "更新数据的时间戳", + "format": "date-time", + "title": "Time", + "type": "string" + } + }, + { + "description": "要更新的字段名称", + "in": "query", + "name": "field", + "required": true, + "schema": { + "description": "要更新的字段名称", + "title": "Field", + "type": "string" + } + }, + { + "description": "更新的字段值", + "in": "query", + "name": "value", + "required": true, + "schema": { + "description": "更新的字段值", + "title": "Value", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "更新方案管道字段", + "tags": [ + "TimescaleDB - Scheme" + ] + } + }, + "/api/v1/timeseries/schemes/nodes": { + "delete": { + "description": "删除指定方案和时间范围内的节点数据\n\n删除在指定方案和时间范围内的所有节点模拟数据。\n\nArgs:\n scheme_type: 方案类型\n scheme_name: 方案名称\n start_time: 删除开始时间\n end_time: 删除结束时间\n\nReturns:\n 删除结果信息", + "operationId": "delete_timeseries_schemes_nodes", + "parameters": [ + { + "description": "方案类型", + "in": "query", + "name": "scheme_type", + "required": true, + "schema": { + "description": "方案类型", + "title": "Scheme Type", + "type": "string" + } + }, + { + "description": "方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "description": "删除开始时间", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "删除开始时间", + "format": "date-time", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "删除结束时间", + "in": "query", + "name": "end_time", + "required": true, + "schema": { + "description": "删除结束时间", + "format": "date-time", + "title": "End Time", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除方案节点数据", + "tags": [ + "TimescaleDB - Scheme" + ] + } + }, + "/api/v1/timeseries/schemes/nodes/batches": { + "post": { + "description": "批量插入方案节点数据\n\n将特定方案的节点模拟数据批量插入时间序列数据库。\n\nArgs:\n data: 方案节点数据列表\n\nReturns:\n 插入成功的记录数", + "operationId": "post_timeseries_schemes_nodes_batches", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "方案节点数据列表", + "items": { + "type": "object" + }, + "title": "Data", + "type": "array" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "批量插入方案节点数据", + "tags": [ + "TimescaleDB - Scheme" + ] + } + }, + "/api/v1/timeseries/schemes/nodes/{node_id}/field": { + "get": { + "description": "查询指定方案节点的特定字段数据\n\n查询特定方案中指定节点在时间范围内的特定字段值。\n\nArgs:\n node_id: 节点ID\n scheme_type: 方案类型\n scheme_name: 方案名称\n start_time: 查询开始时间\n end_time: 查询结束时间\n field: 字段名称\n\nReturns:\n 字段数据列表\n\nRaises:\n HTTPException: 当查询参数无效时返回400错误", + "operationId": "get_timeseries_schemes_nodes_node_id_field", + "parameters": [ + { + "description": "节点ID", + "in": "path", + "name": "node_id", + "required": true, + "schema": { + "description": "节点ID", + "title": "Node Id", + "type": "string" + } + }, + { + "description": "方案类型", + "in": "query", + "name": "scheme_type", + "required": true, + "schema": { + "description": "方案类型", + "title": "Scheme Type", + "type": "string" + } + }, + { + "description": "方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "description": "查询开始时间", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "查询开始时间", + "format": "date-time", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "查询结束时间", + "in": "query", + "name": "end_time", + "required": true, + "schema": { + "description": "查询结束时间", + "format": "date-time", + "title": "End Time", + "type": "string" + } + }, + { + "description": "要查询的字段名称", + "in": "query", + "name": "field", + "required": true, + "schema": { + "description": "要查询的字段名称", + "title": "Field", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "查询方案节点字段数据", + "tags": [ + "TimescaleDB - Scheme" + ] + }, + "patch": { + "description": "更新指定方案节点的字段值\n\n更新特定方案中指定节点在某个时间的字段数据。\n\nArgs:\n node_id: 节点ID\n scheme_type: 方案类型\n scheme_name: 方案名称\n time: 数据时间戳\n field: 字段名称\n value: 字段新值\n\nReturns:\n 更新结果信息\n\nRaises:\n HTTPException: 当字段不存在或更新失败时返回400错误", + "operationId": "patch_timeseries_schemes_nodes_node_id_field", + "parameters": [ + { + "description": "节点ID", + "in": "path", + "name": "node_id", + "required": true, + "schema": { + "description": "节点ID", + "title": "Node Id", + "type": "string" + } + }, + { + "description": "方案类型", + "in": "query", + "name": "scheme_type", + "required": true, + "schema": { + "description": "方案类型", + "title": "Scheme Type", + "type": "string" + } + }, + { + "description": "方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "description": "更新数据的时间戳", + "in": "query", + "name": "time", + "required": true, + "schema": { + "description": "更新数据的时间戳", + "format": "date-time", + "title": "Time", + "type": "string" + } + }, + { + "description": "要更新的字段名称", + "in": "query", + "name": "field", + "required": true, + "schema": { + "description": "要更新的字段名称", + "title": "Field", + "type": "string" + } + }, + { + "description": "更新的字段值", + "in": "query", + "name": "value", + "required": true, + "schema": { + "description": "更新的字段值", + "title": "Value", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "更新方案节点字段", + "tags": [ + "TimescaleDB - Scheme" + ] + } + }, + "/api/v1/timeseries/schemes/records": { + "get": { + "description": "按指定方案、时间和属性查询所有方案数据\n\n查询在特定方案和时间点,所有指定类型元素的特定属性值。\n\nArgs:\n scheme_type: 方案类型\n scheme_name: 方案名称\n query_time: 查询时间\n type: 元素类型(pipe或junction)\n property: 属性名称\n\nReturns:\n 查询结果列表\n\nRaises:\n HTTPException: 当查询参数无效时返回400错误", + "operationId": "get_timeseries_schemes_records", + "parameters": [ + { + "description": "方案类型", + "in": "query", + "name": "scheme_type", + "required": true, + "schema": { + "description": "方案类型", + "title": "Scheme Type", + "type": "string" + } + }, + { + "description": "方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "description": "查询时间", + "in": "query", + "name": "query_time", + "required": true, + "schema": { + "description": "查询时间", + "title": "Query Time", + "type": "string" + } + }, + { + "description": "元素类型,pipe(管道)或 junction(节点)", + "in": "query", + "name": "type", + "required": true, + "schema": { + "description": "元素类型,pipe(管道)或 junction(节点)", + "title": "Type", + "type": "string" + } + }, + { + "description": "要查询的属性名称", + "in": "query", + "name": "property", + "required": true, + "schema": { + "description": "要查询的属性名称", + "title": "Property", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "按方案、时间和属性查询数据", + "tags": [ + "TimescaleDB - Scheme" + ] + } + }, + "/api/v1/timeseries/schemes/simulation-results": { + "get": { + "description": "按指定ID和时间查询方案模拟结果\n\n查询特定方案中的元素在某一时间点的模拟数据。\n\nArgs:\n scheme_type: 方案类型\n scheme_name: 方案名称\n id: 元素ID\n type: 元素类型(pipe或junction)\n query_time: 查询时间\n\nReturns:\n 模拟结果数据\n\nRaises:\n HTTPException: 当查询参数无效时返回400错误", + "operationId": "get_timeseries_schemes_simulation_results", + "parameters": [ + { + "description": "方案类型", + "in": "query", + "name": "scheme_type", + "required": true, + "schema": { + "description": "方案类型", + "title": "Scheme Type", + "type": "string" + } + }, + { + "description": "方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "description": "元素ID(管道ID或节点ID)", + "in": "query", + "name": "id", + "required": true, + "schema": { + "description": "元素ID(管道ID或节点ID)", + "title": "Id", + "type": "string" + } + }, + { + "description": "元素类型,pipe(管道)或 junction(节点)", + "in": "query", + "name": "type", + "required": true, + "schema": { + "description": "元素类型,pipe(管道)或 junction(节点)", + "title": "Type", + "type": "string" + } + }, + { + "description": "查询时间", + "in": "query", + "name": "query_time", + "required": true, + "schema": { + "description": "查询时间", + "title": "Query Time", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "按ID和时间查询方案模拟数据", + "tags": [ + "TimescaleDB - Scheme" + ] + }, + "post": { + "description": "存储方案模拟结果到时间序列数据库\n\n将特定方案的节点和管道模拟计算结果批量存储到TimescaleDB数据库。\n\nArgs:\n scheme_type: 方案类型\n scheme_name: 方案名称\n node_result_list: 节点模拟结果列表\n link_result_list: 管道模拟结果列表\n result_start_time: 模拟结果对应的起始时间\n\nReturns:\n 存储结果信息", + "operationId": "post_timeseries_schemes_simulation_results", + "parameters": [ + { + "description": "方案类型", + "in": "query", + "name": "scheme_type", + "required": true, + "schema": { + "description": "方案类型", + "title": "Scheme Type", + "type": "string" + } + }, + { + "description": "方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "description": "模拟结果开始时间", + "in": "query", + "name": "result_start_time", + "required": true, + "schema": { + "description": "模拟结果开始时间", + "title": "Result Start Time", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_post_timeseries_schemes_simulation_results" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "存储方案模拟结果", + "tags": [ + "TimescaleDB - Scheme" + ] + } + }, + "/api/v1/timeseries/views/element-scada-readings": { + "get": { + "description": "获取link/node关联的SCADA监测值\n\n根据传入的link/node id,匹配SCADA信息,\n如果存在关联的SCADA device_id,获取实际的监测数据。\n\nArgs:\n element_id: 管网元素ID\n start_time: 查询开始时间\n end_time: 查询结束时间\n use_cleaned: 是否使用清洗后的数据,默认为False使用原始数据\n timescale_conn: TimescaleDB连接\n postgres_conn: PostgreSQL连接\n \nReturns:\n 管网元素关联的SCADA监测数据\n \nRaises:\n HTTPException: 当查询参数无效时返回400错误,未找到关联数据返回404错误", + "operationId": "get_timeseries_views_element_scada_readings", + "parameters": [ + { + "description": "管网元素ID(管道或节点)", + "in": "query", + "name": "element_id", + "required": true, + "schema": { + "description": "管网元素ID(管道或节点)", + "title": "Element Id", + "type": "string" + } + }, + { + "description": "查询开始时间", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "查询开始时间", + "format": "date-time", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "查询结束时间", + "in": "query", + "name": "end_time", + "required": true, + "schema": { + "description": "查询结束时间", + "format": "date-time", + "title": "End Time", + "type": "string" + } + }, + { + "description": "是否使用清洗后的数据", + "in": "query", + "name": "use_cleaned", + "required": false, + "schema": { + "default": false, + "description": "是否使用清洗后的数据", + "title": "Use Cleaned", + "type": "boolean" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管网元素关联的SCADA监测数据", + "tags": [ + "TimescaleDB - Composite" + ] + } + }, + "/api/v1/timeseries/views/element-simulations": { + "get": { + "description": "获取link/node模拟值\n\n根据传入的featureInfos,找到关联的link/node,\n并根据对应的type,查询对应的模拟数据。支持查询实时或方案数据。\n\nArgs:\n start_time: 查询开始时间\n end_time: 查询结束时间\n feature_infos: 格式为 \"element_id1:type1,element_id2:type2\"\n 例如: \"P1:pipe,J1:junction\"\n scheme_type: 方案类型,若为空则查询实时数据\n scheme_name: 方案名称,若为空则查询实时数据\n timescale_conn: TimescaleDB连接\n \nReturns:\n 管网元素的模拟数据\n \nRaises:\n HTTPException: 当feature_infos为空返回400错误,未找到数据返回404错误,其他错误返回400错误", + "operationId": "get_timeseries_views_element_simulations", + "parameters": [ + { + "description": "查询开始时间", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "查询开始时间", + "format": "date-time", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "查询结束时间", + "in": "query", + "name": "end_time", + "required": true, + "schema": { + "description": "查询结束时间", + "format": "date-time", + "title": "End Time", + "type": "string" + } + }, + { + "description": "特征信息,格式: id1:type1,id2:type2,type为pipe(管道)或junction(节点)", + "in": "query", + "name": "feature_infos", + "required": true, + "schema": { + "description": "特征信息,格式: id1:type1,id2:type2,type为pipe(管道)或junction(节点)", + "title": "Feature Infos", + "type": "string" + } + }, + { + "description": "方案类型,若为空则查询实时数据", + "in": "query", + "name": "scheme_type", + "required": false, + "schema": { + "description": "方案类型,若为空则查询实时数据", + "title": "Scheme Type", + "type": "string" + } + }, + { + "description": "方案名称,若为空则查询实时数据", + "in": "query", + "name": "scheme_name", + "required": false, + "schema": { + "description": "方案名称,若为空则查询实时数据", + "title": "Scheme Name", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取管网元素的模拟数据", + "tags": [ + "TimescaleDB - Composite" + ] + } + }, + "/api/v1/timeseries/views/scada-simulations": { + "get": { + "description": "获取SCADA关联的link/node模拟值\n\n根据传入的SCADA device_ids,找到关联的link/node,\n并根据对应的type,查询对应的模拟数据。支持查询实时或方案数据。\n\nArgs:\n start_time: 查询开始时间\n end_time: 查询结束时间\n device_ids: SCADA设备ID列表,用逗号分隔\n scheme_type: 方案类型,若为空则查询实时数据\n scheme_name: 方案名称,若为空则查询实时数据\n timescale_conn: TimescaleDB连接\n postgres_conn: PostgreSQL连接\n \nReturns:\n SCADA关联的模拟数据\n \nRaises:\n HTTPException: 当查询参数无效时返回400错误,未找到数据时返回404错误", + "operationId": "get_timeseries_views_scada_simulations", + "parameters": [ + { + "description": "查询开始时间", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "查询开始时间", + "format": "date-time", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "查询结束时间", + "in": "query", + "name": "end_time", + "required": true, + "schema": { + "description": "查询结束时间", + "format": "date-time", + "title": "End Time", + "type": "string" + } + }, + { + "description": "SCADA设备ID列表,逗号分隔", + "in": "query", + "name": "device_ids", + "required": true, + "schema": { + "description": "SCADA设备ID列表,逗号分隔", + "title": "Device Ids", + "type": "string" + } + }, + { + "description": "方案类型,若为空则查询实时数据", + "in": "query", + "name": "scheme_type", + "required": false, + "schema": { + "description": "方案类型,若为空则查询实时数据", + "title": "Scheme Type", + "type": "string" + } + }, + { + "description": "方案名称,若为空则查询实时数据", + "in": "query", + "name": "scheme_name", + "required": false, + "schema": { + "description": "方案名称,若为空则查询实时数据", + "title": "Scheme Name", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取SCADA关联的模拟数据", + "tags": [ + "TimescaleDB - Composite" + ] + } + }, + "/api/v1/title-schemas": { + "get": { + "description": "获取指定水网的标题(标题)属性架构定义", + "operationId": "get_title_schemas", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "object" + }, + "title": "Response Get Title Schemas", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取标题属性架构", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/titles": { + "get": { + "description": "获取指定水网的标题(Title)信息", + "operationId": "get_titles", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Titles", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取水网标题属性", + "tags": [ + "Network General" + ] + }, + "patch": { + "description": "设置指定水网的标题(Title)信息", + "operationId": "patch_titles", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置水网标题属性", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/undos": { + "post": { + "description": "撤销网络上最后的一个操作", + "operationId": "post_undos", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "撤销操作", + "tags": [ + "Snapshots" + ] + } + }, + "/api/v1/users": { + "get": { + "description": "获取指定网络的所有用户列表", + "operationId": "get_users", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_Any__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有用户", + "tags": [ + "Users" + ] + } + }, + "/api/v1/users/detail": { + "get": { + "description": "获取指定网络中的单个用户信息", + "operationId": "get_users_detail", + "parameters": [ + { + "description": "用户名", + "in": "query", + "name": "user_name", + "required": true, + "schema": { + "description": "用户名", + "title": "User Name", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Users Detail", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取单个用户", + "tags": [ + "Users" + ] + } + }, + "/api/v1/valve-closure-analyses": { + "post": { + "description": "高级版本的阀门关闭分析,支持同时关闭多个阀门,并在指定持续时间内进行模拟。返回纯文本格式的分析结果。", + "operationId": "post_valve_closure_analyses", + "parameters": [ + { + "description": "阀门关闭开始时间(ISO 8601格式)", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "阀门关闭开始时间(ISO 8601格式)", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "要关闭的阀门ID列表", + "in": "query", + "name": "valves", + "required": true, + "schema": { + "description": "要关闭的阀门ID列表", + "items": { + "type": "string" + }, + "title": "Valves", + "type": "array" + } + }, + { + "description": "模拟持续时间(秒),默认900秒", + "in": "query", + "name": "duration", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "模拟持续时间(秒),默认900秒", + "title": "Duration" + } + }, + { + "description": "阀门关闭方案名称", + "in": "query", + "name": "scheme_name", + "required": true, + "schema": { + "description": "阀门关闭方案名称", + "title": "Scheme Name", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "阀门关闭分析(高级)", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/valve-isolation-analyses": { + "post": { + "description": "分析当发生突发事件时,通过关闭指定阀门进行隔离,确定哪些阀门必须关闭、哪些可选关闭,以及隔离的可行性。", + "operationId": "post_valve_isolation_analyses", + "parameters": [ + { + "description": "发生事故的管段/节点ID列表", + "in": "query", + "name": "accident_element", + "required": true, + "schema": { + "description": "发生事故的管段/节点ID列表", + "items": { + "type": "string" + }, + "title": "Accident Element", + "type": "array" + } + }, + { + "description": "已故障的阀门ID列表(可选)", + "in": "query", + "name": "disabled_valves", + "required": false, + "schema": { + "description": "已故障的阀门ID列表(可选)", + "items": { + "type": "string" + }, + "title": "Disabled Valves", + "type": "array" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "阀门隔离分析", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/valves": { + "delete": { + "description": "从指定的水网中删除指定的阀门", + "operationId": "delete_valves", + "parameters": [ + { + "description": "阀门ID", + "in": "query", + "name": "valve", + "required": true, + "schema": { + "description": "阀门ID", + "title": "Valve", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除阀门", + "tags": [ + "Valves" + ] + }, + "get": { + "description": "获取指定水网中所有阀门的属性", + "operationId": "get_valves", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有阀门属性", + "tags": [ + "Valves" + ] + }, + "post": { + "description": "在指定的水网中添加新的阀门", + "operationId": "post_valves", + "parameters": [ + { + "description": "阀门ID", + "in": "query", + "name": "valve", + "required": true, + "schema": { + "description": "阀门ID", + "title": "Valve", + "type": "string" + } + }, + { + "description": "起点节点ID", + "in": "query", + "name": "node1", + "required": true, + "schema": { + "description": "起点节点ID", + "title": "Node1", + "type": "string" + } + }, + { + "description": "终点节点ID", + "in": "query", + "name": "node2", + "required": true, + "schema": { + "description": "终点节点ID", + "title": "Node2", + "type": "string" + } + }, + { + "description": "阀门直径(mm)", + "in": "query", + "name": "diameter", + "required": false, + "schema": { + "default": 0, + "description": "阀门直径(mm)", + "title": "Diameter", + "type": "number" + } + }, + { + "description": "阀门类型", + "in": "query", + "name": "v_type", + "required": false, + "schema": { + "default": "PRV", + "description": "阀门类型", + "title": "V Type", + "type": "string" + } + }, + { + "description": "阀门开度/设置值", + "in": "query", + "name": "setting", + "required": false, + "schema": { + "default": 0, + "description": "阀门开度/设置值", + "title": "Setting", + "type": "number" + } + }, + { + "description": "损失系数", + "in": "query", + "name": "minor_loss", + "required": false, + "schema": { + "default": 0, + "description": "损失系数", + "title": "Minor Loss", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加阀门", + "tags": [ + "Valves" + ] + } + }, + "/api/v1/valves/diameter": { + "get": { + "description": "获取指定阀门的直径", + "operationId": "get_valves_diameter", + "parameters": [ + { + "description": "阀门ID", + "in": "query", + "name": "valve", + "required": true, + "schema": { + "description": "阀门ID", + "title": "Valve", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Response Get Valves Diameter" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取阀门直径", + "tags": [ + "Valves" + ] + }, + "patch": { + "description": "设置指定阀门的直径", + "operationId": "patch_valves_diameter", + "parameters": [ + { + "description": "阀门ID", + "in": "query", + "name": "valve", + "required": true, + "schema": { + "description": "阀门ID", + "title": "Valve", + "type": "string" + } + }, + { + "description": "新的直径值(mm)", + "in": "query", + "name": "diameter", + "required": true, + "schema": { + "description": "新的直径值(mm)", + "title": "Diameter", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置阀门直径", + "tags": [ + "Valves" + ] + } + }, + "/api/v1/valves/existence": { + "get": { + "description": "检查指定ID是否为水网中的阀门", + "operationId": "get_valves_existence", + "parameters": [ + { + "description": "管线ID", + "in": "query", + "name": "link", + "required": true, + "schema": { + "description": "管线ID", + "title": "Link", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Valves Existence", + "type": "boolean" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "检查是否为阀门", + "tags": [ + "Network General" + ] + } + }, + "/api/v1/valves/minor-loss": { + "get": { + "description": "获取指定阀门的损失系数", + "operationId": "get_valves_minor_loss", + "parameters": [ + { + "description": "阀门ID", + "in": "query", + "name": "valve", + "required": true, + "schema": { + "description": "阀门ID", + "title": "Valve", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Response Get Valves Minor Loss" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取阀门损失系数", + "tags": [ + "Valves" + ] + } + }, + "/api/v1/valves/node1": { + "get": { + "description": "获取指定阀门连接的起点节点ID", + "operationId": "get_valves_node1", + "parameters": [ + { + "description": "阀门ID", + "in": "query", + "name": "valve", + "required": true, + "schema": { + "description": "阀门ID", + "title": "Valve", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Response Get Valves Node1" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取阀门起点节点", + "tags": [ + "Valves" + ] + }, + "patch": { + "description": "设置指定阀门的起点节点", + "operationId": "patch_valves_node1", + "parameters": [ + { + "description": "阀门ID", + "in": "query", + "name": "valve", + "required": true, + "schema": { + "description": "阀门ID", + "title": "Valve", + "type": "string" + } + }, + { + "description": "新的起点节点ID", + "in": "query", + "name": "node1", + "required": true, + "schema": { + "description": "新的起点节点ID", + "title": "Node1", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置阀门起点节点", + "tags": [ + "Valves" + ] + } + }, + "/api/v1/valves/node2": { + "get": { + "description": "获取指定阀门连接的终点节点ID", + "operationId": "get_valves_node2", + "parameters": [ + { + "description": "阀门ID", + "in": "query", + "name": "valve", + "required": true, + "schema": { + "description": "阀门ID", + "title": "Valve", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Response Get Valves Node2" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取阀门终点节点", + "tags": [ + "Valves" + ] + }, + "patch": { + "description": "设置指定阀门的终点节点", + "operationId": "patch_valves_node2", + "parameters": [ + { + "description": "阀门ID", + "in": "query", + "name": "valve", + "required": true, + "schema": { + "description": "阀门ID", + "title": "Valve", + "type": "string" + } + }, + { + "description": "新的终点节点ID", + "in": "query", + "name": "node2", + "required": true, + "schema": { + "description": "新的终点节点ID", + "title": "Node2", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置阀门终点节点", + "tags": [ + "Valves" + ] + } + }, + "/api/v1/valves/properties": { + "get": { + "description": "获取指定阀门的所有属性", + "operationId": "get_valves_properties", + "parameters": [ + { + "description": "阀门ID", + "in": "query", + "name": "valve", + "required": true, + "schema": { + "description": "阀门ID", + "title": "Valve", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Valves Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取阀门所有属性", + "tags": [ + "Valves" + ] + }, + "patch": { + "description": "批量设置指定阀门的多个属性", + "operationId": "patch_valves_properties", + "parameters": [ + { + "description": "阀门ID", + "in": "query", + "name": "valve", + "required": true, + "schema": { + "description": "阀门ID", + "title": "Valve", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "批量设置阀门属性", + "tags": [ + "Valves" + ] + } + }, + "/api/v1/valves/setting": { + "get": { + "description": "获取指定阀门的开度/设置值", + "operationId": "get_valves_setting", + "parameters": [ + { + "description": "阀门ID", + "in": "query", + "name": "valve", + "required": true, + "schema": { + "description": "阀门ID", + "title": "Valve", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Response Get Valves Setting" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取阀门开度", + "tags": [ + "Valves" + ] + }, + "patch": { + "description": "设置指定阀门的开度/设置值", + "operationId": "patch_valves_setting", + "parameters": [ + { + "description": "阀门ID", + "in": "query", + "name": "valve", + "required": true, + "schema": { + "description": "阀门ID", + "title": "Valve", + "type": "string" + } + }, + { + "description": "新的开度值", + "in": "query", + "name": "setting", + "required": true, + "schema": { + "description": "新的开度值", + "title": "Setting", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置阀门开度", + "tags": [ + "Valves" + ] + } + }, + "/api/v1/valves/type": { + "get": { + "description": "获取指定阀门的类型", + "operationId": "get_valves_type", + "parameters": [ + { + "description": "阀门ID", + "in": "query", + "name": "valve", + "required": true, + "schema": { + "description": "阀门ID", + "title": "Valve", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Response Get Valves Type" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取阀门类型", + "tags": [ + "Valves" + ] + }, + "patch": { + "description": "设置指定阀门的类型", + "operationId": "patch_valves_type", + "parameters": [ + { + "description": "阀门ID", + "in": "query", + "name": "valve", + "required": true, + "schema": { + "description": "阀门ID", + "title": "Valve", + "type": "string" + } + }, + { + "description": "新的阀门类型", + "in": "query", + "name": "type", + "required": true, + "schema": { + "description": "新的阀门类型", + "title": "Type", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置阀门类型", + "tags": [ + "Valves" + ] + } + }, + "/api/v1/virtual-district-calculations": { + "post": { + "description": "根据指定的压力监测节点作为中心节点计算虚拟分区方案", + "operationId": "post_virtual_district_calculations", + "parameters": [ + { + "description": "压力监测节点ID列表", + "in": "query", + "name": "centers", + "required": true, + "schema": { + "description": "压力监测节点ID列表", + "items": { + "type": "string" + }, + "title": "Centers", + "type": "array" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "items": {}, + "type": "array" + }, + "title": "Response Post Virtual District Calculations", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "计算虚拟分区", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/virtual-district-generation-runs": { + "post": { + "description": "根据参数自动生成虚拟分区方案", + "operationId": "post_virtual_district_generation_runs", + "parameters": [ + { + "description": "膨胀参数", + "in": "query", + "name": "inflate_delta", + "required": true, + "schema": { + "description": "膨胀参数", + "title": "Inflate Delta", + "type": "number" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "生成虚拟分区", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/virtual-districts": { + "delete": { + "description": "删除指定的虚拟分区", + "operationId": "delete_virtual_districts", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除虚拟分区", + "tags": [ + "Regions & DMAs" + ] + }, + "get": { + "description": "获取指定水网中的所有虚拟分区信息", + "operationId": "get_virtual_districts", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_dict_str__Any__" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有虚拟分区", + "tags": [ + "Regions & DMAs" + ] + }, + "patch": { + "description": "修改指定虚拟分区的属性信息", + "operationId": "patch_virtual_districts", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置虚拟分区属性", + "tags": [ + "Regions & DMAs" + ] + }, + "post": { + "description": "向水网添加一个新的虚拟分区", + "operationId": "post_virtual_districts", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加新虚拟分区", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/virtual-districts/detail": { + "get": { + "description": "获取指定ID的虚拟分区详细信息", + "operationId": "get_virtual_districts_detail", + "parameters": [ + { + "description": "虚拟分区ID", + "in": "query", + "name": "id", + "required": true, + "schema": { + "description": "虚拟分区ID", + "title": "Id", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Virtual Districts Detail", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取虚拟分区信息", + "tags": [ + "Regions & DMAs" + ] + } + }, + "/api/v1/visual-elements": { + "delete": { + "description": "从网络中删除指定的图形元素", + "operationId": "delete_visual_elements", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "删除图形元素", + "tags": [ + "Visuals" + ] + }, + "post": { + "description": "在网络中添加一个新的图形元素", + "operationId": "post_visual_elements", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "添加图形元素", + "tags": [ + "Visuals" + ] + } + }, + "/api/v1/visual-elements/links": { + "get": { + "description": "获取网络中的所有图形元素链接列表", + "operationId": "get_visual_elements_links", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取所有图形元素链接", + "tags": [ + "Visuals" + ] + } + }, + "/api/v1/visual-elements/properties": { + "get": { + "description": "获取指定图形元素的属性信息", + "operationId": "get_visual_elements_properties", + "parameters": [ + { + "description": "图形元素链接", + "in": "query", + "name": "link", + "required": true, + "schema": { + "description": "图形元素链接", + "title": "Link", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Get Visual Elements Properties", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "获取图形元素属性", + "tags": [ + "Visuals" + ] + }, + "patch": { + "description": "更新指定图形元素的属性", + "operationId": "patch_visual_elements_properties", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "设置图形元素属性", + "tags": [ + "Visuals" + ] + } + }, + "/api/v1/water-age-analyses": { + "post": { + "description": "高级版本的水龄分析,在指定时间点进行分析,支持自定义模拟持续时间。返回纯文本格式的分析结果。", + "operationId": "post_water_age_analyses", + "parameters": [ + { + "description": "分析开始时间(ISO 8601格式)", + "in": "query", + "name": "start_time", + "required": true, + "schema": { + "description": "分析开始时间(ISO 8601格式)", + "title": "Start Time", + "type": "string" + } + }, + { + "description": "模拟持续时间(秒)", + "in": "query", + "name": "duration", + "required": true, + "schema": { + "description": "模拟持续时间(秒)", + "title": "Duration", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "水龄分析(高级)", + "tags": [ + "Simulation Control" + ] + } + }, + "/api/v1/web-searches": { + "post": { + "description": "调用 Bocha Web Search API 获取实时网页搜索结果", + "operationId": "post_web_searches", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebSearchRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Response Post Web Searches", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "Web Search", + "tags": [ + "Web Search" + ] + } + }, + "/api/v1/with-servers": { + "post": { + "description": "将网络与服务器同步到指定操作", + "operationId": "post_with_servers", + "parameters": [ + { + "description": "目标操作ID", + "in": "query", + "name": "operation", + "required": true, + "schema": { + "description": "目标操作ID", + "title": "Operation", + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonValue" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Authentication required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Insufficient permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource not found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Resource conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Validation error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "Dependency unavailable" + } + }, + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "summary": "与服务器同步", + "tags": [ + "Snapshots" + ] + } + } + } +} diff --git a/docs/api-style.md b/docs/api-style.md new file mode 100644 index 0000000..89351e2 --- /dev/null +++ b/docs/api-style.md @@ -0,0 +1,22 @@ +# TJWater REST API v1 + +This contract is the public API contract for coordinated TJWater +Server, Agent, Frontend, and CLI releases. + +- Paths use lowercase kebab-case, have no trailing slash, and identify + resources rather than handler actions. +- JSON fields, query parameters, and path parameter names use snake_case. +- Project-scoped requests use `X-Project-Id`; `network` query parameters + are not part of the public contract. +- `GET` is read-only. Synchronous analysis and simulation requests use + `POST` and clients must not retry them automatically. +- JSON errors use `application/problem+json`. +- The static OpenAPI file and `contracts/manifest.json` are release + artifacts even when production runtime documentation is disabled. + +Generate and validate the contract with: + +```bash +conda run -n server python scripts/export_openapi.py +conda run -n server python scripts/check_openapi.py +``` diff --git a/infra/docker/keycloak/README.md b/infra/docker/keycloak/README.md new file mode 100644 index 0000000..fab9ddd --- /dev/null +++ b/infra/docker/keycloak/README.md @@ -0,0 +1,104 @@ +# Keycloak 登录主题 + +`themes/tjwater` 是 TJWater 智慧水务平台的 Keycloak 登录主题。主题继承 +`keycloak.v2`,只覆盖样式、消息和本地 SVG 资源,不修改认证模板或认证流程。 + +## 在管理控制台切换登录主题 + +确认 `themes/tjwater` 已挂载到容器的 +`/opt/keycloak/themes/tjwater`,然后按以下步骤切换: + +1. 打开 Keycloak 管理控制台: + `http://:<端口>/admin/`。 +2. 使用管理员账号登录。 +3. 在左上角选择需要应用主题的 realm,例如 `tjwater`。不要停留在 + `master`,除非确实要修改 `master` realm。 +4. 在左侧菜单进入 `Realm settings`,打开 `Themes` 标签页。 +5. 在 `Login theme` 下拉框中选择 `tjwater`。 +6. 点击 `Save` 保存。 +7. 继续检查业务客户端是否单独指定了登录主题,再从业务前端重新进入登录页。 + +切回 Keycloak 默认登录页时,将 `Login theme` 改为 `keycloak` 并保存。 + +### 检查业务客户端的主题配置 + +Keycloak 的 realm 和 client 都可以设置登录主题。client 的配置优先于 realm。 +因此,即使 `Realm settings > Themes > Login theme` 已选择 `tjwater`,业务 +客户端如果仍指定 `keycloak`,从业务系统跳转后看到的还是默认登录页。 + +以授权地址中包含 `client_id=tjwater` 的业务系统为例: + +1. 确认左上角当前 realm 是 `tjwater`。 +2. 在左侧菜单进入 `Clients`。 +3. 打开 `Client ID` 为 `tjwater` 的客户端。 +4. 在 `Settings` 页面找到 `Login settings > Login theme`。 +5. 将该字段设置为以下任一选项: + - `Choose...`:不在 client 层指定主题,继承 realm 的 `tjwater` 主题, + 推荐使用此方式。 + - `tjwater`:在 client 层明确指定 `tjwater` 主题。 +6. 不要保留 `keycloak`,否则它会覆盖 realm 的主题。 +7. 点击 `Save`,关闭旧登录页,再从业务前端重新发起一次登录。 + +`Choose...` 不是未配置完成,而是表示当前 client 继承 realm 配置。管理控制台 +登录、账户中心和业务系统可能使用不同的 client。某一个入口已经显示 +`tjwater` 主题,并不能证明业务 client 也已正确配置。 + +验证时以业务系统实际生成的 OpenID Connect 授权地址为准,并检查其中的 +`client_id`。浏览器加载的主题资源路径应包含 +`/resources/<版本>/login/tjwater/`;如果路径仍包含 +`/resources/<版本>/login/keycloak/`,说明该 client 仍在使用默认主题。 + +如果 `Login theme` 下拉框中没有 `tjwater`,先检查容器内的主题文件: + +```bash +docker compose \ + --env-file .env \ + -f infra/docker/docker-compose.yml \ + exec -T keycloak \ + test -f /opt/keycloak/themes/tjwater/login/theme.properties +``` + +命令成功但控制台仍未显示主题时,重新创建 Keycloak 容器后再检查: + +```bash +docker compose \ + --env-file .env \ + -f infra/docker/docker-compose.yml \ + up -d --force-recreate keycloak +``` + +主题名称已经正确,但页面仍显示旧样式时,也执行上述命令,并在容器启动后使用 +`Ctrl+F5` 强制刷新登录页,避免继续使用浏览器缓存的 CSS。 + +## 启用 + +先启动 `infra/docker/docker-compose.yml` 中的 Keycloak,再从仓库根目录执行: + +```bash +bash infra/docker/keycloak/configure-theme.sh apply +``` + +脚本默认配置 `tjwater` realm、简体中文默认语言、中英文切换和 +`TJWater 智慧水务平台` 品牌名,并清除 `tjwater` client 对登录主题的覆盖, +使其继承 realm 主题。其他环境可临时覆盖: + +```bash +TJWATER_KEYCLOAK_REALM=example \ +TJWATER_KEYCLOAK_CLIENT_ID=example-web \ +TJWATER_KEYCLOAK_DISPLAY_NAME="示例智慧水务平台" \ +bash infra/docker/keycloak/configure-theme.sh apply +``` + +管理员凭据继续使用 Compose 已注入的 `KC_BOOTSTRAP_ADMIN_USERNAME` / +`KC_BOOTSTRAP_ADMIN_PASSWORD`,并兼容现有的 `KEYCLOAK_ADMIN` / +`KEYCLOAK_ADMIN_PASSWORD`。 + +## 验证与回滚 + +```bash +bash infra/docker/keycloak/configure-theme.sh verify +bash infra/docker/keycloak/configure-theme.sh rollback +``` + +使用 `latest` 镜像时,每次重新拉取 Keycloak 后都应重新执行 `verify`,并在 +1280px、375px 和 320px 视口检查登录、错误提示、忘记密码和 OTP 页面。 diff --git a/infra/docker/keycloak/configure-theme.sh b/infra/docker/keycloak/configure-theme.sh new file mode 100644 index 0000000..2f8f6eb --- /dev/null +++ b/infra/docker/keycloak/configure-theme.sh @@ -0,0 +1,115 @@ +#!/usr/bin/env bash +set -euo pipefail + +action="${1:-apply}" +script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +repo_root="$(cd -- "${script_dir}/../../.." && pwd)" +compose_file="${repo_root}/infra/docker/docker-compose.yml" +realm="${TJWATER_KEYCLOAK_REALM:-tjwater}" +client_id="${TJWATER_KEYCLOAK_CLIENT_ID:-tjwater}" +display_name="${TJWATER_KEYCLOAK_DISPLAY_NAME:-TJWater 智慧水务平台}" + +case "${action}" in + apply|verify|rollback) ;; + *) + echo "用法: bash infra/docker/keycloak/configure-theme.sh [apply|verify|rollback]" >&2 + exit 2 + ;; +esac + +compose_args=(docker compose) +if [[ -f "${repo_root}/.env" ]]; then + compose_args+=(--env-file "${repo_root}/.env") +fi +compose_args+=(-f "${compose_file}") + +"${compose_args[@]}" exec -T \ + -e TJWATER_KEYCLOAK_ACTION="${action}" \ + -e TJWATER_KEYCLOAK_REALM="${realm}" \ + -e TJWATER_KEYCLOAK_CLIENT_ID="${client_id}" \ + -e TJWATER_KEYCLOAK_DISPLAY_NAME="${display_name}" \ + keycloak sh -s <<'KEYCLOAK_SCRIPT' +set -eu + +action="${TJWATER_KEYCLOAK_ACTION}" +realm="${TJWATER_KEYCLOAK_REALM}" +client_id="${TJWATER_KEYCLOAK_CLIENT_ID}" +display_name="${TJWATER_KEYCLOAK_DISPLAY_NAME}" +server_url="${TJWATER_KEYCLOAK_SERVER_URL:-http://127.0.0.1:8080}" +admin_user="${KC_BOOTSTRAP_ADMIN_USERNAME:-${KEYCLOAK_ADMIN:-}}" +admin_password="${KC_BOOTSTRAP_ADMIN_PASSWORD:-${KEYCLOAK_ADMIN_PASSWORD:-}}" +config_file="/tmp/tjwater-kcadm-$$.config" +kcadm="/opt/keycloak/bin/kcadm.sh" + +cleanup() { + rm -f "${config_file}" +} +trap cleanup EXIT + +if [ -z "${admin_user}" ] || [ -z "${admin_password}" ]; then + echo "缺少 Keycloak 管理员用户名或密码环境变量。" >&2 + exit 1 +fi + +if [ "${action}" = "apply" ] && [ ! -f /opt/keycloak/themes/tjwater/login/theme.properties ]; then + echo "未找到 tjwater 登录主题,请检查主题目录挂载。" >&2 + exit 1 +fi + +"${kcadm}" config credentials \ + --config "${config_file}" \ + --server "${server_url}" \ + --realm master \ + --user "${admin_user}" \ + --password "${admin_password}" >/dev/null + +client_uuid="$( + "${kcadm}" get clients \ + --config "${config_file}" \ + --target-realm "${realm}" \ + --query "clientId=${client_id}" \ + --fields id \ + --format csv \ + --noquotes | + sed -n '1p' +)" + +if [ -z "${client_uuid}" ]; then + echo "realm ${realm} 中未找到 client ${client_id}。" >&2 + echo "可通过 TJWATER_KEYCLOAK_CLIENT_ID 指定实际的 client ID。" >&2 + exit 1 +fi + +case "${action}" in + apply) + "${kcadm}" update "realms/${realm}" \ + --config "${config_file}" \ + -s "displayName=${display_name}" \ + -s "displayNameHtml=${display_name}" \ + -s "loginTheme=tjwater" \ + -s "internationalizationEnabled=true" \ + -s 'supportedLocales=["zh-CN","en"]' \ + -s "defaultLocale=zh-CN" >/dev/null + "${kcadm}" update "clients/${client_uuid}" \ + --config "${config_file}" \ + --target-realm "${realm}" \ + --set attributes.login_theme= >/dev/null + echo "已为 realm ${realm} 启用 tjwater 登录主题。" + echo "client ${client_id} 已改为继承 realm 登录主题。" + ;; + rollback) + "${kcadm}" update "realms/${realm}" \ + --config "${config_file}" \ + -s "loginTheme=keycloak" >/dev/null + echo "已将 realm ${realm} 恢复为 Keycloak 默认登录主题。" + ;; +esac + +"${kcadm}" get "realms/${realm}" \ + --config "${config_file}" \ + --fields realm,displayName,loginTheme,internationalizationEnabled,supportedLocales,defaultLocale +"${kcadm}" get "clients/${client_uuid}" \ + --config "${config_file}" \ + --target-realm "${realm}" \ + --fields 'clientId,attributes(login_theme)' +KEYCLOAK_SCRIPT diff --git a/infra/docker/keycloak/themes/tjwater/login/messages/messages_en.properties b/infra/docker/keycloak/themes/tjwater/login/messages/messages_en.properties new file mode 100644 index 0000000..b7790c0 --- /dev/null +++ b/infra/docker/keycloak/themes/tjwater/login/messages/messages_en.properties @@ -0,0 +1,3 @@ +loginAccountTitle=Account sign in +doLogIn=Sign in +doForgotPassword=Forgot password diff --git a/infra/docker/keycloak/themes/tjwater/login/messages/messages_zh_CN.properties b/infra/docker/keycloak/themes/tjwater/login/messages/messages_zh_CN.properties new file mode 100644 index 0000000..30bd332 --- /dev/null +++ b/infra/docker/keycloak/themes/tjwater/login/messages/messages_zh_CN.properties @@ -0,0 +1,9 @@ +loginAccountTitle=账号登录 +usernameOrEmail=用户名或邮箱 +doLogIn=登录 +doForgotPassword=忘记密码 +rememberMe=记住我 +invalidUserMessage=用户名或密码错误 +invalidUsernameOrPasswordMessage=用户名或密码错误 +expiredCodeMessage=登录已超时,请重新登录 +loginTimeout=登录已超时,请重新开始登录 diff --git a/infra/docker/keycloak/themes/tjwater/login/resources/css/tjwater-login.css b/infra/docker/keycloak/themes/tjwater/login/resources/css/tjwater-login.css new file mode 100644 index 0000000..9d84925 --- /dev/null +++ b/infra/docker/keycloak/themes/tjwater/login/resources/css/tjwater-login.css @@ -0,0 +1,535 @@ +:root { + --tjwater-canvas: oklch(0.965 0.014 205); + --tjwater-surface: oklch(0.995 0.004 205); + --tjwater-surface-soft: oklch(0.982 0.008 205); + --tjwater-ink: oklch(0.3 0.055 215); + --tjwater-muted: oklch(0.52 0.035 215); + --tjwater-line: oklch(0.86 0.025 210); + --tjwater-blue: oklch(0.57 0.16 242); + --tjwater-blue-dark: oklch(0.49 0.15 242); + --tjwater-teal: oklch(0.58 0.12 180); + --tjwater-danger: oklch(0.55 0.19 27); + --tjwater-radius-sm: 6px; + --tjwater-radius-md: 12px; + --tjwater-radius-lg: 18px; +} + +html.login-pf { + height: 100%; + min-height: 100%; + overflow-x: hidden; + background: var(--tjwater-canvas); +} + +body#keycloak-bg, +.login-pf body { + min-height: 100%; + margin: 0; + padding: 0; + color: var(--tjwater-ink); + background: var(--tjwater-canvas); + font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", + "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.pf-v5-c-login, +.pf-v5-c-login * { + box-sizing: border-box; +} + +.pf-v5-c-login { + min-height: 100svh; + padding: 0; + background-color: var(--tjwater-canvas); + background-image: + linear-gradient( + 90deg, + transparent 0%, + transparent 50%, + oklch(0.975 0.01 205 / 62%) 68%, + oklch(0.975 0.01 205 / 82%) 100% + ), + url("../img/network-blueprint.svg"); + background-position: center; + background-repeat: no-repeat; + background-size: cover; +} + +.pf-v5-c-login__container { + display: grid; + width: 100%; + max-width: 1720px; + min-height: 100svh; + margin: 0 auto; + padding: clamp(32px, 4.5vw, 76px) clamp(40px, 5vw, 88px); + grid-template-columns: minmax(360px, 1fr) minmax(400px, 460px); + grid-template-areas: "header main"; + align-items: center; + gap: clamp(64px, 8vw, 152px); +} + +#kc-header { + position: relative; + z-index: 0; + grid-area: header; + width: fit-content; + max-width: 100%; + align-self: center; + justify-self: start; + margin: 0; + padding: 0; + isolation: isolate; + animation: tjwater-enter 480ms cubic-bezier(0.16, 1, 0.3, 1) both; +} + +#kc-header::before { + position: absolute; + z-index: -1; + inset: -54px -72px; + background: radial-gradient( + ellipse at center, + oklch(0.925 0.018 205 / 98%) 0%, + oklch(0.925 0.018 205 / 94%) 48%, + oklch(0.925 0.018 205 / 62%) 65%, + transparent 82% + ); + pointer-events: none; + content: ""; +} + +#kc-header-wrapper { + display: flex; + max-width: 680px; + margin: 0; + padding: 0; + flex-direction: column; + align-items: flex-start; + color: var(--tjwater-ink) !important; + font-size: clamp(34px, 3vw, 46px); + font-weight: 720; + line-height: 1.28; + letter-spacing: 0; + text-align: left; + text-transform: none; + text-wrap: balance; +} + +#kc-header-wrapper::before { + width: 56px; + height: 56px; + margin-bottom: 24px; + background: url("../img/logo-mark.svg") center / contain no-repeat; + content: ""; +} + +#kc-header-wrapper::after { + width: 64px; + height: 3px; + margin-top: 26px; + border-radius: 999px; + background: var(--tjwater-teal); + content: ""; +} + +.pf-v5-c-login__main { + grid-area: main; + width: 100%; + max-width: 460px; + margin: 0; + align-self: center; + justify-self: stretch; + overflow: hidden; + border: 0; + border-radius: var(--tjwater-radius-lg); + background: oklch(0.995 0.004 205 / 97%); + box-shadow: + 0 32px 80px rgb(22 65 75 / 16%), + 0 5px 18px rgb(22 65 75 / 9%); + animation: tjwater-enter 520ms 70ms cubic-bezier(0.16, 1, 0.3, 1) both; +} + +.pf-v5-c-login__main-header { + display: grid; + margin: 0; + padding: 36px 36px 18px; + grid-template-columns: minmax(0, 1fr) auto; + gap: 20px; + align-items: center; + border-top: 0; +} + +#kc-page-title { + margin: 0; + color: var(--tjwater-ink); + font-size: 26px; + font-weight: 720; + line-height: 1.4; + letter-spacing: 0; + text-wrap: balance; +} + +.pf-v5-c-login__main-header-utilities { + margin: 0; +} + +.pf-v5-c-login__main-body { + margin: 0; + padding: 0 36px 38px; +} + +.pf-v5-c-form { + gap: 20px; +} + +.pf-v5-c-form__group { + margin: 0; +} + +.pf-v5-c-form__group-label { + padding-bottom: 8px; +} + +.pf-v5-c-form__label-text { + color: var(--tjwater-ink); + font-size: 14px; + font-weight: 650; + line-height: 1.6; +} + +.pf-v5-c-form-control { + min-height: 48px; + overflow: hidden; + border: 1px solid var(--tjwater-line); + border-radius: var(--tjwater-radius-sm); + background: var(--tjwater-surface-soft); + box-shadow: none; + transition-property: border-color, box-shadow, background-color; + transition-duration: 160ms; + transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1); +} + +.pf-v5-c-form-control::before, +.pf-v5-c-form-control::after { + border: 0; +} + +.pf-v5-c-form-control:focus-within { + border-color: var(--tjwater-blue); + background: var(--tjwater-surface); + box-shadow: 0 0 0 3px oklch(0.78 0.1 235 / 28%); +} + +.pf-v5-c-form-control > input, +.pf-v5-c-form-control > select { + min-height: 46px; + padding-inline: 14px; + color: var(--tjwater-ink); + font-size: 16px; + outline: 0; +} + +.pf-v5-c-login__main-header-utilities .pf-v5-c-form-control { + width: 116px; + min-height: 40px; + background: var(--tjwater-surface); +} + +#login-select-toggle { + width: 100%; + min-width: 0; + min-height: 38px; + padding-inline: 12px 32px; + color: var(--tjwater-muted); + font-size: 14px; + cursor: pointer; +} + +.pf-v5-c-form-control.pf-m-error { + border-color: var(--tjwater-danger); +} + +.pf-v5-c-input-group { + gap: 8px; +} + +.pf-v5-c-input-group__item.pf-m-fill { + min-width: 0; +} + +.pf-v5-c-button.pf-m-control { + min-width: 48px; + min-height: 48px; + border: 1px solid var(--tjwater-line); + border-radius: var(--tjwater-radius-sm); + color: var(--tjwater-muted); + background: var(--tjwater-surface-soft); + touch-action: manipulation; + transition-property: color, border-color, background-color, transform; + transition-duration: 160ms; + transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1); +} + +.pf-v5-c-button.pf-m-control:active { + transform: scale(0.96); +} + +.pf-v5-c-button.pf-m-control:focus-visible, +.pf-v5-c-button.pf-m-primary:focus-visible, +.pf-v5-c-button.pf-m-secondary:focus-visible, +a:focus-visible { + outline: 3px solid oklch(0.74 0.12 235 / 60%); + outline-offset: 2px; +} + +.pf-v5-c-form__helper-text { + margin-top: 8px; +} + +.pf-v5-c-helper-text { + min-height: 22px; +} + +.pf-v5-c-helper-text__item-text { + color: var(--tjwater-muted); + line-height: 1.7; +} + +.pf-v5-c-helper-text__item-text a, +#kc-registration a, +.pf-v5-c-login__main-footer a { + color: var(--tjwater-blue-dark); + font-weight: 600; + text-decoration: none; + text-underline-offset: 3px; +} + +.kc-feedback-text.pf-m-error, +.pf-v5-c-helper-text__item.pf-m-error .kc-feedback-text { + color: var(--tjwater-danger); +} + +.pf-v5-c-check__input { + accent-color: var(--tjwater-blue); +} + +.pf-v5-c-check__label { + color: var(--tjwater-muted); + line-height: 1.7; +} + +.pf-v5-c-form__actions { + padding-top: 6px; +} + +.pf-v5-c-button.pf-m-primary { + min-height: 48px; + border: 0; + border-radius: var(--tjwater-radius-md); + color: oklch(0.99 0.004 230); + background: var(--tjwater-blue); + font-size: 16px; + font-weight: 700; + box-shadow: 0 8px 18px oklch(0.48 0.15 242 / 20%); + touch-action: manipulation; + transition-property: transform, background-color, box-shadow; + transition-duration: 160ms; + transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1); +} + +.pf-v5-c-button.pf-m-primary:active { + transform: scale(0.96); + background: var(--tjwater-blue-dark); + box-shadow: 0 4px 10px oklch(0.48 0.15 242 / 18%); +} + +.pf-v5-c-button.pf-m-secondary { + min-height: 44px; + border-radius: var(--tjwater-radius-md); + color: var(--tjwater-blue-dark); + border-color: var(--tjwater-line); +} + +.pf-v5-c-alert { + border-radius: var(--tjwater-radius-md); +} + +.pf-v5-c-login__main-footer { + color: var(--tjwater-muted); + line-height: 1.7; +} + +.pf-v5-c-login__main-footer-band { + margin-top: 26px; + padding: 18px 0 0; + border-top: 1px solid var(--tjwater-line); + background: transparent; +} + +@keyframes tjwater-enter { + from { + opacity: 0; + transform: translateY(12px); + } + + to { + opacity: 1; + transform: translateY(0); + } +} + +@media (hover: hover) { + .pf-v5-c-button.pf-m-primary:hover { + background: var(--tjwater-blue-dark); + box-shadow: 0 10px 22px oklch(0.48 0.15 242 / 25%); + transform: translateY(-1px); + } + + .pf-v5-c-button.pf-m-control:hover { + color: var(--tjwater-blue-dark); + border-color: oklch(0.69 0.08 230); + background: var(--tjwater-surface); + } + + .pf-v5-c-helper-text__item-text a:hover, + #kc-registration a:hover, + .pf-v5-c-login__main-footer a:hover { + text-decoration: underline; + } +} + +@media (max-width: 900px) { + .pf-v5-c-login { + background-image: + linear-gradient(oklch(0.965 0.014 205 / 34%), oklch(0.965 0.014 205 / 34%)), + url("../img/network-blueprint.svg"); + background-position: 34% center; + } + + .pf-v5-c-login__container { + max-width: 560px; + padding: + max(28px, env(safe-area-inset-top)) + max(24px, env(safe-area-inset-right)) + max(32px, env(safe-area-inset-bottom)) + max(24px, env(safe-area-inset-left)); + grid-template-columns: minmax(0, 1fr); + grid-template-areas: + "header" + "main"; + align-content: center; + gap: 24px; + } + + #kc-header-wrapper { + max-width: none; + flex-direction: row; + align-items: center; + gap: 14px; + font-size: clamp(22px, 5vw, 28px); + line-height: 1.4; + } + + #kc-header::before { + inset: -24px -20px; + background: radial-gradient( + ellipse at center, + oklch(0.965 0.014 205 / 98%) 0%, + oklch(0.965 0.014 205 / 88%) 58%, + transparent 84% + ); + } + + #kc-header-wrapper::before { + width: 46px; + height: 46px; + margin: 0; + flex: 0 0 46px; + } + + #kc-header-wrapper::after { + display: none; + } + + .pf-v5-c-login__main { + max-width: none; + } +} + +@media (max-width: 520px) { + .pf-v5-c-login__container { + gap: 18px; + padding-inline: + max(14px, env(safe-area-inset-left)) + max(14px, env(safe-area-inset-right)); + } + + #kc-header-wrapper { + gap: 12px; + font-size: 21px; + } + + #kc-header-wrapper::before { + width: 42px; + height: 42px; + flex-basis: 42px; + } + + .pf-v5-c-login__main { + border-radius: 16px; + } + + .pf-v5-c-login__main-header { + gap: 12px; + padding: 26px 22px 15px; + } + + #kc-page-title { + font-size: 23px; + } + + .pf-v5-c-login__main-header-utilities .pf-v5-c-form-control { + width: 108px; + } + + .pf-v5-c-login__main-body { + padding: 0 22px 28px; + } +} + +@media (max-height: 680px) and (min-width: 901px) { + .pf-v5-c-login__container { + padding-block: 24px; + } + + #kc-header-wrapper::before { + width: 48px; + height: 48px; + margin-bottom: 18px; + } + + #kc-header-wrapper::after { + margin-top: 20px; + } + + .pf-v5-c-login__main-header { + padding-top: 28px; + } + + .pf-v5-c-login__main-body { + padding-bottom: 30px; + } +} + +@media (prefers-reduced-motion: reduce) { + #kc-header, + .pf-v5-c-login__main { + animation: none; + } + + .pf-v5-c-button, + .pf-v5-c-form-control { + transition-duration: 0.01ms; + } +} diff --git a/infra/docker/keycloak/themes/tjwater/login/resources/img/logo-mark.svg b/infra/docker/keycloak/themes/tjwater/login/resources/img/logo-mark.svg new file mode 100644 index 0000000..2fc0336 --- /dev/null +++ b/infra/docker/keycloak/themes/tjwater/login/resources/img/logo-mark.svg @@ -0,0 +1,8 @@ + + TJWater + + + + + + diff --git a/infra/docker/keycloak/themes/tjwater/login/resources/img/network-blueprint.svg b/infra/docker/keycloak/themes/tjwater/login/resources/img/network-blueprint.svg new file mode 100644 index 0000000..52038f1 --- /dev/null +++ b/infra/docker/keycloak/themes/tjwater/login/resources/img/network-blueprint.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/infra/docker/keycloak/themes/tjwater/login/resources/js/locale-labels.js b/infra/docker/keycloak/themes/tjwater/login/resources/js/locale-labels.js new file mode 100644 index 0000000..259f93f --- /dev/null +++ b/infra/docker/keycloak/themes/tjwater/login/resources/js/locale-labels.js @@ -0,0 +1,21 @@ +const localizeLocaleOptions = () => { + const localeSelect = document.querySelector("#login-select-toggle"); + + if (!(localeSelect instanceof HTMLSelectElement)) return; + + for (const option of localeSelect.options) { + const optionUrl = new URL(option.value, window.location.origin); + const locale = optionUrl.searchParams.get("kc_locale"); + + if (locale === "zh-CN") option.textContent = "简体中文"; + if (locale === "en") option.textContent = "English"; + } +}; + +if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", localizeLocaleOptions, { + once: true, + }); +} else { + localizeLocaleOptions(); +} diff --git a/infra/docker/keycloak/themes/tjwater/login/theme.properties b/infra/docker/keycloak/themes/tjwater/login/theme.properties new file mode 100644 index 0000000..d00d8b0 --- /dev/null +++ b/infra/docker/keycloak/themes/tjwater/login/theme.properties @@ -0,0 +1,7 @@ +parent=keycloak.v2 +import=common/keycloak + +styles=css/styles.css css/tjwater-login.css +scripts=js/locale-labels.js +locales=zh-CN,en +darkMode=false diff --git a/scripts/check_openapi.py b/scripts/check_openapi.py new file mode 100644 index 0000000..f01b970 --- /dev/null +++ b/scripts/check_openapi.py @@ -0,0 +1,143 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import argparse +import hashlib +import json +import os +import re +import sys +from pathlib import Path +from typing import Any + +sys.path.insert(0, str(Path(__file__).resolve().parents[1])) + +HTTP_METHODS = {"get", "post", "put", "patch", "delete", "head", "options"} +KEBAB_SEGMENT = re.compile(r"^[a-z0-9]+(?:-[a-z0-9]+)*$") +SNAKE_PARAMETER = re.compile(r"^[a-z][a-z0-9_]*$") + + +def canonical_json(document: dict[str, Any]) -> bytes: + return ( + json.dumps(document, ensure_ascii=False, indent=2, sort_keys=True).encode("utf-8") + + b"\n" + ) + + +def current_contract_bytes() -> bytes: + os.environ.setdefault("ENVIRONMENT", "development") + from app.main import app + + document = app.openapi() + document["info"]["version"] = "1.0.0" + return canonical_json(document) + + +def _iter_operations(document: dict[str, Any]): + for path, path_item in document.get("paths", {}).items(): + for method, operation in path_item.items(): + if method in HTTP_METHODS and isinstance(operation, dict): + yield path, method, operation + + +def validate(document: dict[str, Any]) -> list[str]: + errors: list[str] = [] + operation_ids: set[str] = set() + + for path, method, operation in _iter_operations(document): + if path != path.rstrip("/"): + errors.append(f"{method.upper()} {path}: trailing slash") + if "//" in path: + errors.append(f"{method.upper()} {path}: double slash") + for segment in path.split("/"): + if not segment or (segment.startswith("{") and segment.endswith("}")): + continue + if not KEBAB_SEGMENT.fullmatch(segment): + errors.append(f"{method.upper()} {path}: non-kebab segment {segment!r}") + + operation_id = operation.get("operationId") + if not operation_id: + errors.append(f"{method.upper()} {path}: missing operationId") + elif operation_id in operation_ids: + errors.append(f"{method.upper()} {path}: duplicate operationId {operation_id}") + else: + operation_ids.add(operation_id) + + if not operation.get("tags"): + errors.append(f"{method.upper()} {path}: missing tags") + if not operation.get("summary"): + errors.append(f"{method.upper()} {path}: missing summary") + for parameter in operation.get("parameters", []): + if ( + parameter.get("in") in {"query", "path"} + and not SNAKE_PARAMETER.fullmatch(str(parameter.get("name", ""))) + ): + errors.append( + f"{method.upper()} {path}: non-snake parameter " + f"{parameter.get('name')!r}" + ) + + success_responses = [ + (status, response) + for status, response in operation.get("responses", {}).items() + if str(status).startswith("2") + ] + if not success_responses: + errors.append(f"{method.upper()} {path}: missing success response") + for status, response in success_responses: + if str(status) == "204": + continue + if "content" not in response: + errors.append(f"{method.upper()} {path}: success response has no content schema") + for media in response.get("content", {}).values(): + if media.get("schema") == {}: + errors.append(f"{method.upper()} {path}: empty success schema") + + return errors + + +def main() -> int: + parser = argparse.ArgumentParser(description="Validate TJWater REST OpenAPI invariants") + parser.add_argument( + "contract", + nargs="?", + type=Path, + default=Path("contracts/server-v1.openapi.json"), + ) + parser.add_argument( + "--manifest", + type=Path, + default=Path("contracts/manifest.json"), + ) + args = parser.parse_args() + + raw = args.contract.read_bytes() + document = json.loads(raw) + errors = validate(document) + + manifest = json.loads(args.manifest.read_text(encoding="utf-8")) + expected_hash = manifest["contracts"]["server"]["sha256"] + actual_hash = hashlib.sha256(raw).hexdigest() + if expected_hash != actual_hash: + errors.append( + f"contract hash mismatch: manifest={expected_hash}, actual={actual_hash}" + ) + current = current_contract_bytes() + if raw != current: + errors.append( + "contract is stale: run " + "`python scripts/export_openapi.py` and commit the regenerated files" + ) + + if errors: + print("\n".join(f"- {error}" for error in errors)) + return 1 + print( + f"validated {len(document['paths'])} paths; " + f"sha256={actual_hash}; version={document['info']['version']}" + ) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/export_openapi.py b/scripts/export_openapi.py new file mode 100644 index 0000000..256eeff --- /dev/null +++ b/scripts/export_openapi.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import argparse +import hashlib +import json +import os +import sys +from pathlib import Path +from typing import Any + + +def _canonical_json(document: dict[str, Any]) -> bytes: + return ( + json.dumps(document, ensure_ascii=False, indent=2, sort_keys=True).encode("utf-8") + + b"\n" + ) + + +def main() -> int: + parser = argparse.ArgumentParser(description="Export the TJWater REST v1 OpenAPI contract") + parser.add_argument( + "--output", + type=Path, + default=Path("contracts/server-v1.openapi.json"), + ) + parser.add_argument( + "--manifest", + type=Path, + default=Path("contracts/manifest.json"), + ) + args = parser.parse_args() + + os.environ.setdefault("ENVIRONMENT", "development") + sys.path.insert(0, str(Path(__file__).resolve().parents[1])) + + from app.main import app + + document = app.openapi() + document["info"]["version"] = "1.0.0" + payload = _canonical_json(document) + digest = hashlib.sha256(payload).hexdigest() + + args.output.parent.mkdir(parents=True, exist_ok=True) + args.manifest.parent.mkdir(parents=True, exist_ok=True) + args.output.write_bytes(payload) + args.manifest.write_bytes( + _canonical_json( + { + "contract_version": "1.0.0", + "contracts": { + "server": { + "file": args.output.name, + "sha256": digest, + } + }, + } + ) + ) + print(f"exported {len(document['paths'])} paths to {args.output} ({digest})") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tests/api/test_access_endpoints.py b/tests/api/test_access_endpoints.py index 71c9604..ad09ae8 100644 --- a/tests/api/test_access_endpoints.py +++ b/tests/api/test_access_endpoints.py @@ -34,7 +34,7 @@ def test_access_context_returns_global_admin_permissions_without_project(): repo = SimpleNamespace() client = _build_client(user, repo) - response = client.get("/api/v1/access/context") + response = client.get("/api/v1/access-context") assert response.status_code == 200 payload = response.json() @@ -64,7 +64,7 @@ def test_access_context_returns_project_member_permissions(): client = _build_client(user, repo) response = client.get( - "/api/v1/access/context", + "/api/v1/access-context", headers={"X-Project-Id": str(project_id)}, ) diff --git a/tests/api/test_agent_auth_endpoints.py b/tests/api/test_agent_auth_endpoints.py index 214fd93..088e263 100644 --- a/tests/api/test_agent_auth_endpoints.py +++ b/tests/api/test_agent_auth_endpoints.py @@ -41,7 +41,7 @@ def test_agent_auth_context_returns_metadata_user_and_project_context(): ), ) - response = client.get("/api/v1/agent/auth/context") + response = client.get("/api/v1/agent-auth-context") assert response.status_code == 200 assert response.json() == { @@ -90,7 +90,7 @@ def test_agent_auth_context_propagates_project_auth_failures(): app.dependency_overrides[get_current_keycloak_payload] = lambda: {"exp": 1781183400} client = TestClient(app) - response = client.get("/api/v1/agent/auth/context") + response = client.get("/api/v1/agent-auth-context") assert response.status_code == 403 assert response.json()["detail"] == "No access to project" diff --git a/tests/api/test_api_integration.py b/tests/api/test_api_integration.py index 27ec1eb..b9eb9cb 100755 --- a/tests/api/test_api_integration.py +++ b/tests/api/test_api_integration.py @@ -48,9 +48,9 @@ def test_router_configuration(): routes = [r.path for r in api_router.routes if hasattr(r, "path")] # 验证基础路径是否存在 - assert any("/agent/auth/context" in r for r in routes), "缺少 Agent 认证上下文路由" - assert any("/meta" in r for r in routes), "缺少 Metadata 路由" - assert any("/audit" in r for r in routes), "缺少审计日志路由 (/audit)" + assert "/agent-auth-context" in routes, "缺少 Agent 认证上下文路由" + assert "/projects/current/metadata" in routes, "缺少 Metadata 路由" + assert "/audit-logs" in routes, "缺少审计日志路由" except Exception as e: pytest.fail(f"路由配置检查失败: {e}") diff --git a/tests/api/test_audit_endpoints.py b/tests/api/test_audit_endpoints.py index 5a7c598..2cd9a65 100644 --- a/tests/api/test_audit_endpoints.py +++ b/tests/api/test_audit_endpoints.py @@ -17,7 +17,7 @@ def _build_client( metadata_admin=None, metadata_user=None, ) -> TestClient: - app = build_test_app(audit_endpoint.router, "/audit") + app = build_test_app(audit_endpoint.router, "/api/v1") app.dependency_overrides[audit_endpoint.get_audit_repository] = lambda: repo if metadata_admin is not None: app.dependency_overrides[get_current_metadata_admin] = lambda: metadata_admin @@ -38,7 +38,7 @@ def test_get_audit_logs_passes_filters(): client = _build_client(repo, metadata_admin=object()) response = client.get( - "/audit/logs", + "/api/v1/audit-logs", params={ "action": "LOGIN", "resource_type": "user", @@ -68,7 +68,7 @@ def test_get_audit_logs_count_returns_count_payload(): )() client = _build_client(repo, metadata_admin=object()) - response = client.get("/audit/logs/count", params={"action": "DELETE_USER"}) + response = client.get("/api/v1/audit-logs/count", params={"action": "DELETE_USER"}) assert response.status_code == 200 assert response.json() == {"count": 7} @@ -88,7 +88,7 @@ def test_get_my_audit_logs_forces_current_user_id(): )() client = _build_client(repo, metadata_user=current_user) - response = client.get("/audit/logs/my", params={"limit": 3}) + response = client.get("/api/v1/audit-logs/mine", params={"limit": 3}) assert response.status_code == 200 repo.get_logs.assert_awaited_once() diff --git a/tests/api/test_leakage_endpoints.py b/tests/api/test_leakage_endpoints.py index 8be295b..ecd01d2 100644 --- a/tests/api/test_leakage_endpoints.py +++ b/tests/api/test_leakage_endpoints.py @@ -5,7 +5,7 @@ from app.api.v1.endpoints import leakage as leakage_endpoint def _build_client() -> TestClient: app = FastAPI() - app.include_router(leakage_endpoint.router, prefix="/api/v1/leakage") + app.include_router(leakage_endpoint.router, prefix="/api/v1") app.dependency_overrides[leakage_endpoint.get_current_keycloak_username] = ( lambda: "tester" ) @@ -23,7 +23,7 @@ def test_identify_leakage_success(monkeypatch): ) client = _build_client() response = client.post( - "/api/v1/leakage/identify/", + "/api/v1/leakage-identifications", json={ "network": "demo", "scada_start": "2026-01-01T00:00:00+08:00", diff --git a/tests/api/test_meta_endpoints.py b/tests/api/test_meta_endpoints.py index 6934612..e8ddd3a 100644 --- a/tests/api/test_meta_endpoints.py +++ b/tests/api/test_meta_endpoints.py @@ -59,7 +59,7 @@ def test_meta_project_returns_map_extent(monkeypatch): app.dependency_overrides[module.get_metadata_repository] = lambda: repo client = TestClient(app) - response = client.get("/api/v1/meta/project") + response = client.get("/api/v1/projects/current/metadata") assert response.status_code == 200 assert response.json()["map_extent"] == {"xmin": 1, "ymin": 2, "xmax": 3, "ymax": 4} @@ -81,7 +81,7 @@ def test_meta_db_health_returns_503_for_postgres_errors(monkeypatch): app.dependency_overrides[module.get_project_timescale_connection] = lambda: DummyTimescaleConnection() client = TestClient(app) - response = client.get("/api/v1/meta/db/health") + response = client.get("/api/v1/projects/current/database-health") assert response.status_code == 503 assert response.json()["detail"] == "Project PostgreSQL health check failed: pg unavailable" diff --git a/tests/api/test_model_import_endpoints.py b/tests/api/test_model_import_endpoints.py index 52639ae..4fd52de 100644 --- a/tests/api/test_model_import_endpoints.py +++ b/tests/api/test_model_import_endpoints.py @@ -44,7 +44,7 @@ def test_system_admin_can_import_model_without_project_membership( client = _client(admin=admin, repo=repo) response = client.post( - f"/api/v1/admin/projects/{project_id}/model/import", + f"/api/v1/admin/projects/{project_id}/model-imports", files={"file": ("desktop-model.inp", VALID_INP)}, ) @@ -64,7 +64,7 @@ def test_non_admin_is_denied_model_import(): client = TestClient(app) response = client.post( - f"/api/v1/admin/projects/{uuid4()}/model/import", + f"/api/v1/admin/projects/{uuid4()}/model-imports", files={"file": ("desktop-model.inp", VALID_INP)}, ) @@ -91,7 +91,7 @@ def test_model_import_rejects_non_inp_file(monkeypatch): ) response = client.post( - f"/api/v1/admin/projects/{project_id}/model/import", + f"/api/v1/admin/projects/{project_id}/model-imports", files={"file": ("desktop-model.txt", VALID_INP)}, ) diff --git a/tests/api/test_openapi_contract.py b/tests/api/test_openapi_contract.py new file mode 100644 index 0000000..e590014 --- /dev/null +++ b/tests/api/test_openapi_contract.py @@ -0,0 +1,256 @@ +from __future__ import annotations + +from pathlib import Path +from uuid import uuid4 + +import pytest +from fastapi import FastAPI +from fastapi.routing import APIRoute +from fastapi.testclient import TestClient + +from app.api.v1.endpoints import schemes as schemes_endpoint +from app.api.v1.endpoints import simulation as simulation_endpoint +from app.api.v1.rest_router import api_router, build_rest_router +from app.api.v1.router import api_router as source_api_router +from app.auth.project_dependencies import ProjectContext, get_project_context +from scripts.check_openapi import current_contract_bytes, validate + + +def test_rest_router_preserves_every_distinct_source_operation() -> None: + skipped_names = {"fastapi_get_json", "fastapi_test_dict"} + source_names = { + route.name + for route in source_api_router.routes + if isinstance(route, APIRoute) and route.name not in skipped_names + } + rest_names = { + route.name for route in api_router.routes if isinstance(route, APIRoute) + } + + assert rest_names == source_names + + +def test_rest_router_has_unique_method_path_pairs() -> None: + pairs: list[tuple[str, str]] = [] + for route in api_router.routes: + if not isinstance(route, APIRoute): + continue + pairs.extend((method, route.path) for method in route.methods or set()) + assert len(pairs) == len(set(pairs)) + + +def test_rest_router_rejects_duplicate_method_path_pairs() -> None: + first = APIRoute( + "/duplicate", + lambda: None, + methods={"POST"}, + name="first_endpoint", + ) + second = APIRoute( + "/duplicate", + lambda: None, + methods={"POST"}, + name="second_endpoint", + ) + + with pytest.raises(RuntimeError, match="REST route collision"): + build_rest_router([first, second]) + + +def test_handler_router_defines_only_the_public_rest_operations() -> None: + source_operations = { + (method, route.path) + for route in source_api_router.routes + if isinstance(route, APIRoute) + for method in route.methods or set() + } + public_operations = { + (method, route.path) + for route in api_router.routes + if isinstance(route, APIRoute) + for method in route.methods or set() + } + + assert source_operations == public_operations + assert ("POST", "/burst-analysis") not in source_operations + assert ("GET", "/getpipeproperties/") not in source_operations + + +def test_rest_openapi_satisfies_contract_invariants() -> None: + from fastapi import FastAPI + + app = FastAPI(redirect_slashes=False) + app.include_router(api_router, prefix="/api/v1") + errors = validate(app.openapi()) + assert errors == [] + + +def test_openapi_snapshot_matches_current_application() -> None: + contract = Path(__file__).resolve().parents[2] / "contracts/server-v1.openapi.json" + + assert contract.read_bytes() == current_contract_bytes() + + +def test_rest_contract_uses_header_project_context() -> None: + from fastapi import FastAPI + + app = FastAPI(redirect_slashes=False) + app.include_router(api_router, prefix="/api/v1") + document = app.openapi() + + for path_item in document["paths"].values(): + for operation in path_item.values(): + if not isinstance(operation, dict): + continue + query_names = { + parameter["name"] + for parameter in operation.get("parameters", []) + if parameter.get("in") == "query" + } + assert "network" not in query_names + assert "network_name" not in query_names + + for name, schema in document["components"]["schemas"].items(): + if name.endswith("Rest"): + assert "network" not in schema.get("properties", {}) + assert "network_name" not in schema.get("properties", {}) + + assert "/api/v1/burst-analysis" not in document["paths"] + assert "/api/v1/getpipeproperties/" not in document["paths"] + + pipes_collection = document["paths"]["/api/v1/pipes"]["get"] + query_names = { + parameter["name"] + for parameter in pipes_collection["parameters"] + if parameter["in"] == "query" + } + assert {"limit", "offset"} <= query_names + assert "204" in document["paths"]["/api/v1/pipes"]["delete"]["responses"] + + +def test_side_effecting_analysis_routes_are_post() -> None: + methods_by_path = { + route.path: route.methods + for route in api_router.routes + if isinstance(route, APIRoute) + } + assert methods_by_path["/burst-analyses"] == {"POST"} + assert methods_by_path["/flushing-analyses"] == {"POST"} + assert methods_by_path["/contaminant-simulations"] == {"POST"} + + +def test_valve_isolation_route_uses_the_isolation_handler() -> None: + route = next( + route + for route in api_router.routes + if isinstance(route, APIRoute) + and route.path == "/valve-isolation-analyses" + and route.methods == {"POST"} + ) + + assert route.name == "valve_isolation_endpoint" + + +def test_valve_isolation_runtime_accepts_frontend_query(monkeypatch) -> None: + captured: dict[str, object] = {} + + def fake_analyze_valve_isolation(network, accident_element, disabled_valves): + captured.update( + network=network, + accident_element=accident_element, + disabled_valves=disabled_valves, + ) + return {"isolatable": True, "must_close_valves": ["V-1"]} + + monkeypatch.setattr( + simulation_endpoint, + "analyze_valve_isolation", + fake_analyze_valve_isolation, + ) + app = FastAPI(redirect_slashes=False) + app.include_router(api_router, prefix="/api/v1") + app.dependency_overrides[get_project_context] = lambda: ProjectContext( + project_id=uuid4(), + project_code="fengyang", + user_id=uuid4(), + project_role="member", + ) + + response = TestClient(app, raise_server_exceptions=False).post( + "/api/v1/valve-isolation-analyses", + params=[ + ("accident_element", "P-1"), + ("accident_element", "P-2"), + ("disabled_valves", "V-9"), + ], + ) + + assert response.status_code == 200 + assert response.json() == {"isolatable": True, "must_close_valves": ["V-1"]} + assert captured == { + "network": "fengyang", + "accident_element": ["P-1", "P-2"], + "disabled_valves": ["V-9"], + } + + +def test_scada_cleaning_runs_are_post() -> None: + methods_by_path = { + route.path: route.methods + for route in api_router.routes + if isinstance(route, APIRoute) + } + assert methods_by_path["/timeseries/scada-cleaning-runs"] == {"POST"} + + +def test_sensor_placement_excel_export_is_post() -> None: + methods_by_path = { + route.path: route.methods + for route in api_router.routes + if isinstance(route, APIRoute) + } + assert methods_by_path[ + "/sensor-placement-schemes/{scheme_id}/exports/excel" + ] == {"POST"} + + +def test_rest_runtime_consumes_injected_project_context(monkeypatch) -> None: + captured: dict[str, object] = {} + + def fake_get_all_schemes(network, scheme_type=None, query_date=None): + captured.update( + network=network, + scheme_type=scheme_type, + query_date=query_date, + ) + return [{"scheme_name": "burst_case", "scheme_type": scheme_type}] + + monkeypatch.setattr( + schemes_endpoint, + "get_all_schemes", + fake_get_all_schemes, + ) + app = FastAPI(redirect_slashes=False) + app.include_router(api_router, prefix="/api/v1") + project_context = ProjectContext( + project_id=uuid4(), + project_code="fengyang", + user_id=uuid4(), + project_role="viewer", + ) + app.dependency_overrides[get_project_context] = lambda: project_context + + response = TestClient(app, raise_server_exceptions=False).get( + "/api/v1/schemes", + params={"scheme_type": "burst_analysis"}, + ) + + assert response.status_code == 200 + assert captured == { + "network": "fengyang", + "scheme_type": "burst_analysis", + "query_date": None, + } + assert response.json()["items"] == [ + {"scheme_name": "burst_case", "scheme_type": "burst_analysis"} + ] diff --git a/tests/api/test_project_endpoints.py b/tests/api/test_project_endpoints.py index d92c375..31efb35 100644 --- a/tests/api/test_project_endpoints.py +++ b/tests/api/test_project_endpoints.py @@ -78,7 +78,7 @@ def test_project_info_returns_404_when_missing(monkeypatch): app.dependency_overrides[module.get_metadata_repository] = lambda: repo client = TestClient(app) - response = client.get("/api/v1/project_info/", params={"network": "missing"}) + response = client.get("/api/v1/projects/current", params={"network": "missing"}) assert response.status_code == 404 assert response.json()["detail"] == "Project missing not found" @@ -100,7 +100,7 @@ def test_project_info_returns_project_workspace(monkeypatch): app.dependency_overrides[module.get_metadata_repository] = lambda: repo client = TestClient(app) - response = client.get("/api/v1/project_info/", params={"network": "demo"}) + response = client.get("/api/v1/projects/current", params={"network": "demo"}) assert response.status_code == 200 payload = response.json() @@ -121,7 +121,7 @@ def test_open_project_returns_network_even_when_db_connection_fails(monkeypatch) monkeypatch.setattr(module, "get_pg_db", failing_get_pg_db) client = TestClient(build_test_app(module.router, "/api/v1")) - response = client.post("/api/v1/openproject/", params={"network": "demo"}) + response = client.post("/api/v1/projects/current", params={"network": "demo"}) assert response.status_code == 200 assert response.json() == "demo" @@ -133,11 +133,17 @@ def test_project_lock_lifecycle(monkeypatch): module.lockedPrjs.clear() client = TestClient(build_test_app(module.router, "/api/v1")) - first_lock = client.post("/api/v1/lockproject/", params={"network": "demo"}) - second_lock = client.post("/api/v1/lockproject/", params={"network": "demo"}) - locked_by_me = client.get("/api/v1/isprojectlockedbyme/", params={"network": "demo"}) - unlock = client.post("/api/v1/unlockproject/", params={"network": "demo"}) - locked = client.get("/api/v1/isprojectlocked/", params={"network": "demo"}) + first_lock = client.post("/api/v1/projects/current/lock", params={"network": "demo"}) + second_lock = client.post("/api/v1/projects/current/lock", params={"network": "demo"}) + locked_by_me = client.get( + "/api/v1/projects/current/lock/ownership", + params={"network": "demo"}, + ) + unlock = client.delete( + "/api/v1/projects/current/lock", + params={"network": "demo"}, + ) + locked = client.get("/api/v1/projects/current/lock", params={"network": "demo"}) assert first_lock.json() == 0 assert second_lock.json() == 1 diff --git a/tests/api/test_regions_endpoints.py b/tests/api/test_regions_endpoints.py index b51a9cc..a1d0898 100644 --- a/tests/api/test_regions_endpoints.py +++ b/tests/api/test_regions_endpoints.py @@ -92,8 +92,8 @@ def test_calculate_service_area_contract_uses_only_network(monkeypatch): ) client = TestClient(build_test_app(module.router, "/api/v1")) - response = client.get( - "/api/v1/calculateservicearea/", + response = client.post( + "/api/v1/service-area-calculations", params={"network": "demo", "time_index": 5}, ) schema = client.get("/openapi.json").json() @@ -103,7 +103,7 @@ def test_calculate_service_area_contract_uses_only_network(monkeypatch): assert calls == ["demo"] parameter_names = [ item["name"] - for item in schema["paths"]["/api/v1/calculateservicearea/"]["get"]["parameters"] + for item in schema["paths"]["/api/v1/service-area-calculations"]["post"]["parameters"] ] assert parameter_names == ["network"] @@ -121,7 +121,7 @@ def test_add_district_metering_area_converts_boundary_to_tuples(monkeypatch): client = TestClient(build_test_app(module.router, "/api/v1")) response = client.post( - "/api/v1/adddistrictmeteringarea/", + "/api/v1/district-metering-areas", params={"network": "demo"}, json={"id": "dma-1", "boundary": [[1, 2], [3, 4], [1, 2]]}, ) @@ -145,7 +145,7 @@ def test_generate_virtual_district_reads_centers_from_body(monkeypatch): client = TestClient(build_test_app(module.router, "/api/v1")) response = client.post( - "/api/v1/generatevirtualdistrict/", + "/api/v1/virtual-district-generation-runs", params={"network": "demo", "inflate_delta": 0.75}, json={"centers": ["J1", "J2"]}, ) diff --git a/tests/api/test_sensor_placement_endpoints.py b/tests/api/test_sensor_placement_endpoints.py index a743693..226387c 100644 --- a/tests/api/test_sensor_placement_endpoints.py +++ b/tests/api/test_sensor_placement_endpoints.py @@ -154,7 +154,7 @@ def test_optimize_returns_created_scheme(monkeypatch): monkeypatch.setattr(module, "pressure_sensor_placement_kmeans", optimize) response = _client(module).post( - "/api/v1/sensor-placement-schemes/optimize", + "/api/v1/sensor-placement-optimization-runs", json={ "network": "tjwater", "scheme_name": "北区测压点", @@ -173,7 +173,7 @@ def test_optimize_returns_created_scheme(monkeypatch): def test_optimize_rejects_unsupported_sensor_type(monkeypatch): module = _load_module(monkeypatch) response = _client(module).post( - "/api/v1/sensor-placement-schemes/optimize", + "/api/v1/sensor-placement-optimization-runs", json={ "network": "tjwater", "scheme_name": "北区测流点", @@ -190,7 +190,7 @@ def test_optimize_rejects_unsupported_sensor_type(monkeypatch): def test_optimize_rejects_network_outside_project_context(monkeypatch): module = _load_module(monkeypatch) response = _client(module).post( - "/api/v1/sensor-placement-schemes/optimize", + "/api/v1/sensor-placement-optimization-runs", json={ "network": "other_project", "scheme_name": "越权方案", @@ -207,7 +207,7 @@ def test_optimize_rejects_network_outside_project_context(monkeypatch): def test_optimize_rejects_network_path_traversal(monkeypatch): module = _load_module(monkeypatch) response = _client(module).post( - "/api/v1/sensor-placement-schemes/optimize", + "/api/v1/sensor-placement-optimization-runs", json={ "network": "../other_project", "scheme_name": "非法路径", @@ -224,7 +224,7 @@ def test_optimize_rejects_network_path_traversal(monkeypatch): def test_optimize_rejects_unbounded_sensor_count(monkeypatch): module = _load_module(monkeypatch) response = _client(module).post( - "/api/v1/sensor-placement-schemes/optimize", + "/api/v1/sensor-placement-optimization-runs", json={ "network": "tjwater", "scheme_name": "超大方案", @@ -241,7 +241,7 @@ def test_optimize_rejects_unbounded_sensor_count(monkeypatch): def test_optimize_rejects_viewer_project_role(monkeypatch): module = _load_module(monkeypatch) response = _client(module, project_role="viewer").post( - "/api/v1/sensor-placement-schemes/optimize", + "/api/v1/sensor-placement-optimization-runs", json={ "network": "tjwater", "scheme_name": "只读成员方案", @@ -262,7 +262,7 @@ def test_optimize_rejects_viewer_project_role(monkeypatch): def test_legacy_project_roles_cannot_optimize(monkeypatch, project_role): module = _load_module(monkeypatch) response = _client(module, project_role=project_role).post( - "/api/v1/sensor-placement-schemes/optimize", + "/api/v1/sensor-placement-optimization-runs", json={ "network": "tjwater", "scheme_name": f"{project_role}方案", @@ -284,7 +284,7 @@ def test_optimize_maps_running_project_job_to_409(monkeypatch): monkeypatch.setattr(module, "pressure_sensor_placement_kmeans", conflict) response = _client(module).post( - "/api/v1/sensor-placement-schemes/optimize", + "/api/v1/sensor-placement-optimization-runs", json={ "network": "tjwater", "scheme_name": "并发方案", diff --git a/tests/api/test_simulation_endpoints.py b/tests/api/test_simulation_endpoints.py index cee6eeb..b9e563f 100644 --- a/tests/api/test_simulation_endpoints.py +++ b/tests/api/test_simulation_endpoints.py @@ -118,7 +118,7 @@ def test_run_project_endpoint_returns_plain_text(monkeypatch): monkeypatch.setattr(module, "run_project", lambda network: f"report::{network}") client = TestClient(build_test_app(module.router, "/api/v1")) - response = client.get("/api/v1/runproject/", params={"network": "demo"}) + response = client.post("/api/v1/project-runs", params={"network": "demo"}) assert response.status_code == 200 assert response.text == "report::demo" @@ -143,7 +143,7 @@ def test_scheduling_analysis_maps_request_body(monkeypatch): client = TestClient(build_test_app(module.router, "/api/v1")) response = client.post( - "/api/v1/scheduling_analysis/", + "/api/v1/scheduling-analyses", json={ "network": "demo", "start_time": "2025-01-01T08:00:00+08:00", @@ -177,7 +177,7 @@ def test_project_management_maps_named_arguments(monkeypatch): client = TestClient(build_test_app(module.router, "/api/v1")) response = client.post( - "/api/v1/project_management/", + "/api/v1/project-managements", json={ "network": "demo", "start_time": "2025-01-01T08:00:00+08:00", @@ -260,7 +260,7 @@ def test_runsimulationmanuallybydate_endpoint_accepts_timezone_aware_start_time( client = TestClient(build_test_app(module.router, "/api/v1")) response = client.post( - "/api/v1/runsimulationmanuallybydate/", + "/api/v1/simulation-runs", json={ "name": "demo", "start_time": "2025-01-02T03:04:05+08:00", @@ -280,7 +280,7 @@ def test_runsimulationmanuallybydate_endpoint_rejects_naive_start_time(monkeypat client = TestClient(build_test_app(module.router, "/api/v1")) response = client.post( - "/api/v1/runsimulationmanuallybydate/", + "/api/v1/simulation-runs", json={ "name": "demo", "start_time": "2025-01-02T03:04:05", @@ -302,8 +302,8 @@ def test_valve_close_endpoint_passes_scheme_name(monkeypatch): monkeypatch.setattr(module, "valve_close_analysis", fake_valve_close_analysis) client = TestClient(build_test_app(module.router, "/api/v1")) - response = client.get( - "/api/v1/valve_close_analysis/", + response = client.post( + "/api/v1/valve-closure-analyses", params={ "network": "demo", "start_time": "2025-01-02T03:04:05+08:00", @@ -334,8 +334,8 @@ def test_burst_endpoint_passes_current_username(monkeypatch): monkeypatch.setattr(module, "burst_analysis", fake_burst_analysis) client = _build_authenticated_client(module) - response = client.get( - "/api/v1/burst_analysis/", + response = client.post( + "/api/v1/burst-analyses", params={ "network": "demo", "modify_pattern_start_time": "2025-01-02T03:04:05+08:00", @@ -362,8 +362,8 @@ def test_flushing_endpoint_passes_required_scheme_name(monkeypatch): monkeypatch.setattr(module, "flushing_analysis", fake_flushing_analysis) client = _build_authenticated_client(module) - response = client.get( - "/api/v1/flushing_analysis/", + response = client.post( + "/api/v1/flushing-analyses", params={ "network": "demo", "start_time": "2025-01-02T03:04:05+08:00", @@ -401,8 +401,8 @@ def test_contaminant_endpoint_passes_current_username(monkeypatch): monkeypatch.setattr(module, "contaminant_simulation", fake_contaminant_simulation) client = _build_authenticated_client(module) - response = client.get( - "/api/v1/contaminant_simulation/", + response = client.post( + "/api/v1/contaminant-simulations", params={ "network": "demo", "start_time": "2025-01-02T03:04:05+08:00", @@ -422,8 +422,8 @@ def test_contaminant_endpoint_requires_scheme_name(monkeypatch): module = _load_simulation_module(monkeypatch) client = _build_authenticated_client(module) - response = client.get( - "/api/v1/contaminant_simulation/", + response = client.post( + "/api/v1/contaminant-simulations", params={ "network": "demo", "start_time": "2025-01-02T03:04:05+08:00", diff --git a/tests/unit/test_keycloak_theme_config.py b/tests/unit/test_keycloak_theme_config.py new file mode 100644 index 0000000..caae611 --- /dev/null +++ b/tests/unit/test_keycloak_theme_config.py @@ -0,0 +1,19 @@ +from pathlib import Path + + +THEME_SCRIPT = ( + Path(__file__).resolve().parents[2] + / "infra" + / "docker" + / "keycloak" + / "configure-theme.sh" +) + + +def test_theme_script_clears_client_login_theme_override() -> None: + script = THEME_SCRIPT.read_text(encoding="utf-8") + + assert "TJWATER_KEYCLOAK_CLIENT_ID" in script + assert "sed -n '1p'" in script + assert "--set attributes.login_theme=" in script + assert "client ${client_id} 已改为继承 realm 登录主题。" in script