From 765f34d5c62e2b9cc508bbec74113437943b004e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Fri, 24 Jun 2022 15:51:05 +0800 Subject: [PATCH] =?UTF-8?q?hrm=20=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ecm/service.py | 21 ++++++++++++++++++++- apps/third/views.py | 2 +- apps/utils/mixins.py | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) 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): """