优化工单模块,增加企微模块

This commit is contained in:
mgw
2024-07-10 15:58:47 +08:00
parent e8512b23e4
commit 6b140fe6dd
134 changed files with 12830 additions and 2 deletions

View File

@@ -0,0 +1,97 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from wechatpy.client.api.base import BaseWeChatAPI
class WeChatPoi(BaseWeChatAPI):
def add_picture(self, access_token, buffer):
"""
上传图片接口
:param access_token: 接口凭证
:param buffer: buffer
:return:
详情请参考: https://mp.weixin.qq.com/wiki/16/8f182af4d8dcea02c56506306bdb2f4c.html
"""
def add(self, poi_data):
"""
创建门店
详情请参考
http://mp.weixin.qq.com/wiki/16/8f182af4d8dcea02c56506306bdb2f4c.html
:param poi_data: 门店信息字典
:return: 返回的 JSON 数据包
"""
return self._post('poi/addpoi', data=poi_data)
def get(self, poi_id):
"""
查询门店信息
详情请参考
http://mp.weixin.qq.com/wiki/16/8f182af4d8dcea02c56506306bdb2f4c.html
:param poi_id: 门店 ID
:return: 返回的 JSON 数据包
"""
return self._post('poi/getpoi', data={'poi_id': poi_id})
def list(self, begin=0, limit=20):
"""
查询门店列表
详情请参考
http://mp.weixin.qq.com/wiki/16/8f182af4d8dcea02c56506306bdb2f4c.html
:param begin: 开始位置0 即为从第一条开始查询
:param limit: 返回数据条数最大允许50默认为20
:return: 返回的 JSON 数据包
"""
return self._post(
'poi/getpoilist',
data={
'begin': begin,
'limit': limit,
}
)
def update(self, poi_data):
"""
修改门店
详情请参考
http://mp.weixin.qq.com/wiki/16/8f182af4d8dcea02c56506306bdb2f4c.html
:param poi_data: 门店信息字典
:return: 返回的 JSON 数据包
"""
return self._post('poi/updatepoi', data=poi_data)
def delete(self, poi_id):
"""
删除门店
详情请参考
http://mp.weixin.qq.com/wiki/16/8f182af4d8dcea02c56506306bdb2f4c.html
:param poi_id: 门店 ID
:return: 返回的 JSON 数据包
"""
return self._post('poi/delpoi', data={'poi_id': poi_id})
def get_categories(self):
"""
获取微信门店类目表
详情请参考
http://mp.weixin.qq.com/wiki/16/8f182af4d8dcea02c56506306bdb2f4c.html
:return: 门店类目表
"""
res = self._get(
'api_getwxcategory',
result_processor=lambda x: x['category_list']
)
return res