Răsfoiți Sursa

推送消息接口增加位置消息字段

lang 3 ani în urmă
părinte
comite
ef9c082d31
1 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  1. 3 2
      Controller/DetectControllerV2.py

+ 3 - 2
Controller/DetectControllerV2.py

@@ -13,7 +13,7 @@
 """
 import os
 import time
-
+import json
 import apns2
 import jpush as jpush
 import oss2
@@ -319,7 +319,7 @@ class DetectControllerViewV2(View):
         if not qs.exists():
             return response.json(0, {'datas': [], 'count': 0})
         qs = qs.values('id', 'devUid', 'devNickName', 'Channel', 'eventType', 'status', 'alarm', 'eventTime',
-                       'receiveTime', 'is_st', 'addTime', 'storage_location')
+                       'receiveTime', 'is_st', 'addTime', 'storage_location', 'borderCoords')
 
         count = qs.count()
         qr = qs[(page - 1) * line:page * line]
@@ -346,6 +346,7 @@ class DetectControllerViewV2(View):
             eventTime = p['eventTime']
             channel = p['Channel']
             storage_location = p['storage_location']
+            p['borderCoords'] = json.loads(p['borderCoords'])
             if p['is_st'] == 1:
                 thumbspng = '{uid}/{channel}/{time}.jpeg'.format(uid=devUid, channel=p['Channel'], time=eventTime)
                 if storage_location == 1:   # oss