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

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,46 @@
from __future__ import absolute_import, unicode_literals
from wechatpy.crypto import BasePrpCrypto, BaseWeChatCrypto
from wechatpy.enterprise.exceptions import InvalidCorpIdException
class PrpCrypto(BasePrpCrypto):
def encrypt(self, text, corp_id):
return self._encrypt(text, corp_id)
def decrypt(self, text, corp_id):
return self._decrypt(text, corp_id, InvalidCorpIdException)
class WeChatCrypto(BaseWeChatCrypto):
def __init__(self, token, encoding_aes_key, corp_id):
super(WeChatCrypto, self).__init__(token, encoding_aes_key, corp_id)
self.corp_id = corp_id
def check_signature(self, signature, timestamp, nonce, echo_str):
return self._check_signature(
signature,
timestamp,
nonce,
echo_str,
PrpCrypto
)
def encrypt_message(self, msg, nonce, timestamp=None):
return self._encrypt_message(
msg,
nonce,
timestamp,
PrpCrypto
)
def decrypt_message(self, msg, signature, timestamp, nonce):
return self._decrypt_message(
msg,
signature,
timestamp,
nonce,
PrpCrypto
)