You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

parameters.py 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. from api.settings import RetCode
  2. class ParametersBase:
  3. def to_dict(self):
  4. d = {}
  5. for k, v in self.__dict__.items():
  6. d[k] = v
  7. return d
  8. class ClientAuthenticationParameters(ParametersBase):
  9. def __init__(self, full_path, headers, form, data, json):
  10. self.full_path = full_path
  11. self.headers = headers
  12. self.form = form
  13. self.data = data
  14. self.json = json
  15. class ClientAuthenticationReturn(ParametersBase):
  16. def __init__(self, code=RetCode.SUCCESS, message="success"):
  17. self.code = code
  18. self.message = message
  19. class SignatureParameters(ParametersBase):
  20. def __init__(self, party_id, body):
  21. self.party_id = party_id
  22. self.body = body
  23. class SignatureReturn(ParametersBase):
  24. def __init__(self, code=RetCode.SUCCESS, site_signature=None):
  25. self.code = code
  26. self.site_signature = site_signature
  27. class AuthenticationParameters(ParametersBase):
  28. def __init__(self, site_signature, body):
  29. self.site_signature = site_signature
  30. self.body = body
  31. class AuthenticationReturn(ParametersBase):
  32. def __init__(self, code=RetCode.SUCCESS, message="success"):
  33. self.code = code
  34. self.message = message
  35. class PermissionReturn(ParametersBase):
  36. def __init__(self, code=RetCode.SUCCESS, message="success"):
  37. self.code = code
  38. self.message = message