ErrorDishEntity.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class ErrorDishEntity(object):
  6. def __init__(self):
  7. self._dish_id = None
  8. self._dish_name = None
  9. @property
  10. def dish_id(self):
  11. return self._dish_id
  12. @dish_id.setter
  13. def dish_id(self, value):
  14. self._dish_id = value
  15. @property
  16. def dish_name(self):
  17. return self._dish_name
  18. @dish_name.setter
  19. def dish_name(self, value):
  20. self._dish_name = value
  21. def to_alipay_dict(self):
  22. params = dict()
  23. if self.dish_id:
  24. if hasattr(self.dish_id, 'to_alipay_dict'):
  25. params['dish_id'] = self.dish_id.to_alipay_dict()
  26. else:
  27. params['dish_id'] = self.dish_id
  28. if self.dish_name:
  29. if hasattr(self.dish_name, 'to_alipay_dict'):
  30. params['dish_name'] = self.dish_name.to_alipay_dict()
  31. else:
  32. params['dish_name'] = self.dish_name
  33. return params
  34. @staticmethod
  35. def from_alipay_dict(d):
  36. if not d:
  37. return None
  38. o = ErrorDishEntity()
  39. if 'dish_id' in d:
  40. o.dish_id = d['dish_id']
  41. if 'dish_name' in d:
  42. o.dish_name = d['dish_name']
  43. return o