✨ 将cd,block,count限制复原配置文件 (#1662)

This commit is contained in:
HibiKier
2024-10-01 00:05:43 +08:00
committed by GitHub
parent d68a4099ba
commit 717a973807
7 changed files with 492 additions and 47 deletions
+26
View File
@@ -1,3 +1,5 @@
from typing_extensions import Self
from tortoise import fields
from zhenxun.services.db_context import Model
@@ -51,6 +53,30 @@ class PluginInfo(Model):
table = "plugin_info"
table_description = "插件基本信息"
@classmethod
async def get_plugin(cls, load_status: bool = True, **kwargs) -> Self | None:
"""获取插件列表
参数:
load_status: 加载状态.
返回:
Self | None: 插件
"""
return await cls.get_or_none(load_status=load_status, **kwargs)
@classmethod
async def get_plugins(cls, load_status: bool = True, **kwargs) -> list[Self]:
"""获取插件列表
参数:
load_status: 加载状态.
返回:
list[Self]: 插件列表
"""
return await cls.filter(load_status=load_status, **kwargs).all()
@classmethod
async def _run_script(cls):
return [