using FastEndpoints; using FrameworkBLL.EIPConversation.EIPAdmin.EIPEventActionAdmin; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using static GB5Shared.GB5Constant.Constant; namespace FrameworkSL.Endpoints.EIPAdmin { public class GetEIPEventActionRunList : BaseEndpoint> { private readonly IEIPEventActionRunAdminBLL _bll; public GetEIPEventActionRunList(IEIPEventActionRunAdminBLL bll) => _bll = bll; public override void Configure() { Get("/EIPAdmin/GetEventActionRunList"); AllowAnonymous(); Description(b => b.WithTags("EIPAdmin")); } protected override string? GetCacheKey(Parameters req, LoginDTO login) => null; protected override async Task> ExecuteAsync( Parameters req, LoginDTO login, CancellationToken ct) { var result = await _bll.GetRunListAsync( req.RunStatus, req.ActionCode, req.FromDate, req.ToDate, login, ct) .ConfigureAwait(false); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse( result, CacheKeyLevel.NOT_REQUIRED, login); } public record Parameters( [property: FromHeader] string? Login, [property: FromQuery] int? RunStatus, [property: FromQuery] string? ActionCode, [property: FromQuery] DateTime? FromDate, [property: FromQuery] DateTime? ToDate); } }