This commit is contained in:
jxxghp
2023-06-19 15:44:24 +08:00
parent 6417659f14
commit 5f48d9d4a2
16 changed files with 130 additions and 48 deletions

View File

@ -10,7 +10,7 @@ from app.db.userauth import get_current_active_user
router = APIRouter()
@router.get("/", response_model=schemas.Response)
@router.get("/", summary="运行插件方法", response_model=schemas.Response)
@router.post("/")
async def run_plugin_method(plugin_id: str, method: str,
_: User = Depends(get_current_active_user),
@ -23,3 +23,7 @@ async def run_plugin_method(plugin_id: str, method: str,
method=method,
*args,
**kwargs)
# 注册插件API
for api in PluginManager().get_plugin_apis():
router.add_api_route(**api)