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

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,51 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from wechatpy.client.api.base import BaseWeChatAPI
class WeChatMisc(BaseWeChatAPI):
def short_url(self, long_url):
"""
将一条长链接转成短链接
详情请参考
http://mp.weixin.qq.com/wiki/10/165c9b15eddcfbd8699ac12b0bd89ae6.html
:param long_url: 长链接地址
:return: 返回的 JSON 数据包
使用示例::
from wechatpy import WeChatClient
client = WeChatClient('appid', 'secret')
res = client.misc.short_url('http://www.qq.com')
"""
return self._post(
'shorturl',
data={
'action': 'long2short',
'long_url': long_url
}
)
def get_wechat_ips(self):
"""
获取微信服务器 IP 地址列表
:return: IP 地址列表
使用示例::
from wechatpy import WeChatClient
client = WeChatClient('appid', 'secret')
ips = client.misc.get_wechat_ips()
"""
res = self._get(
'getcallbackip',
result_processor=lambda x: x['ip_list']
)
return res