using FastEndpoints; using GB5Shared.DTO.Framework.Criteria; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using SkillManagementBLL.SkillDomain; using static GB5Shared.GB5Constant.Constant; namespace SkillDomainManagementSL.EndPoints.SkillDomain { public class GetSkillDomainList : BaseEndpoint> { private readonly ISkillDomainBLL _SkillDomainBLL; public GetSkillDomainList(ISkillDomainBLL ISkillDomainBLL) { _SkillDomainBLL = ISkillDomainBLL; } public override void Configure() { Post("/SkillDomain/GetSkillDomainList"); AllowAnonymous(); } public record GetSkillDomainListParameters( [property: FromHeader] string Login ); protected override async Task> ExecuteAsync(GetSkillDomainListParameters req, LoginDTO LoginDTO, CancellationToken ct) { try { var Result = await _SkillDomainBLL.GetList(LoginDTO!, ct); 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); } } } }