AgentCustomerController.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # -*- encoding: utf-8 -*-
  2. """
  3. @File : AgentCustomerController.py
  4. @Time : 2024/3/7 16:56
  5. @Author : stephen
  6. @Email : zhangdongming@asj6.wecom.work
  7. @Software: PyCharm
  8. """
  9. from django.http import QueryDict
  10. from django.views import View
  11. from datetime import datetime
  12. from AgentModel.models import AgentCustomerInfo, AgentCustomerCard, AgentCustomerPackage, AgentCloudServicePackage
  13. from Model.models import UnicomCombo, Store_Meal
  14. from Object.ResponseObject import ResponseObject
  15. from Object.TokenObject import TokenObject
  16. class AgentCustomerView(View):
  17. def get(self, request, *args, **kwargs):
  18. request.encoding = 'utf-8'
  19. operation = kwargs.get('operation')
  20. return self.validation(request.GET, request, operation)
  21. def post(self, request, *args, **kwargs):
  22. request.encoding = 'utf-8'
  23. operation = kwargs.get('operation')
  24. return self.validation(request.POST, request, operation)
  25. def delete(self, request, *args, **kwargs):
  26. request.encoding = 'utf-8'
  27. operation = kwargs.get('operation')
  28. delete = QueryDict(request.body)
  29. if not delete:
  30. delete = request.GET
  31. return self.validation(delete, request, operation)
  32. def put(self, request, *args, **kwargs):
  33. request.encoding = 'utf-8'
  34. operation = kwargs.get('operation')
  35. put = QueryDict(request.body)
  36. return self.validation(put, request, operation)
  37. def validation(self, request_dict, request, operation):
  38. AgentCustomerInfo.objects.filter()
  39. pass