using AMPBLL.API; using FastEndpoints; using GB5Shared.DTO.Framework.Criteria; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using static GB5Shared.GB5Constant.Constant; namespace AmpSL.Endpoints.API; public class GetAPIList : BaseEndpoint> { private readonly IAPIBLL _APIBLL; public GetAPIList(IAPIBLL IAPIBLL) { _APIBLL = IAPIBLL; } public override void Configure() { Post("/API/GetAPIList"); AllowAnonymous(); } public record GetAPIListParameters( [property: FromHeader] string Login, [property: FromBody] CriteriaDTO CriteriaDTO, [property: QueryParam] int FirstNumber, [property: QueryParam] int MaxResult ); protected override async Task> ExecuteAsync(GetAPIListParameters req, LoginDTO LoginDTO, CancellationToken ct) { var Result = await _APIBLL.GetAPIList(req.FirstNumber, req.MaxResult, req.CriteriaDTO, LoginDTO!, ct); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse(Result, CacheKeyLevel.NOT_REQUIRED, LoginDTO); } }