ItemOrderVO.py 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class ItemOrderVO(object):
  6. def __init__(self):
  7. self._ext_info = None
  8. self._item_order_no = None
  9. self._merchant_fund = None
  10. self._platform_fund = None
  11. self._price = None
  12. self._quantity = None
  13. self._sku_id = None
  14. self._status = None
  15. @property
  16. def ext_info(self):
  17. return self._ext_info
  18. @ext_info.setter
  19. def ext_info(self, value):
  20. self._ext_info = value
  21. @property
  22. def item_order_no(self):
  23. return self._item_order_no
  24. @item_order_no.setter
  25. def item_order_no(self, value):
  26. self._item_order_no = value
  27. @property
  28. def merchant_fund(self):
  29. return self._merchant_fund
  30. @merchant_fund.setter
  31. def merchant_fund(self, value):
  32. self._merchant_fund = value
  33. @property
  34. def platform_fund(self):
  35. return self._platform_fund
  36. @platform_fund.setter
  37. def platform_fund(self, value):
  38. self._platform_fund = value
  39. @property
  40. def price(self):
  41. return self._price
  42. @price.setter
  43. def price(self, value):
  44. self._price = value
  45. @property
  46. def quantity(self):
  47. return self._quantity
  48. @quantity.setter
  49. def quantity(self, value):
  50. self._quantity = value
  51. @property
  52. def sku_id(self):
  53. return self._sku_id
  54. @sku_id.setter
  55. def sku_id(self, value):
  56. self._sku_id = value
  57. @property
  58. def status(self):
  59. return self._status
  60. @status.setter
  61. def status(self, value):
  62. self._status = value
  63. def to_alipay_dict(self):
  64. params = dict()
  65. if self.ext_info:
  66. if hasattr(self.ext_info, 'to_alipay_dict'):
  67. params['ext_info'] = self.ext_info.to_alipay_dict()
  68. else:
  69. params['ext_info'] = self.ext_info
  70. if self.item_order_no:
  71. if hasattr(self.item_order_no, 'to_alipay_dict'):
  72. params['item_order_no'] = self.item_order_no.to_alipay_dict()
  73. else:
  74. params['item_order_no'] = self.item_order_no
  75. if self.merchant_fund:
  76. if hasattr(self.merchant_fund, 'to_alipay_dict'):
  77. params['merchant_fund'] = self.merchant_fund.to_alipay_dict()
  78. else:
  79. params['merchant_fund'] = self.merchant_fund
  80. if self.platform_fund:
  81. if hasattr(self.platform_fund, 'to_alipay_dict'):
  82. params['platform_fund'] = self.platform_fund.to_alipay_dict()
  83. else:
  84. params['platform_fund'] = self.platform_fund
  85. if self.price:
  86. if hasattr(self.price, 'to_alipay_dict'):
  87. params['price'] = self.price.to_alipay_dict()
  88. else:
  89. params['price'] = self.price
  90. if self.quantity:
  91. if hasattr(self.quantity, 'to_alipay_dict'):
  92. params['quantity'] = self.quantity.to_alipay_dict()
  93. else:
  94. params['quantity'] = self.quantity
  95. if self.sku_id:
  96. if hasattr(self.sku_id, 'to_alipay_dict'):
  97. params['sku_id'] = self.sku_id.to_alipay_dict()
  98. else:
  99. params['sku_id'] = self.sku_id
  100. if self.status:
  101. if hasattr(self.status, 'to_alipay_dict'):
  102. params['status'] = self.status.to_alipay_dict()
  103. else:
  104. params['status'] = self.status
  105. return params
  106. @staticmethod
  107. def from_alipay_dict(d):
  108. if not d:
  109. return None
  110. o = ItemOrderVO()
  111. if 'ext_info' in d:
  112. o.ext_info = d['ext_info']
  113. if 'item_order_no' in d:
  114. o.item_order_no = d['item_order_no']
  115. if 'merchant_fund' in d:
  116. o.merchant_fund = d['merchant_fund']
  117. if 'platform_fund' in d:
  118. o.platform_fund = d['platform_fund']
  119. if 'price' in d:
  120. o.price = d['price']
  121. if 'quantity' in d:
  122. o.quantity = d['quantity']
  123. if 'sku_id' in d:
  124. o.sku_id = d['sku_id']
  125. if 'status' in d:
  126. o.status = d['status']
  127. return o