瀏覽代碼

荣耀推送回执接口

locky 1 年之前
父節點
當前提交
0ba5381df8
共有 2 個文件被更改,包括 18 次插入0 次删除
  1. 1 0
      AnsjerPush/urls.py
  2. 17 0
      Controller/ShadowController.py

+ 1 - 0
AnsjerPush/urls.py

@@ -8,6 +8,7 @@ from Controller.Cron import CronTaskController
 urlpatterns = [
 urlpatterns = [
     path('deviceShadow/generateUTK', ShadowController.generate_utk),
     path('deviceShadow/generateUTK', ShadowController.generate_utk),
     path('deviceShadow/decryptETK', ShadowController.decrypt_etk),
     path('deviceShadow/decryptETK', ShadowController.decrypt_etk),
+    path('honorPush/receipt', ShadowController.honor_push_receipt),
     path('deviceShadow/update', ShadowController.update_device_shadow),
     path('deviceShadow/update', ShadowController.update_device_shadow),
 
 
     path('notify/push', DetectController.NotificationView.as_view()),
     path('notify/push', DetectController.NotificationView.as_view()),

+ 17 - 0
Controller/ShadowController.py

@@ -71,6 +71,23 @@ def decrypt_etk(request):
     return response.json(0, {'uid': uid})
     return response.json(0, {'uid': uid})
 
 
 
 
+def honor_push_receipt(request):
+    """
+    荣耀推送回执
+    """
+    request.encoding = 'utf-8'
+    response = ResponseObject()
+    if request.method == 'GET':
+        request_dict = request.GET
+    elif request.method == 'POST':
+        request_dict = request.POST
+    else:
+        return response.json(444, 'wrong method')
+    logger = logging.getLogger('info')
+    logger.info('荣耀推送回执:{}'.format(request_dict))
+    return response.json(0)
+
+
 def update_device_shadow(request):
 def update_device_shadow(request):
     """
     """
     设备生成或更新(复位时)设备影子
     设备生成或更新(复位时)设备影子