KoubeiCateringPosStallCreateModel.py 3.7 KB

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