MarketInfo.py 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class MarketInfo(object):
  6. def __init__(self):
  7. self._activity_icon = None
  8. self._activity_id = None
  9. self._activity_record = None
  10. self._activity_url = None
  11. self._effective_end = None
  12. self._effective_start = None
  13. self._last_platform = None
  14. self._last_store_id = None
  15. self._priority_booth = None
  16. self._status = None
  17. @property
  18. def activity_icon(self):
  19. return self._activity_icon
  20. @activity_icon.setter
  21. def activity_icon(self, value):
  22. self._activity_icon = value
  23. @property
  24. def activity_id(self):
  25. return self._activity_id
  26. @activity_id.setter
  27. def activity_id(self, value):
  28. self._activity_id = value
  29. @property
  30. def activity_record(self):
  31. return self._activity_record
  32. @activity_record.setter
  33. def activity_record(self, value):
  34. self._activity_record = value
  35. @property
  36. def activity_url(self):
  37. return self._activity_url
  38. @activity_url.setter
  39. def activity_url(self, value):
  40. self._activity_url = value
  41. @property
  42. def effective_end(self):
  43. return self._effective_end
  44. @effective_end.setter
  45. def effective_end(self, value):
  46. self._effective_end = value
  47. @property
  48. def effective_start(self):
  49. return self._effective_start
  50. @effective_start.setter
  51. def effective_start(self, value):
  52. self._effective_start = value
  53. @property
  54. def last_platform(self):
  55. return self._last_platform
  56. @last_platform.setter
  57. def last_platform(self, value):
  58. self._last_platform = value
  59. @property
  60. def last_store_id(self):
  61. return self._last_store_id
  62. @last_store_id.setter
  63. def last_store_id(self, value):
  64. self._last_store_id = value
  65. @property
  66. def priority_booth(self):
  67. return self._priority_booth
  68. @priority_booth.setter
  69. def priority_booth(self, value):
  70. self._priority_booth = value
  71. @property
  72. def status(self):
  73. return self._status
  74. @status.setter
  75. def status(self, value):
  76. self._status = value
  77. def to_alipay_dict(self):
  78. params = dict()
  79. if self.activity_icon:
  80. if hasattr(self.activity_icon, 'to_alipay_dict'):
  81. params['activity_icon'] = self.activity_icon.to_alipay_dict()
  82. else:
  83. params['activity_icon'] = self.activity_icon
  84. if self.activity_id:
  85. if hasattr(self.activity_id, 'to_alipay_dict'):
  86. params['activity_id'] = self.activity_id.to_alipay_dict()
  87. else:
  88. params['activity_id'] = self.activity_id
  89. if self.activity_record:
  90. if hasattr(self.activity_record, 'to_alipay_dict'):
  91. params['activity_record'] = self.activity_record.to_alipay_dict()
  92. else:
  93. params['activity_record'] = self.activity_record
  94. if self.activity_url:
  95. if hasattr(self.activity_url, 'to_alipay_dict'):
  96. params['activity_url'] = self.activity_url.to_alipay_dict()
  97. else:
  98. params['activity_url'] = self.activity_url
  99. if self.effective_end:
  100. if hasattr(self.effective_end, 'to_alipay_dict'):
  101. params['effective_end'] = self.effective_end.to_alipay_dict()
  102. else:
  103. params['effective_end'] = self.effective_end
  104. if self.effective_start:
  105. if hasattr(self.effective_start, 'to_alipay_dict'):
  106. params['effective_start'] = self.effective_start.to_alipay_dict()
  107. else:
  108. params['effective_start'] = self.effective_start
  109. if self.last_platform:
  110. if hasattr(self.last_platform, 'to_alipay_dict'):
  111. params['last_platform'] = self.last_platform.to_alipay_dict()
  112. else:
  113. params['last_platform'] = self.last_platform
  114. if self.last_store_id:
  115. if hasattr(self.last_store_id, 'to_alipay_dict'):
  116. params['last_store_id'] = self.last_store_id.to_alipay_dict()
  117. else:
  118. params['last_store_id'] = self.last_store_id
  119. if self.priority_booth:
  120. if hasattr(self.priority_booth, 'to_alipay_dict'):
  121. params['priority_booth'] = self.priority_booth.to_alipay_dict()
  122. else:
  123. params['priority_booth'] = self.priority_booth
  124. if self.status:
  125. if hasattr(self.status, 'to_alipay_dict'):
  126. params['status'] = self.status.to_alipay_dict()
  127. else:
  128. params['status'] = self.status
  129. return params
  130. @staticmethod
  131. def from_alipay_dict(d):
  132. if not d:
  133. return None
  134. o = MarketInfo()
  135. if 'activity_icon' in d:
  136. o.activity_icon = d['activity_icon']
  137. if 'activity_id' in d:
  138. o.activity_id = d['activity_id']
  139. if 'activity_record' in d:
  140. o.activity_record = d['activity_record']
  141. if 'activity_url' in d:
  142. o.activity_url = d['activity_url']
  143. if 'effective_end' in d:
  144. o.effective_end = d['effective_end']
  145. if 'effective_start' in d:
  146. o.effective_start = d['effective_start']
  147. if 'last_platform' in d:
  148. o.last_platform = d['last_platform']
  149. if 'last_store_id' in d:
  150. o.last_store_id = d['last_store_id']
  151. if 'priority_booth' in d:
  152. o.priority_booth = d['priority_booth']
  153. if 'status' in d:
  154. o.status = d['status']
  155. return o