报警事件日志打印
This commit is contained in:
parent
3d91e84d69
commit
41dd3609f5
|
@ -1,4 +1,5 @@
|
||||||
import json
|
import json
|
||||||
|
import logging
|
||||||
from rest_framework.exceptions import ParseError, APIException
|
from rest_framework.exceptions import ParseError, APIException
|
||||||
from apps.ecm.service import dispatch_dahua_event, dispatch_xunxi_event
|
from apps.ecm.service import dispatch_dahua_event, dispatch_xunxi_event
|
||||||
from apps.hrm.services import HrmService
|
from apps.hrm.services import HrmService
|
||||||
|
@ -17,19 +18,20 @@ from apps.third.serializers import PicSerializer, RequestCommonSerializer
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
import stomp
|
import stomp
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
myLogger = logging.getLogger('log')
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
|
|
||||||
|
|
||||||
class DahuaTestView(MyLoggingMixin, APIView):
|
class DahuaTestView(MyLoggingMixin, APIView):
|
||||||
"""大华测试接口
|
"""大华测试接口
|
||||||
|
|
||||||
大华测试接口
|
大华测试接口
|
||||||
"""
|
"""
|
||||||
permission_classes = [IsAuthenticated]
|
permission_classes = [IsAuthenticated]
|
||||||
|
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
res = dhClient.face_search(path='/media/2022/07/13/three.jpg')
|
res = dhClient.face_search(path='/media/2022/07/13/three.jpg')
|
||||||
|
|
||||||
return Response(res)
|
return Response(res)
|
||||||
|
|
||||||
|
|
||||||
|
@ -263,5 +265,6 @@ class DhCommonViewSet(CreateModelMixin, CustomGenericViewSet):
|
||||||
"""
|
"""
|
||||||
其他报警转到事件派发
|
其他报警转到事件派发
|
||||||
"""
|
"""
|
||||||
|
myLogger.info(data)
|
||||||
dispatch_dahua_event(data=data)
|
dispatch_dahua_event(data=data)
|
||||||
return Response()
|
return Response()
|
||||||
|
|
Loading…
Reference in New Issue