IsvShopDishModel.py 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class IsvShopDishModel(object):
  6. def __init__(self):
  7. self._content = None
  8. self._dish_type_id = None
  9. self._dish_type_name = None
  10. self._good_level = None
  11. self._merchant_sold_cnt_seven_d = None
  12. self._merchant_sold_cnt_thirty_d = None
  13. self._merchant_sold_reusercnt_thirty_d = None
  14. self._merchant_sold_usercnt_thirty_d = None
  15. self._name = None
  16. self._outer_dish_id = None
  17. self._pict = None
  18. self._platform = None
  19. self._price = None
  20. self._quantity = None
  21. self._shop_id = None
  22. self._sold_cnt_seven_d = None
  23. self._sold_cnt_thirty_d = None
  24. self._sold_reusercnt_thirty_d = None
  25. self._sold_usercnt_thirty_d = None
  26. self._sort_col = None
  27. self._unit = None
  28. @property
  29. def content(self):
  30. return self._content
  31. @content.setter
  32. def content(self, value):
  33. self._content = value
  34. @property
  35. def dish_type_id(self):
  36. return self._dish_type_id
  37. @dish_type_id.setter
  38. def dish_type_id(self, value):
  39. self._dish_type_id = value
  40. @property
  41. def dish_type_name(self):
  42. return self._dish_type_name
  43. @dish_type_name.setter
  44. def dish_type_name(self, value):
  45. self._dish_type_name = value
  46. @property
  47. def good_level(self):
  48. return self._good_level
  49. @good_level.setter
  50. def good_level(self, value):
  51. self._good_level = value
  52. @property
  53. def merchant_sold_cnt_seven_d(self):
  54. return self._merchant_sold_cnt_seven_d
  55. @merchant_sold_cnt_seven_d.setter
  56. def merchant_sold_cnt_seven_d(self, value):
  57. self._merchant_sold_cnt_seven_d = value
  58. @property
  59. def merchant_sold_cnt_thirty_d(self):
  60. return self._merchant_sold_cnt_thirty_d
  61. @merchant_sold_cnt_thirty_d.setter
  62. def merchant_sold_cnt_thirty_d(self, value):
  63. self._merchant_sold_cnt_thirty_d = value
  64. @property
  65. def merchant_sold_reusercnt_thirty_d(self):
  66. return self._merchant_sold_reusercnt_thirty_d
  67. @merchant_sold_reusercnt_thirty_d.setter
  68. def merchant_sold_reusercnt_thirty_d(self, value):
  69. self._merchant_sold_reusercnt_thirty_d = value
  70. @property
  71. def merchant_sold_usercnt_thirty_d(self):
  72. return self._merchant_sold_usercnt_thirty_d
  73. @merchant_sold_usercnt_thirty_d.setter
  74. def merchant_sold_usercnt_thirty_d(self, value):
  75. self._merchant_sold_usercnt_thirty_d = value
  76. @property
  77. def name(self):
  78. return self._name
  79. @name.setter
  80. def name(self, value):
  81. self._name = value
  82. @property
  83. def outer_dish_id(self):
  84. return self._outer_dish_id
  85. @outer_dish_id.setter
  86. def outer_dish_id(self, value):
  87. self._outer_dish_id = value
  88. @property
  89. def pict(self):
  90. return self._pict
  91. @pict.setter
  92. def pict(self, value):
  93. self._pict = value
  94. @property
  95. def platform(self):
  96. return self._platform
  97. @platform.setter
  98. def platform(self, value):
  99. self._platform = value
  100. @property
  101. def price(self):
  102. return self._price
  103. @price.setter
  104. def price(self, value):
  105. self._price = value
  106. @property
  107. def quantity(self):
  108. return self._quantity
  109. @quantity.setter
  110. def quantity(self, value):
  111. self._quantity = value
  112. @property
  113. def shop_id(self):
  114. return self._shop_id
  115. @shop_id.setter
  116. def shop_id(self, value):
  117. self._shop_id = value
  118. @property
  119. def sold_cnt_seven_d(self):
  120. return self._sold_cnt_seven_d
  121. @sold_cnt_seven_d.setter
  122. def sold_cnt_seven_d(self, value):
  123. self._sold_cnt_seven_d = value
  124. @property
  125. def sold_cnt_thirty_d(self):
  126. return self._sold_cnt_thirty_d
  127. @sold_cnt_thirty_d.setter
  128. def sold_cnt_thirty_d(self, value):
  129. self._sold_cnt_thirty_d = value
  130. @property
  131. def sold_reusercnt_thirty_d(self):
  132. return self._sold_reusercnt_thirty_d
  133. @sold_reusercnt_thirty_d.setter
  134. def sold_reusercnt_thirty_d(self, value):
  135. self._sold_reusercnt_thirty_d = value
  136. @property
  137. def sold_usercnt_thirty_d(self):
  138. return self._sold_usercnt_thirty_d
  139. @sold_usercnt_thirty_d.setter
  140. def sold_usercnt_thirty_d(self, value):
  141. self._sold_usercnt_thirty_d = value
  142. @property
  143. def sort_col(self):
  144. return self._sort_col
  145. @sort_col.setter
  146. def sort_col(self, value):
  147. if isinstance(value, list):
  148. self._sort_col = list()
  149. for i in value:
  150. self._sort_col.append(i)
  151. @property
  152. def unit(self):
  153. return self._unit
  154. @unit.setter
  155. def unit(self, value):
  156. self._unit = value
  157. def to_alipay_dict(self):
  158. params = dict()
  159. if self.content:
  160. if hasattr(self.content, 'to_alipay_dict'):
  161. params['content'] = self.content.to_alipay_dict()
  162. else:
  163. params['content'] = self.content
  164. if self.dish_type_id:
  165. if hasattr(self.dish_type_id, 'to_alipay_dict'):
  166. params['dish_type_id'] = self.dish_type_id.to_alipay_dict()
  167. else:
  168. params['dish_type_id'] = self.dish_type_id
  169. if self.dish_type_name:
  170. if hasattr(self.dish_type_name, 'to_alipay_dict'):
  171. params['dish_type_name'] = self.dish_type_name.to_alipay_dict()
  172. else:
  173. params['dish_type_name'] = self.dish_type_name
  174. if self.good_level:
  175. if hasattr(self.good_level, 'to_alipay_dict'):
  176. params['good_level'] = self.good_level.to_alipay_dict()
  177. else:
  178. params['good_level'] = self.good_level
  179. if self.merchant_sold_cnt_seven_d:
  180. if hasattr(self.merchant_sold_cnt_seven_d, 'to_alipay_dict'):
  181. params['merchant_sold_cnt_seven_d'] = self.merchant_sold_cnt_seven_d.to_alipay_dict()
  182. else:
  183. params['merchant_sold_cnt_seven_d'] = self.merchant_sold_cnt_seven_d
  184. if self.merchant_sold_cnt_thirty_d:
  185. if hasattr(self.merchant_sold_cnt_thirty_d, 'to_alipay_dict'):
  186. params['merchant_sold_cnt_thirty_d'] = self.merchant_sold_cnt_thirty_d.to_alipay_dict()
  187. else:
  188. params['merchant_sold_cnt_thirty_d'] = self.merchant_sold_cnt_thirty_d
  189. if self.merchant_sold_reusercnt_thirty_d:
  190. if hasattr(self.merchant_sold_reusercnt_thirty_d, 'to_alipay_dict'):
  191. params['merchant_sold_reusercnt_thirty_d'] = self.merchant_sold_reusercnt_thirty_d.to_alipay_dict()
  192. else:
  193. params['merchant_sold_reusercnt_thirty_d'] = self.merchant_sold_reusercnt_thirty_d
  194. if self.merchant_sold_usercnt_thirty_d:
  195. if hasattr(self.merchant_sold_usercnt_thirty_d, 'to_alipay_dict'):
  196. params['merchant_sold_usercnt_thirty_d'] = self.merchant_sold_usercnt_thirty_d.to_alipay_dict()
  197. else:
  198. params['merchant_sold_usercnt_thirty_d'] = self.merchant_sold_usercnt_thirty_d
  199. if self.name:
  200. if hasattr(self.name, 'to_alipay_dict'):
  201. params['name'] = self.name.to_alipay_dict()
  202. else:
  203. params['name'] = self.name
  204. if self.outer_dish_id:
  205. if hasattr(self.outer_dish_id, 'to_alipay_dict'):
  206. params['outer_dish_id'] = self.outer_dish_id.to_alipay_dict()
  207. else:
  208. params['outer_dish_id'] = self.outer_dish_id
  209. if self.pict:
  210. if hasattr(self.pict, 'to_alipay_dict'):
  211. params['pict'] = self.pict.to_alipay_dict()
  212. else:
  213. params['pict'] = self.pict
  214. if self.platform:
  215. if hasattr(self.platform, 'to_alipay_dict'):
  216. params['platform'] = self.platform.to_alipay_dict()
  217. else:
  218. params['platform'] = self.platform
  219. if self.price:
  220. if hasattr(self.price, 'to_alipay_dict'):
  221. params['price'] = self.price.to_alipay_dict()
  222. else:
  223. params['price'] = self.price
  224. if self.quantity:
  225. if hasattr(self.quantity, 'to_alipay_dict'):
  226. params['quantity'] = self.quantity.to_alipay_dict()
  227. else:
  228. params['quantity'] = self.quantity
  229. if self.shop_id:
  230. if hasattr(self.shop_id, 'to_alipay_dict'):
  231. params['shop_id'] = self.shop_id.to_alipay_dict()
  232. else:
  233. params['shop_id'] = self.shop_id
  234. if self.sold_cnt_seven_d:
  235. if hasattr(self.sold_cnt_seven_d, 'to_alipay_dict'):
  236. params['sold_cnt_seven_d'] = self.sold_cnt_seven_d.to_alipay_dict()
  237. else:
  238. params['sold_cnt_seven_d'] = self.sold_cnt_seven_d
  239. if self.sold_cnt_thirty_d:
  240. if hasattr(self.sold_cnt_thirty_d, 'to_alipay_dict'):
  241. params['sold_cnt_thirty_d'] = self.sold_cnt_thirty_d.to_alipay_dict()
  242. else:
  243. params['sold_cnt_thirty_d'] = self.sold_cnt_thirty_d
  244. if self.sold_reusercnt_thirty_d:
  245. if hasattr(self.sold_reusercnt_thirty_d, 'to_alipay_dict'):
  246. params['sold_reusercnt_thirty_d'] = self.sold_reusercnt_thirty_d.to_alipay_dict()
  247. else:
  248. params['sold_reusercnt_thirty_d'] = self.sold_reusercnt_thirty_d
  249. if self.sold_usercnt_thirty_d:
  250. if hasattr(self.sold_usercnt_thirty_d, 'to_alipay_dict'):
  251. params['sold_usercnt_thirty_d'] = self.sold_usercnt_thirty_d.to_alipay_dict()
  252. else:
  253. params['sold_usercnt_thirty_d'] = self.sold_usercnt_thirty_d
  254. if self.sort_col:
  255. if isinstance(self.sort_col, list):
  256. for i in range(0, len(self.sort_col)):
  257. element = self.sort_col[i]
  258. if hasattr(element, 'to_alipay_dict'):
  259. self.sort_col[i] = element.to_alipay_dict()
  260. if hasattr(self.sort_col, 'to_alipay_dict'):
  261. params['sort_col'] = self.sort_col.to_alipay_dict()
  262. else:
  263. params['sort_col'] = self.sort_col
  264. if self.unit:
  265. if hasattr(self.unit, 'to_alipay_dict'):
  266. params['unit'] = self.unit.to_alipay_dict()
  267. else:
  268. params['unit'] = self.unit
  269. return params
  270. @staticmethod
  271. def from_alipay_dict(d):
  272. if not d:
  273. return None
  274. o = IsvShopDishModel()
  275. if 'content' in d:
  276. o.content = d['content']
  277. if 'dish_type_id' in d:
  278. o.dish_type_id = d['dish_type_id']
  279. if 'dish_type_name' in d:
  280. o.dish_type_name = d['dish_type_name']
  281. if 'good_level' in d:
  282. o.good_level = d['good_level']
  283. if 'merchant_sold_cnt_seven_d' in d:
  284. o.merchant_sold_cnt_seven_d = d['merchant_sold_cnt_seven_d']
  285. if 'merchant_sold_cnt_thirty_d' in d:
  286. o.merchant_sold_cnt_thirty_d = d['merchant_sold_cnt_thirty_d']
  287. if 'merchant_sold_reusercnt_thirty_d' in d:
  288. o.merchant_sold_reusercnt_thirty_d = d['merchant_sold_reusercnt_thirty_d']
  289. if 'merchant_sold_usercnt_thirty_d' in d:
  290. o.merchant_sold_usercnt_thirty_d = d['merchant_sold_usercnt_thirty_d']
  291. if 'name' in d:
  292. o.name = d['name']
  293. if 'outer_dish_id' in d:
  294. o.outer_dish_id = d['outer_dish_id']
  295. if 'pict' in d:
  296. o.pict = d['pict']
  297. if 'platform' in d:
  298. o.platform = d['platform']
  299. if 'price' in d:
  300. o.price = d['price']
  301. if 'quantity' in d:
  302. o.quantity = d['quantity']
  303. if 'shop_id' in d:
  304. o.shop_id = d['shop_id']
  305. if 'sold_cnt_seven_d' in d:
  306. o.sold_cnt_seven_d = d['sold_cnt_seven_d']
  307. if 'sold_cnt_thirty_d' in d:
  308. o.sold_cnt_thirty_d = d['sold_cnt_thirty_d']
  309. if 'sold_reusercnt_thirty_d' in d:
  310. o.sold_reusercnt_thirty_d = d['sold_reusercnt_thirty_d']
  311. if 'sold_usercnt_thirty_d' in d:
  312. o.sold_usercnt_thirty_d = d['sold_usercnt_thirty_d']
  313. if 'sort_col' in d:
  314. o.sort_col = d['sort_col']
  315. if 'unit' in d:
  316. o.unit = d['unit']
  317. return o