From bf6116aa46a9faa559e0024af4562216320c5173 Mon Sep 17 00:00:00 2001 From: DingZQ Date: Wed, 7 May 2025 21:06:08 +0800 Subject: [PATCH] Add API getallburstlocateresults --- api/__init__.py | 2 ++ api/s43_burst_locate_result.py | 6 ++++++ main.py | 6 ++++++ tjnetwork.py | 6 ++++++ 4 files changed, 20 insertions(+) create mode 100644 api/s43_burst_locate_result.py diff --git a/api/__init__.py b/api/__init__.py index dc8ef5a..dbb8ab3 100644 --- a/api/__init__.py +++ b/api/__init__.py @@ -171,3 +171,5 @@ from .s40_schema import get_scheme_schema, get_scheme, get_all_schemes from .s41_pipe_risk_probability import get_pipe_risk_probability_now, get_pipe_risk_probability, get_network_pipe_risk_probability_now, get_pipes_risk_probability, get_pipe_risk_probability_geometries from .s42_sensor_placement import get_all_sensor_placements + +from .s43_burst_locate_result import get_all_burst_locate_results diff --git a/api/s43_burst_locate_result.py b/api/s43_burst_locate_result.py new file mode 100644 index 0000000..ac26463 --- /dev/null +++ b/api/s43_burst_locate_result.py @@ -0,0 +1,6 @@ +from .database import * +from .s0_base import * +import json + +def get_all_burst_locate_results(name: str) -> list[dict[Any, Any]]: + return read_all(name, "select * from burst_locate_result") \ No newline at end of file diff --git a/main.py b/main.py index 72298cc..fe5f1b7 100644 --- a/main.py +++ b/main.py @@ -2245,6 +2245,12 @@ async def fastapi_get_all_sensor_placements(network: str) -> list[dict[Any, Any] return get_all_sensor_placements(network) +############################################################ +# burst_locate_result 43 +############################################################ +@app.get('/getallburstlocateresults/') +async def fastapi_get_all_burst_locate_results(network: str) -> list[dict[Any, Any]]: + return get_all_burst_locate_results(network) diff --git a/tjnetwork.py b/tjnetwork.py index 936853e..402496d 100644 --- a/tjnetwork.py +++ b/tjnetwork.py @@ -1338,5 +1338,11 @@ def get_pipe_risk_probability_geometries(name: str) -> dict[str, Any]: def get_all_sensor_placements(name: str) -> list[dict[Any, Any]]: return api.get_all_sensor_placements(name) +############################################################ +# burst_locate_result 43 +############################################################ +def get_all_burst_locate_results(name: str) -> list[dict[Any, Any]]: + return api.get_all_burst_locate_results(name) +