优化内容
This commit is contained in:
@@ -11,7 +11,6 @@ from typing import List, Dict, Optional, Union, Any
|
||||
from db.base import BaseDBOperator
|
||||
from db.connection import DBConnectionManager
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ContactsDBOperator(BaseDBOperator):
|
||||
@@ -19,7 +18,7 @@ class ContactsDBOperator(BaseDBOperator):
|
||||
|
||||
def __init__(self, db_manager: DBConnectionManager):
|
||||
super().__init__(db_manager)
|
||||
|
||||
self.logger = logging.getLogger(__name__)
|
||||
|
||||
def _ensure_table_exists(self):
|
||||
"""确保联系人表存在"""
|
||||
|
||||
@@ -14,7 +14,7 @@ class KidPhotoRedisDB:
|
||||
def __init__(self, db_manager: DBConnectionManager):
|
||||
self.db_manager = db_manager
|
||||
self.prefix = "group:kid_photo:"
|
||||
self.logger = logging.getLogger("DB.KidPhotoRedis")
|
||||
logger = logging.getLogger("DB.KidPhotoRedis")
|
||||
|
||||
def get_redis_connection(self):
|
||||
"""获取Redis连接"""
|
||||
|
||||
@@ -71,8 +71,8 @@ async def handle_mod_contacts(msg: WxMessage):
|
||||
logger.info(f"联系人信息变更: {msg.raw_data}")
|
||||
# 获取对应的Robot实例并刷新联系人
|
||||
robot = robot_instances.get(msg.appid)
|
||||
if robot:
|
||||
robot.refresh_contacts()
|
||||
# if robot:
|
||||
# robot.refresh_contacts()
|
||||
|
||||
|
||||
async def handle_del_contacts(msg: WxMessage):
|
||||
|
||||
@@ -7,11 +7,14 @@ headers = {
|
||||
'X-GEWE-TOKEN': 'cb43f52db27e4a56bb6ec7da54373582',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
app_id = "wx_3BC6eSHGE5xEm_hH3__7c"
|
||||
|
||||
|
||||
def get_chatroom_members():
|
||||
url = "/group/getChatroomMemberList"
|
||||
|
||||
payload = json.dumps({
|
||||
"appId": "wx_3BC6eSHGE5xEm_hH3__7c",
|
||||
"appId": app_id,
|
||||
"chatroomId": "52418238895@chatroom"
|
||||
|
||||
})
|
||||
@@ -20,21 +23,22 @@ def get_chatroom_members():
|
||||
|
||||
print(response.text)
|
||||
|
||||
def revoke_msg():
|
||||
|
||||
def revoke_msg():
|
||||
url = "/message/revokeMsg"
|
||||
|
||||
payload = json.dumps({
|
||||
"appId": "{{appid}}",
|
||||
"appId": app_id,
|
||||
"toWxid": "34757816141@chatroom",
|
||||
"msgId": "769533801",
|
||||
"newMsgId": "5271007655758710001",
|
||||
"createTime": "1704163145"
|
||||
})
|
||||
|
||||
response = requests.request("POST", base_url+url, headers=headers, data=payload)
|
||||
response = requests.request("POST", base_url + url, headers=headers, data=payload)
|
||||
|
||||
print(response.text)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
get_chatroom_members()
|
||||
get_chatroom_members()
|
||||
|
||||
Reference in New Issue
Block a user