KoubeiCateringPosStallModifyModel.py 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class KoubeiCateringPosStallModifyModel(object):
  6. def __init__(self):
  7. self._dish_ids = None
  8. self._id = None
  9. self._printer_id = None
  10. self._printer_type = None
  11. self._receipt_type = None
  12. self._shop_id = None
  13. self._stall_name = None
  14. self._use = None
  15. @property
  16. def dish_ids(self):
  17. return self._dish_ids
  18. @dish_ids.setter
  19. def dish_ids(self, value):
  20. if isinstance(value, list):
  21. self._dish_ids = list()
  22. for i in value:
  23. self._dish_ids.append(i)
  24. @property
  25. def id(self):
  26. return self._id
  27. @id.setter
  28. def id(self, value):
  29. self._id = value
  30. @property
  31. def printer_id(self):
  32. return self._printer_id
  33. @printer_id.setter
  34. def printer_id(self, value):
  35. self._printer_id = value
  36. @property
  37. def printer_type(self):
  38. return self._printer_type
  39. @printer_type.setter
  40. def printer_type(self, value):
  41. self._printer_type = value
  42. @property
  43. def receipt_type(self):
  44. return self._receipt_type
  45. @receipt_type.setter
  46. def receipt_type(self, value):
  47. self._receipt_type = value
  48. @property
  49. def shop_id(self):
  50. return self._shop_id
  51. @shop_id.setter
  52. def shop_id(self, value):
  53. self._shop_id = value
  54. @property
  55. def stall_name(self):
  56. return self._stall_name
  57. @stall_name.setter
  58. def stall_name(self, value):
  59. self._stall_name = value
  60. @property
  61. def use(self):
  62. return self._use
  63. @use.setter
  64. def use(self, value):
  65. self._use = value
  66. def to_alipay_dict(self):
  67. params = dict()
  68. if self.dish_ids:
  69. if isinstance(self.dish_ids, list):
  70. for i in range(0, len(self.dish_ids)):
  71. element = self.dish_ids[i]
  72. if hasattr(element, 'to_alipay_dict'):
  73. self.dish_ids[i] = element.to_alipay_dict()
  74. if hasattr(self.dish_ids, 'to_alipay_dict'):
  75. params['dish_ids'] = self.dish_ids.to_alipay_dict()
  76. else:
  77. params['dish_ids'] = self.dish_ids
  78. if self.id:
  79. if hasattr(self.id, 'to_alipay_dict'):
  80. params['id'] = self.id.to_alipay_dict()
  81. else:
  82. params['id'] = self.id
  83. if self.printer_id:
  84. if hasattr(self.printer_id, 'to_alipay_dict'):
  85. params['printer_id'] = self.printer_id.to_alipay_dict()
  86. else:
  87. params['printer_id'] = self.printer_id
  88. if self.printer_type:
  89. if hasattr(self.printer_type, 'to_alipay_dict'):
  90. params['printer_type'] = self.printer_type.to_alipay_dict()
  91. else:
  92. params['printer_type'] = self.printer_type
  93. if self.receipt_type:
  94. if hasattr(self.receipt_type, 'to_alipay_dict'):
  95. params['receipt_type'] = self.receipt_type.to_alipay_dict()
  96. else:
  97. params['receipt_type'] = self.receipt_type
  98. if self.shop_id:
  99. if hasattr(self.shop_id, 'to_alipay_dict'):
  100. params['shop_id'] = self.shop_id.to_alipay_dict()
  101. else:
  102. params['shop_id'] = self.shop_id
  103. if self.stall_name:
  104. if hasattr(self.stall_name, 'to_alipay_dict'):
  105. params['stall_name'] = self.stall_name.to_alipay_dict()
  106. else:
  107. params['stall_name'] = self.stall_name
  108. if self.use:
  109. if hasattr(self.use, 'to_alipay_dict'):
  110. params['use'] = self.use.to_alipay_dict()
  111. else:
  112. params['use'] = self.use
  113. return params
  114. @staticmethod
  115. def from_alipay_dict(d):
  116. if not d:
  117. return None
  118. o = KoubeiCateringPosStallModifyModel()
  119. if 'dish_ids' in d:
  120. o.dish_ids = d['dish_ids']
  121. if 'id' in d:
  122. o.id = d['id']
  123. if 'printer_id' in d:
  124. o.printer_id = d['printer_id']
  125. if 'printer_type' in d:
  126. o.printer_type = d['printer_type']
  127. if 'receipt_type' in d:
  128. o.receipt_type = d['receipt_type']
  129. if 'shop_id' in d:
  130. o.shop_id = d['shop_id']
  131. if 'stall_name' in d:
  132. o.stall_name = d['stall_name']
  133. if 'use' in d:
  134. o.use = d['use']
  135. return o