mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
🐛 优化数据库API,移除冗余导入及修正SQL_DICT引用
This commit is contained in:
parent
280f991347
commit
52f4081e0b
@ -3,7 +3,6 @@ from fastapi.responses import JSONResponse
|
||||
import nonebot
|
||||
from nonebot.drivers import Driver
|
||||
from tortoise import Tortoise
|
||||
from tortoise.exceptions import OperationalError
|
||||
|
||||
from zhenxun.configs.config import BotConfig
|
||||
from zhenxun.models.plugin_info import PluginInfo
|
||||
@ -141,5 +140,5 @@ async def _(query: QueryModel) -> Result[BaseResultModel]:
|
||||
)
|
||||
async def _(plugin_name: str | None = None) -> Result[dict]:
|
||||
if plugin_name:
|
||||
return Result.ok(SQL_DICT.get(plugin_name))
|
||||
return Result.ok(str(SQL_DICT))
|
||||
return Result.ok(ApiDataSource.SQL_DICT.get(plugin_name))
|
||||
return Result.ok(str(ApiDataSource.SQL_DICT))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user