NearMallBo.py 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class NearMallBo(object):
  6. def __init__(self):
  7. self._attribute = None
  8. self._distance = None
  9. self._latitude = None
  10. self._longitude = None
  11. self._mall_id = None
  12. self._mall_logo = None
  13. self._mall_name = None
  14. @property
  15. def attribute(self):
  16. return self._attribute
  17. @attribute.setter
  18. def attribute(self, value):
  19. self._attribute = value
  20. @property
  21. def distance(self):
  22. return self._distance
  23. @distance.setter
  24. def distance(self, value):
  25. self._distance = value
  26. @property
  27. def latitude(self):
  28. return self._latitude
  29. @latitude.setter
  30. def latitude(self, value):
  31. self._latitude = value
  32. @property
  33. def longitude(self):
  34. return self._longitude
  35. @longitude.setter
  36. def longitude(self, value):
  37. self._longitude = value
  38. @property
  39. def mall_id(self):
  40. return self._mall_id
  41. @mall_id.setter
  42. def mall_id(self, value):
  43. self._mall_id = value
  44. @property
  45. def mall_logo(self):
  46. return self._mall_logo
  47. @mall_logo.setter
  48. def mall_logo(self, value):
  49. self._mall_logo = value
  50. @property
  51. def mall_name(self):
  52. return self._mall_name
  53. @mall_name.setter
  54. def mall_name(self, value):
  55. self._mall_name = value
  56. def to_alipay_dict(self):
  57. params = dict()
  58. if self.attribute:
  59. if hasattr(self.attribute, 'to_alipay_dict'):
  60. params['attribute'] = self.attribute.to_alipay_dict()
  61. else:
  62. params['attribute'] = self.attribute
  63. if self.distance:
  64. if hasattr(self.distance, 'to_alipay_dict'):
  65. params['distance'] = self.distance.to_alipay_dict()
  66. else:
  67. params['distance'] = self.distance
  68. if self.latitude:
  69. if hasattr(self.latitude, 'to_alipay_dict'):
  70. params['latitude'] = self.latitude.to_alipay_dict()
  71. else:
  72. params['latitude'] = self.latitude
  73. if self.longitude:
  74. if hasattr(self.longitude, 'to_alipay_dict'):
  75. params['longitude'] = self.longitude.to_alipay_dict()
  76. else:
  77. params['longitude'] = self.longitude
  78. if self.mall_id:
  79. if hasattr(self.mall_id, 'to_alipay_dict'):
  80. params['mall_id'] = self.mall_id.to_alipay_dict()
  81. else:
  82. params['mall_id'] = self.mall_id
  83. if self.mall_logo:
  84. if hasattr(self.mall_logo, 'to_alipay_dict'):
  85. params['mall_logo'] = self.mall_logo.to_alipay_dict()
  86. else:
  87. params['mall_logo'] = self.mall_logo
  88. if self.mall_name:
  89. if hasattr(self.mall_name, 'to_alipay_dict'):
  90. params['mall_name'] = self.mall_name.to_alipay_dict()
  91. else:
  92. params['mall_name'] = self.mall_name
  93. return params
  94. @staticmethod
  95. def from_alipay_dict(d):
  96. if not d:
  97. return None
  98. o = NearMallBo()
  99. if 'attribute' in d:
  100. o.attribute = d['attribute']
  101. if 'distance' in d:
  102. o.distance = d['distance']
  103. if 'latitude' in d:
  104. o.latitude = d['latitude']
  105. if 'longitude' in d:
  106. o.longitude = d['longitude']
  107. if 'mall_id' in d:
  108. o.mall_id = d['mall_id']
  109. if 'mall_logo' in d:
  110. o.mall_logo = d['mall_logo']
  111. if 'mall_name' in d:
  112. o.mall_name = d['mall_name']
  113. return o