|
@@ -31,6 +31,10 @@ class InitView(View):
|
|
|
def validation(self, request_dict, operation):
|
|
|
if operation == 'health-check': # 负载均衡器健康检测接口
|
|
|
return self.health_check(request_dict)
|
|
|
+ elif operation == 'health-check-server': # 负载均衡器健康检测接口-server
|
|
|
+ return self.health_check_server(request_dict)
|
|
|
+ elif operation == 'health-check-push': # 负载均衡器健康检测接口-push
|
|
|
+ return self.health_check_push(request_dict)
|
|
|
elif operation == 'delete-account': # 网页删除账号
|
|
|
return self.delete_account(request_dict)
|
|
|
|
|
@@ -46,6 +50,28 @@ class InitView(View):
|
|
|
except Exception as e:
|
|
|
return HttpResponse(repr(e), status=500)
|
|
|
|
|
|
+ @staticmethod
|
|
|
+ def health_check_server(request_dict):
|
|
|
+ try:
|
|
|
+ redis_obj = RedisObject()
|
|
|
+ redis_obj.set_data('health_check', 1)
|
|
|
+ response = ResponseObject()
|
|
|
+ Device_Info.objects.filter().values('id').first()
|
|
|
+ return response.json(0)
|
|
|
+ except Exception as e:
|
|
|
+ return HttpResponse(repr(e), status=500)
|
|
|
+
|
|
|
+ @staticmethod
|
|
|
+ def health_check_push(request_dict):
|
|
|
+ try:
|
|
|
+ redis_obj = RedisObject()
|
|
|
+ redis_obj.set_data('health_check', 1)
|
|
|
+ response = ResponseObject()
|
|
|
+ SceneLog.objects.filter().values('id').first()
|
|
|
+ return response.json(0)
|
|
|
+ except Exception as e:
|
|
|
+ return HttpResponse(repr(e), status=500)
|
|
|
+
|
|
|
@staticmethod
|
|
|
def delete_account(request_dict):
|
|
|
"""
|