category.py 922 B

1234567891011121314151617181920212223242526272829303132
  1. # -*- coding: utf-8 -*-
  2. from __future__ import absolute_import, unicode_literals
  3. from library.wechatpy.client.api.base import BaseWeChatAPI
  4. class MerchantCategory(BaseWeChatAPI):
  5. API_BASE_URL = 'https://api.weixin.qq.com/'
  6. def get_sub_categories(self, cate_id):
  7. res = self._post(
  8. 'merchant/category/getsub',
  9. data={'cate_id': cate_id},
  10. result_processor=lambda x: x['cate_list']
  11. )
  12. return res
  13. def get_sku_list(self, cate_id):
  14. res = self._post(
  15. 'merchant/category/getsku',
  16. data={'cate_id': cate_id},
  17. result_processor=lambda x: x['sku_table']
  18. )
  19. return res
  20. def get_properties(self, cate_id):
  21. res = self._post(
  22. 'merchant/category/getproperty',
  23. data={'cate_id': cate_id},
  24. result_processor=lambda x: x['properties']
  25. )
  26. return res