From 3f3611592e28b5a5d222cbdb8068a484db6e11de Mon Sep 17 00:00:00 2001 From: AKW <2497744746@qq.com> Date: Thu, 28 Dec 2023 17:14:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jqr/ksy_http.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/apps/jqr/ksy_http.py b/apps/jqr/ksy_http.py index 2dddcd3..94b01f2 100644 --- a/apps/jqr/ksy_http.py +++ b/apps/jqr/ksy_http.py @@ -19,8 +19,27 @@ class Http(object): return True, res.json().get('data') return False, None + # api/newusermsg/getkeywordreplymsg?corpId=&userId=&uId=&externalUserId=&sendType=&content= + @classmethod + def get_keyword_reply_msg(cls, corpid, userid, external_userid, uid=None, send_type=0, content=None): + # sendType 0 私聊,1 群聊 + uid = uid or 3 + url = f'{cls.BASE_URL}/api/newusermsg/getkeywordreplymsg' + params = { + 'corpId': corpid, + 'userId': userid, + 'externalUserId': external_userid, + 'uId': uid, + 'sendType': send_type, + 'content': content, + } + res = requests.get(url, params=params) + if res.status_code == 200: + return True, res.json().get('data') + return False, None + if __name__ == '__main__': - success, data = Http.get_new_user_msg('ww4450b72962300373', 'mg04598', 'wmAHf_bwAA90A6vdT0dDsWyqZJGgJOIg') + success, data = Http.get_new_user_msg('ww056d00fac4950f54', 'agent-Wang', 'wmy1VmQgAAd1BJaEHCrdOttQop7gg8Rg') print(success) print(data)