using FastEndpoints; using FrameworkBLL.DiagnosticsCenter; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using static FrameworkDAL.Constant.Constant; namespace FrameworkSL.Endpoints.DiagnosticsCenter; public class GetSessionDiagnostics : BaseEndpoint> { private readonly IDiagnosticsCenterBLL _bll; public GetSessionDiagnostics(IDiagnosticsCenterBLL bll) => _bll = bll; public override void Configure() { Get("/DiagnosticsCenter/GetSessionDiagnostics"); AllowAnonymous(); } protected override string? GetCacheKey(Parameters req, LoginDTO login) => null; protected override async Task> ExecuteAsync( Parameters req, LoginDTO login, CancellationToken ct) { var result = await _bll.GetSessionDiagnosticsAsync(login, ct).ConfigureAwait(false); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse( result, CacheKeyLevel.NotRequired, login); } public record Parameters([property: FromHeader] string Login); }