diff --git a/apps/ecm/service.py b/apps/ecm/service.py index 2d73cff3..f4faf998 100644 --- a/apps/ecm/service.py +++ b/apps/ecm/service.py @@ -15,4 +15,23 @@ class EcmService: def dispatch_xunxi_event(data:dict): """分发寻息事件进行处理 """ - pass \ No newline at end of file + if data.type == 'rail': + if data.data.type == 1: + # 围栏进入 + pass + elif data.data.type == 2: + # 围栏离开 + pass + elif data.type == 'onKeyAlarm': + # 一键呼救 + pass + elif data.type == 'onOffLine': + if data.data.online: + # 标签定位在线 + pass + else: + # 标签定位离线 + pass + elif data.type == 'lowpower': + # 低电量 + pass \ No newline at end of file diff --git a/apps/third/views.py b/apps/third/views.py index 8b29c4fc..eed1fbf3 100755 --- a/apps/third/views.py +++ b/apps/third/views.py @@ -75,7 +75,7 @@ class XxListener(stomp.ConnectionListener): def on_message(self, frame): data = json.loads(frame.body) - + EcmService.dispatch_xunxi_event(data) print('received a message "%s"' % frame.body) diff --git a/apps/utils/mixins.py b/apps/utils/mixins.py index 949ab776..f255da7c 100755 --- a/apps/utils/mixins.py +++ b/apps/utils/mixins.py @@ -240,7 +240,7 @@ class MyLoggingMixin(object): """ return ( self.logging_methods == "__all__" or request.method in self.logging_methods - ) and (response.status_code > 404) + ) and (response.status_code not in [401, 403, 404]) def _clean_data(self, data): """