Commit f0e2e4e5 authored by wang.wenrong's avatar wang.wenrong

tsp_index

parent e2a22fde
...@@ -12,7 +12,8 @@ TSP_15MIN = "poweriot_tsp_15min" ...@@ -12,7 +12,8 @@ TSP_15MIN = "poweriot_tsp_15min"
async def meterdata_tsp_current(tsp_id): async def meterdata_tsp_current(tsp_id):
"""根据tsp_id获取redis实时数据""" """根据tsp_id获取redis实时数据"""
res = await RedisUtils().hget(TSP_CURRENT, tsp_id) res = await RedisUtils().hget(TSP_CURRENT, tsp_id)
return json.loads(res) res =json.loads(res) if res else {}
return res
async def tsp_histogram_tsp_id(date_start, date_end, tsp_id, interval): async def tsp_histogram_tsp_id(date_start, date_end, tsp_id, interval):
......
...@@ -39,9 +39,9 @@ async def real_time_service(tsp_id): ...@@ -39,9 +39,9 @@ async def real_time_service(tsp_id):
tsp_ts = tsp_dic["timestamp"] tsp_ts = tsp_dic["timestamp"]
if now_ts - tsp_ts > constants.REAL_EXP_TIME: if now_ts - tsp_ts > constants.REAL_EXP_TIME:
return DtResp() return DtResp()
pm2_5 = tsp_dic.get("pm25") pm2_5 = tsp_dic.get("pm25", "")
pm10 = tsp_dic.get("pm10") pm10 = tsp_dic.get("pm10", "")
tsp = tsp_dic.get("tsp") tsp = tsp_dic.get("tsp", "")
return DtResp(pm2_5=pm2_5, pm10=pm10, tsp=tsp) return DtResp(pm2_5=pm2_5, pm10=pm10, tsp=tsp)
......
...@@ -69,7 +69,7 @@ async def post_tsp_contrast_deviation(req, body: TisReq) -> TcdResp: ...@@ -69,7 +69,7 @@ async def post_tsp_contrast_deviation(req, body: TisReq) -> TcdResp:
start = body.start start = body.start
end = body.end end = body.end
# return await tsp_contrast_deviation_service(tsp_id, start, end) # return await tsp_contrast_deviation_service(tsp_id, start, end)
return TcdResp() return TcdResp(pm2_5={}, pm10={})
@summary("统计分析-扬尘-描述") @summary("统计分析-扬尘-描述")
......
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