KoubeiItemTaobaoIndexQueryModel.py 3.2 KB

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