NetValueVO.py 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class NetValueVO(object):
  6. def __init__(self):
  7. self._net_value = None
  8. self._net_value_date = None
  9. self._profit_seven_days = None
  10. self._profit_ten_thousand = None
  11. @property
  12. def net_value(self):
  13. return self._net_value
  14. @net_value.setter
  15. def net_value(self, value):
  16. self._net_value = value
  17. @property
  18. def net_value_date(self):
  19. return self._net_value_date
  20. @net_value_date.setter
  21. def net_value_date(self, value):
  22. self._net_value_date = value
  23. @property
  24. def profit_seven_days(self):
  25. return self._profit_seven_days
  26. @profit_seven_days.setter
  27. def profit_seven_days(self, value):
  28. self._profit_seven_days = value
  29. @property
  30. def profit_ten_thousand(self):
  31. return self._profit_ten_thousand
  32. @profit_ten_thousand.setter
  33. def profit_ten_thousand(self, value):
  34. self._profit_ten_thousand = value
  35. def to_alipay_dict(self):
  36. params = dict()
  37. if self.net_value:
  38. if hasattr(self.net_value, 'to_alipay_dict'):
  39. params['net_value'] = self.net_value.to_alipay_dict()
  40. else:
  41. params['net_value'] = self.net_value
  42. if self.net_value_date:
  43. if hasattr(self.net_value_date, 'to_alipay_dict'):
  44. params['net_value_date'] = self.net_value_date.to_alipay_dict()
  45. else:
  46. params['net_value_date'] = self.net_value_date
  47. if self.profit_seven_days:
  48. if hasattr(self.profit_seven_days, 'to_alipay_dict'):
  49. params['profit_seven_days'] = self.profit_seven_days.to_alipay_dict()
  50. else:
  51. params['profit_seven_days'] = self.profit_seven_days
  52. if self.profit_ten_thousand:
  53. if hasattr(self.profit_ten_thousand, 'to_alipay_dict'):
  54. params['profit_ten_thousand'] = self.profit_ten_thousand.to_alipay_dict()
  55. else:
  56. params['profit_ten_thousand'] = self.profit_ten_thousand
  57. return params
  58. @staticmethod
  59. def from_alipay_dict(d):
  60. if not d:
  61. return None
  62. o = NetValueVO()
  63. if 'net_value' in d:
  64. o.net_value = d['net_value']
  65. if 'net_value_date' in d:
  66. o.net_value_date = d['net_value_date']
  67. if 'profit_seven_days' in d:
  68. o.profit_seven_days = d['profit_seven_days']
  69. if 'profit_ten_thousand' in d:
  70. o.profit_ten_thousand = d['profit_ten_thousand']
  71. return o