加入头像信息
This commit is contained in:
@@ -651,4 +651,26 @@ class ContactsDBOperator(BaseDBOperator):
|
||||
return True
|
||||
except Exception as e:
|
||||
self.LOG.error(f"删除所有联系人信息失败: {e}")
|
||||
return False
|
||||
return False
|
||||
|
||||
#新增获取所有联系人头像信息接口
|
||||
def get_all_contacts_avatar(self) -> Dict[str, str]:
|
||||
"""获取所有联系人头像信息"""
|
||||
try:
|
||||
sql = """
|
||||
SELECT user_name, small_head_img_url
|
||||
FROM t_wechat_contacts
|
||||
union all
|
||||
SELECT wxid as user_name, small_head_img_url
|
||||
FROM t_chatroom_member
|
||||
union all
|
||||
SELECT chatroom_id as user_name, small_head_img_url
|
||||
FROM t_chatrooms
|
||||
"""
|
||||
results = self.execute_query(sql)
|
||||
#返回DICT
|
||||
results = {result['user_name']: result['small_head_img_url'] for result in results}
|
||||
return results
|
||||
except Exception as e:
|
||||
self.LOG.error(f"获取所有联系人头像信息失败: {e}")
|
||||
return []
|
||||
Reference in New Issue
Block a user