This commit is contained in:
2026-01-08 15:18:34 +01:00
parent d385119ca2
commit 33a0b77bf1
111 changed files with 85489 additions and 24 deletions

View File

@@ -0,0 +1,33 @@
using LogCentral.Server.Models;
namespace LogCentral.Server.Services;
public interface ILogService
{
Task AddLogsAsync(List<LogEntry> entries);
Task<LogEntry?> GetLogByIdAsync(string id);
Task<PagedResult<LogEntry>> GetLogsAsync(LogQueryParams queryParams);
Task<Dictionary<string, object>> GetStatsAsync(string? app, string? env);
Task<bool> ValidateApiKeyAsync(string apiKey);
}
public class LogQueryParams
{
public string? Search { get; set; }
public string? Application { get; set; }
public string? Environment { get; set; }
public int? Level { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
public int Page { get; set; } = 1;
public int PageSize { get; set; } = 50;
}
public class PagedResult<T>
{
public List<T> Items { get; set; } = new();
public int TotalCount { get; set; }
public int Page { get; set; }
public int PageSize { get; set; }
public int TotalPages => (int)Math.Ceiling((double)TotalCount / PageSize);
}