MerchantshopCommentStatistic.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class MerchantshopCommentStatistic(object):
  6. def __init__(self):
  7. self._comment_count = None
  8. self._score = None
  9. @property
  10. def comment_count(self):
  11. return self._comment_count
  12. @comment_count.setter
  13. def comment_count(self, value):
  14. self._comment_count = value
  15. @property
  16. def score(self):
  17. return self._score
  18. @score.setter
  19. def score(self, value):
  20. self._score = value
  21. def to_alipay_dict(self):
  22. params = dict()
  23. if self.comment_count:
  24. if hasattr(self.comment_count, 'to_alipay_dict'):
  25. params['comment_count'] = self.comment_count.to_alipay_dict()
  26. else:
  27. params['comment_count'] = self.comment_count
  28. if self.score:
  29. if hasattr(self.score, 'to_alipay_dict'):
  30. params['score'] = self.score.to_alipay_dict()
  31. else:
  32. params['score'] = self.score
  33. return params
  34. @staticmethod
  35. def from_alipay_dict(d):
  36. if not d:
  37. return None
  38. o = MerchantshopCommentStatistic()
  39. if 'comment_count' in d:
  40. o.comment_count = d['comment_count']
  41. if 'score' in d:
  42. o.score = d['score']
  43. return o