优化工单模块,增加企微模块
This commit is contained in:
60
sg_wechat_enterprise/we_api/client/api/merchant/group.py
Normal file
60
sg_wechat_enterprise/we_api/client/api/merchant/group.py
Normal file
@@ -0,0 +1,60 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from wechatpy.client.api.base import BaseWeChatAPI
|
||||
|
||||
|
||||
class MerchantGroup(BaseWeChatAPI):
|
||||
|
||||
def add(self, name, product_list):
|
||||
return self._post(
|
||||
'merchant/group/add',
|
||||
data={
|
||||
'group_detail': {
|
||||
'group_name': name,
|
||||
'product_list': product_list
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
def delete(self, group_id):
|
||||
return self._post(
|
||||
'merchant/group/del',
|
||||
data={
|
||||
'group_id': group_id
|
||||
}
|
||||
)
|
||||
|
||||
def update(self, group_id, name):
|
||||
return self._post(
|
||||
'merchant/group/propertymod',
|
||||
data={
|
||||
'group_id': group_id,
|
||||
'group_name': name
|
||||
}
|
||||
)
|
||||
|
||||
def update_product(self, group_id, product):
|
||||
return self._post(
|
||||
'merchant/group/productmod',
|
||||
data={
|
||||
'group_id': group_id,
|
||||
'product': product
|
||||
}
|
||||
)
|
||||
|
||||
def get_all(self):
|
||||
res = self._get(
|
||||
'merchant/group/getall',
|
||||
result_processor=lambda x: x['group_detail']
|
||||
)
|
||||
return res
|
||||
|
||||
def get(self, group_id):
|
||||
res = self._post(
|
||||
'merchant/group/getbyid',
|
||||
data={
|
||||
'group_id': group_id
|
||||
},
|
||||
result_processor=lambda x: x['group_detail']
|
||||
)
|
||||
return res
|
||||
Reference in New Issue
Block a user