KbdishPracticeInfo.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class KbdishPracticeInfo(object):
  6. def __init__(self):
  7. self._dish_id = None
  8. self._increase_mode = None
  9. self._increase_price = None
  10. self._practice_name = None
  11. @property
  12. def dish_id(self):
  13. return self._dish_id
  14. @dish_id.setter
  15. def dish_id(self, value):
  16. self._dish_id = value
  17. @property
  18. def increase_mode(self):
  19. return self._increase_mode
  20. @increase_mode.setter
  21. def increase_mode(self, value):
  22. self._increase_mode = value
  23. @property
  24. def increase_price(self):
  25. return self._increase_price
  26. @increase_price.setter
  27. def increase_price(self, value):
  28. self._increase_price = value
  29. @property
  30. def practice_name(self):
  31. return self._practice_name
  32. @practice_name.setter
  33. def practice_name(self, value):
  34. self._practice_name = value
  35. def to_alipay_dict(self):
  36. params = dict()
  37. if self.dish_id:
  38. if hasattr(self.dish_id, 'to_alipay_dict'):
  39. params['dish_id'] = self.dish_id.to_alipay_dict()
  40. else:
  41. params['dish_id'] = self.dish_id
  42. if self.increase_mode:
  43. if hasattr(self.increase_mode, 'to_alipay_dict'):
  44. params['increase_mode'] = self.increase_mode.to_alipay_dict()
  45. else:
  46. params['increase_mode'] = self.increase_mode
  47. if self.increase_price:
  48. if hasattr(self.increase_price, 'to_alipay_dict'):
  49. params['increase_price'] = self.increase_price.to_alipay_dict()
  50. else:
  51. params['increase_price'] = self.increase_price
  52. if self.practice_name:
  53. if hasattr(self.practice_name, 'to_alipay_dict'):
  54. params['practice_name'] = self.practice_name.to_alipay_dict()
  55. else:
  56. params['practice_name'] = self.practice_name
  57. return params
  58. @staticmethod
  59. def from_alipay_dict(d):
  60. if not d:
  61. return None
  62. o = KbdishPracticeInfo()
  63. if 'dish_id' in d:
  64. o.dish_id = d['dish_id']
  65. if 'increase_mode' in d:
  66. o.increase_mode = d['increase_mode']
  67. if 'increase_price' in d:
  68. o.increase_price = d['increase_price']
  69. if 'practice_name' in d:
  70. o.practice_name = d['practice_name']
  71. return o