Files
DiunaBI/DiunaBI.API/Controllers/TestsController.cs

50 lines
1.2 KiB
C#
Raw Permalink Normal View History

2025-11-18 20:38:35 +01:00
using DiunaBI.Infrastructure.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace DiunaBI.API.Controllers;
[ApiController]
[Route("[controller]")]
[Authorize]
public class TestsController : Controller
{
private readonly PluginManager _pluginManager;
private readonly ILogger<LayersController> _logger;
public TestsController(
PluginManager pluginManager,
ILogger<LayersController> logger)
{
_pluginManager = pluginManager;
_logger = logger;
}
[HttpGet]
[Route("Ping")]
[AllowAnonymous]
public IActionResult Ping()
{
var tmp = new
{
a = 2,
b = "test"
};
var tmp2 = new
{
a = 2,
b = "test"
};
var user = User.Identity;
_logger.LogInformation("LogTest: OldValue {tmp}, NewValue {tmp2}, ChangedBy: {user}", tmp, tmp2, user?.Name);
return Ok("Pong");
}
[HttpGet]
[Route("Plugins")]
[AllowAnonymous]
public IActionResult GetPlugins()
{
var plugins = _pluginManager.GetPluginsCount();
return Ok(plugins);
}
2025-06-08 14:48:33 +02:00
}