优化返回内容
This commit is contained in:
@@ -209,7 +209,7 @@ def api_group_members(roomid):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
server = current_app.dashboard_server
|
server = current_app.dashboard_server
|
||||||
group_members = server.contact_db.get_chatroom_member_list(roomid)
|
group_members = server.contact_db.get_chatroom_small_member_list(roomid)
|
||||||
return jsonify({
|
return jsonify({
|
||||||
"success": True,
|
"success": True,
|
||||||
"data": {
|
"data": {
|
||||||
|
|||||||
@@ -609,6 +609,16 @@ class ContactsDBOperator(BaseDBOperator):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.LOG.error(f"获取群{chatroom_id}成员列表失败: {e}")
|
self.LOG.error(f"获取群{chatroom_id}成员列表失败: {e}")
|
||||||
return []
|
return []
|
||||||
|
# 新增获取群成员列表接口
|
||||||
|
def get_chatroom_small_member_list(self, chatroom_id: str) -> List[dict]:
|
||||||
|
"""获取群成员列表"""
|
||||||
|
try:
|
||||||
|
sql = "SELECT wxid,nick_name,display_name,status,latest_active_time FROM t_chatroom_member WHERE chatroom_id = %s"
|
||||||
|
results = self.execute_query(sql, (chatroom_id,))
|
||||||
|
return results
|
||||||
|
except Exception as e:
|
||||||
|
self.LOG.error(f"获取群{chatroom_id}成员列表失败: {e}")
|
||||||
|
return []
|
||||||
|
|
||||||
# 获取群成员的昵称信息
|
# 获取群成员的昵称信息
|
||||||
def get_chatroom_member_list_name_all(self) -> List[dict]:
|
def get_chatroom_member_list_name_all(self) -> List[dict]:
|
||||||
|
|||||||
Reference in New Issue
Block a user