浏览代码

调整商机助理正式测试

develop
H Vs 11 小时前
父节点
当前提交
4cdb7b1b8b
共有 2 个文件被更改,包括 20 次插入4 次删除
  1. +15
    -4
      app/endpoints/pipeline_endpoint.py
  2. +5
    -0
      services/biz_service.py

+ 15
- 4
app/endpoints/pipeline_endpoint.py 查看文件

@@ -418,13 +418,23 @@ async def handle_text_async(request: Request,token_id,app_id, wxid,msg_data,from
18664262743
wxid_9pocbage7cdb22
'''

'''
测试环境的商机提醒使用:15986163393,wxid_488eunhhppbs22
'''
contacts_brief= await request.app.state.gewe_service.get_contacts_brief_from_cache_async(wxid)
contact_nick_name=next(filter(lambda x:x.get("userName") == callback_to_user,contacts_brief),{}).get("nickName","")
assistant_msg_content=f'AI管家转人工提醒:【{contact_nick_name}】有{found_keywords[0]}需求'
await request.app.state.gewe_service.post_text_async(token_id, app_id, 'wxid_9pocbage7cdb22', assistant_msg_content)

biz_assistant_wxid="wxid_9pocbage7cdb22"
environment = os.environ.get('environment', 'default')
if environment=='test':
biz_assistant_wxid='wxid_488eunhhppbs22'
await request.app.state.gewe_service.post_text_async(token_id, app_id, biz_assistant_wxid, assistant_msg_content)
k,loginfo=await request.app.state.gewe_service.get_login_info_by_wxid_async('wxid_9pocbage7cdb22')
k,loginfo=await request.app.state.gewe_service.get_login_info_by_wxid_async(biz_assistant_wxid)
if not k:
logger.warning(f'助理微信号 wxid_9pocbage7cdb22 不存在')
return
@@ -1162,12 +1172,13 @@ async def handle_xml_async(request: Request,token_id,app_id, wxid,msg_data,from_
handlers = {
57: handle_xml_reference_async,
5: handle_xml_invite_group_async,
74: handle_file_message_async
74: handle_file_message_async #直发
}
# 判断是否为群
if check_chatroom(from_wxid) or check_chatroom(to_wxid):
handlers[74]=handle_file_message_group_async
handler = handlers.get(type_value)
if handler:
return await handler(request,token_id,app_id, wxid,msg_data,from_wxid, to_wxid)


+ 5
- 0
services/biz_service.py 查看文件

@@ -549,7 +549,12 @@ class BizService():
if wx_content_list is None or len(wx_content_list) == 0:
logger.warning(f'wx_content_list 空列表不处理 {wx_content_list}')
return
biz_assistant_wxid="wxid_9pocbage7cdb22"
environment = os.environ.get('environment', 'default')
if environment=='test':
biz_assistant_wxid='wxid_488eunhhppbs22'

k, loginfo = await self.wxchat.get_login_info_by_wxid_async(biz_assistant_wxid)
if not loginfo:
logger.warning(f'{biz_assistant_wxid} 助理信信息不存在')


正在加载...
取消
保存