Add API queryallrecordsbydateproperty

This commit is contained in:
DingZQ
2025-03-04 21:06:52 +08:00
parent 05569f8859
commit afa26a561f
2 changed files with 10 additions and 2 deletions

View File

@@ -2145,6 +2145,13 @@ async def fastapi_query_all_records_by_date(querydate: str) -> dict[str, list]:
return { "nodes": results[0],
"links": results[1] }
# 查询指定日期、类型、属性的所有记录
# 返回 [{'time': '2024-01-01T00:00:00Z', 'ID': '1', 'value': 1.0}, {'time': '2024-01-01T00:00:00Z', 'ID': '2', 'value': 2.0}]
@app.get("/queryallrecordsbydateproperty/")
async def fastapi_query_all_records_by_date_property(querydate: str, querytype: str, property: str) -> list[dict[str, float|str]]:
return influxdb_api.query_all_record_by_date_property(query_date=querydate, type=querytype, property=property, client=influx_client)
# def query_curve_by_ID_property_daterange(ID: str, type: str, property: str, start_date: str, end_date: str, bucket: str="realtime_data", client: InfluxDBClient=client) -> list:
@app.get("/querynodecurvebyidpropertydaterange/")

View File

@@ -5,9 +5,10 @@ Setup instructions for WMH's work
2. import history_pattern_flow.csv
run python online_Analysis.py
Should manullay change code
Should manually change code
3. run create_template.py
4. run influxdb_api.py
在InfluxDB数据库中创建好我们需要的bucket
create buckets