using FastEndpoints; using GB5Shared.DTO.Framework.Criteria; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using MMBLL.Indent; using static GB5Shared.GB5Constant.Constant; namespace MMSL.EndPoints.Indent { public class GetListIndent : BaseEndpoint> { private readonly IIndentBLL _IndentBLL; public GetListIndent(IIndentBLL IIndentBLL) { _IndentBLL = IIndentBLL; } public override void Configure() { Post("/Indent/GetListofIndent"); AllowAnonymous(); } public record GetListIndentParameters( [property: FromHeader] string Login, [property: FromBody] CriteriaDTO CriteriaDTO ); protected override async Task> ExecuteAsync(GetListIndentParameters req, LoginDTO LoginDTO, CancellationToken ct) { try { var Result = await _IndentBLL.GetListOfIndent(req.CriteriaDTO, LoginDTO!); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse(Result, CacheKeyLevel.NOT_REQUIRED, LoginDTO); } catch (Exception ex) { return await GB5Shared.ResponseStandard.Response.CreateExceptionError(ex, CacheKeyLevel.NOT_REQUIRED, LoginDTO, ex.Message, 500); } } } }