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

Merge branch 'wwr' into 'develop'

tsp_index

See merge request !22
parents a47e7096 f0e2e4e5
......@@ -12,7 +12,8 @@ TSP_15MIN = "poweriot_tsp_15min"
async def meterdata_tsp_current(tsp_id):
"""根据tsp_id获取redis实时数据"""
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):
......
......@@ -39,9 +39,9 @@ async def real_time_service(tsp_id):
tsp_ts = tsp_dic["timestamp"]
if now_ts - tsp_ts > constants.REAL_EXP_TIME:
return DtResp()
pm2_5 = tsp_dic.get("pm25")
pm10 = tsp_dic.get("pm10")
tsp = tsp_dic.get("tsp")
pm2_5 = tsp_dic.get("pm25", "")
pm10 = tsp_dic.get("pm10", "")
tsp = tsp_dic.get("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:
start = body.start
end = body.end
# return await tsp_contrast_deviation_service(tsp_id, start, end)
return TcdResp()
return TcdResp(pm2_5={}, pm10={})
@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