Commit 5f4887a7 authored by ZZH's avatar ZZH

add opendata test 2023-12-12

parent 6d5b0a5c
...@@ -150,7 +150,7 @@ async def post_home_page_lst_alarm(req, body: HomeLstAlarmReq) -> \ ...@@ -150,7 +150,7 @@ async def post_home_page_lst_alarm(req, body: HomeLstAlarmReq) -> \
storey_ids = [item["storey_id"] for item in storeys] storey_ids = [item["storey_id"] for item in storeys]
return await new_list_alarm_service(cid, storey_ids, page_num, page_size, return await new_list_alarm_service(cid, storey_ids, page_num, page_size,
start, end, importance, point_ids, start, end, importance, point_ids,
+ product) product)
@summary("首页-运行趋势") @summary("首页-运行趋势")
...@@ -173,3 +173,24 @@ async def post_home_page_alarm_stats(req, body: HomeAlarmStatsReq) -> \ ...@@ -173,3 +173,24 @@ async def post_home_page_alarm_stats(req, body: HomeAlarmStatsReq) -> \
illegal_ele_app=sr.illegal_ele_app, illegal_ele_app=sr.illegal_ele_app,
power_quality=sr.power_quality power_quality=sr.power_quality
) )
async def main():
from pot_libs.logger import slowlog
cid = 223
# start = "2023-11-30 08:10:59"
# end = "2023-11-30 09:22:59"
storeys = await storey_by_cid(cid)
storey_ids = [item["storey_id"] for item in storeys]
while True:
rlt = await new_list_alarm_service(cid, storey_ids, 0, 100,
None, None, [1, 2], None, 4)
slowlog.info(f"alarms:{rlt}")
print(rlt)
await asyncio.sleep(300)
if __name__ == '__main__':
import asyncio
asyncio.get_event_loop().run_until_complete(main())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment