perf👌: 实现优化webui群组/好友管理api

This commit is contained in:
HibiKier
2024-01-09 13:47:24 +08:00
parent 9a1510fe7e
commit bf55a20241
7 changed files with 443 additions and 95 deletions
+2 -6
View File
@@ -5,7 +5,6 @@ from typing import List, Optional
import nonebot
from fastapi import APIRouter, WebSocket
from nonebot.utils import escape_tag
from starlette.websockets import WebSocket, WebSocketDisconnect, WebSocketState
from tortoise.functions import Count
from websockets.exceptions import ConnectionClosedError, ConnectionClosedOK
@@ -18,21 +17,18 @@ from services.log import logger
from utils.manager import plugin_data_manager, plugins2settings_manager, plugins_manager
from ....base_model import Result
from ....config import QueryDateType
from ....config import AVA_URL, GROUP_AVA_URL, QueryDateType
from ....utils import authentication, get_system_status
from .data_source import bot_live
from .model import ActiveGroup, BaseInfo, ChatHistoryCount, HotPlugin
AVA_URL = "http://q1.qlogo.cn/g?b=qq&nk={}&s=160"
GROUP_AVA_URL = "http://p.qlogo.cn/gh/{}/{}/640/"
run_time = time.time()
ws_router = APIRouter()
router = APIRouter()
@router.get("/get_base_info", dependencies=[authentication()], description="基础信息")
async def _(bot_id: Optional[str] = None) -> Result:
"""