From 12d631f5b71980f4a15e02fc903286927d4712fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Thu, 23 Jun 2022 23:59:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4log>400?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/hrm/services.py | 6 ++++++ apps/third/views.py | 6 +++--- apps/utils/dahua.py | 4 ++-- apps/utils/mixins.py | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/hrm/services.py b/apps/hrm/services.py index de958aac..92bbde94 100755 --- a/apps/hrm/services.py +++ b/apps/hrm/services.py @@ -133,3 +133,9 @@ class HrmService: _, res = dhClient.request(**dhapis['card_add'], json=json_data) dh_face_card = res['id'] return {'dh_id': dh_id, 'dh_photo': dh_photo, 'dh_face_card': dh_face_card} + + def swipe(cls, data:dict): + """ + 刷卡事件 + """ + pass \ No newline at end of file diff --git a/apps/third/views.py b/apps/third/views.py index dc04fa69..3a6f076c 100755 --- a/apps/third/views.py +++ b/apps/third/views.py @@ -170,9 +170,9 @@ class DhCommonViewSet(CreateModelMixin, CustomGenericViewSet): "monitor": settings.BASE_URL + '/api/third/dahua/mq/', "monitorType": "url", "events": [ - { - "category": "business", - }, + # { + # "category": "business", + # }, { "category": "alarm", }, diff --git a/apps/utils/dahua.py b/apps/utils/dahua.py index f225dd26..2d1dc903 100755 --- a/apps/utils/dahua.py +++ b/apps/utils/dahua.py @@ -72,8 +72,8 @@ class DhClient: if raise_exception: raise APIException(**DH_REQUEST_ERROR) return 'error', DH_REQUEST_ERROR - if settings.DEBUG: - print_roundtrip(r) + # if settings.DEBUG: + # print_roundtrip(r) if r.status_code == 200: ret = r.json() if ret.get('code') == '27001007': diff --git a/apps/utils/mixins.py b/apps/utils/mixins.py index 419816fe..949ab776 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 not in (401, 403)) + ) and (response.status_code > 404) def _clean_data(self, data): """