LoadPLugins tests

This commit is contained in:
Michał Zieliński
2025-06-08 14:48:33 +02:00
parent 36994bd187
commit 201aec78e3
7 changed files with 62 additions and 68 deletions

View File

@@ -0,0 +1,34 @@
using DiunaBI.Core.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace DiunaBI.WebAPI.Controllers;
[ApiController]
[Route("api/[controller]")]
[Authorize]
public class TestsController : Controller
{
private readonly PluginManager _pluginManager;
public TestsController(
PluginManager pluginManager)
{
_pluginManager = pluginManager;
}
[HttpGet]
[Route("Ping")]
[AllowAnonymous]
public IActionResult Ping()
{
return Ok("Pong");
}
[HttpGet]
[Route("Plugins")]
[AllowAnonymous]
public IActionResult GetPlugins()
{
var plugins = _pluginManager.GetPluginsCount();
return Ok(plugins);
}
}