| 1234567891011121314151617181920212223242526272829 | 
							- # @Author    : Rocky
 
- # @File      : InitController.py
 
- # @Time      : 2023/4/11 17:26
 
- from django.http import HttpResponse
 
- from django.views import View
 
- from Object.ResponseObject import ResponseObject
 
- class InitView(View):
 
-     def get(self, request, *args, **kwargs):
 
-         request.encoding = 'utf-8'
 
-         operation = kwargs.get('operation')
 
-         return self.validation(request.GET, operation)
 
-     def post(self, request, *args, **kwargs):
 
-         request.encoding = 'utf-8'
 
-         operation = kwargs.get('operation')
 
-         return self.validation(request.POST, operation)
 
-     def validation(self, request_dict, operation):
 
-         if operation == 'health-check':  # 负载均衡器健康检测接口
 
-             return self.health_check(request_dict)
 
-     @staticmethod
 
-     def health_check(request_dict):
 
-         response = ResponseObject()
 
-         return response.json(0)
 
 
  |