From 51e69650bbf814b747fe65a0f2618328087b1fde Mon Sep 17 00:00:00 2001 From: liuwei Date: Wed, 28 May 2025 16:19:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=97=A0=E6=95=88=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/contacts_db.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/db/contacts_db.py b/db/contacts_db.py index 480a2a0..50b3447 100644 --- a/db/contacts_db.py +++ b/db/contacts_db.py @@ -312,32 +312,6 @@ class ContactsDBOperator(BaseDBOperator): self.LOG.error(f"获取所有联系人信息失败: {e}") return {} - def get_all_contacts_name_map(self) -> Dict[str, str]: - """获取所有联系人的ID到显示名称的映射 - - Returns: - Dict[str, str]: 联系人ID到显示名称的映射 - """ - try: - sql = """ - SELECT user_name, remark, nick_name FROM t_wechat_contacts - """ - - results = self.execute_query(sql) - - name_map = {} - for result in results: - user_name = result.get('user_name') - remark = result.get('remark') - nick_name = result.get('nick_name') - display_name = remark or nick_name or user_name - name_map[user_name] = display_name - - return name_map - except Exception as e: - self.LOG.error(f"获取所有联系人名称映射失败: {e}") - return {} - def save_chatroom_member_simple(self, chatroom_id: str, member_details: List[Dict]) -> bool: """ 保存群成员简要信息到数据库,兼容不同数据结构