using FastEndpoints; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using SkillManagementBLL.EmployeeSkillProfile; using static GB5Shared.GB5Constant.Constant; namespace SkillManagementSL.EndPoints.EmployeeSkillProfile { public class GetEmployeeSkillProfileList : BaseEndpoint> { private readonly IEmployeeSkillProfileBLL _EmployeeSkillProfileBLL; public GetEmployeeSkillProfileList(IEmployeeSkillProfileBLL IEmployeeSkillProfileBLL) { _EmployeeSkillProfileBLL = IEmployeeSkillProfileBLL; } public override void Configure() { Get("/EmployeeSkillProfile/GetEmployeeSkillProfileList"); AllowAnonymous(); } public record GetEmployeeSkillProfileListParameters( [property: FromHeader] string Login ); protected override async Task> ExecuteAsync(GetEmployeeSkillProfileListParameters req, LoginDTO LoginDTO, CancellationToken ct) { try { var Result = await _EmployeeSkillProfileBLL.GetEmployeeSkillProfileList(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); } } } }