Files
Heimdall/src/Heimdall.Api/Controllers/StatsController.cs
T

24 lines
759 B
C#
Raw Normal View History

using Heimdall.Application.DTOs;
using Heimdall.Application.Services;
2026-07-17 17:22:33 +00:00
using Heimdall.Infrastructure.Security;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Heimdall.Api.Controllers;
[ApiController]
[Route("api/stats")]
public class StatsController : ControllerBase
{
private readonly IStatsService _statsService;
2026-07-17 17:22:33 +00:00
public StatsController(IStatsService statsService) => _statsService = statsService;
2026-07-17 17:22:33 +00:00
[Authorize(AuthenticationSchemes = "JwtBearer", Policy = AppPermissions.SiteRead)]
[HttpGet]
public async Task<IActionResult> GetStats(CancellationToken ct)
{
var stats = await _statsService.GetStatsAsync(ct);
return Ok(new { data = stats, timestamp = DateTime.UtcNow });
2026-07-17 17:22:33 +00:00
}
}