using FastEndpoints; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using TMSBLL.AssessmentQuestion; using TMSSL.EndPoints.SelectList; using static GB5Shared.GB5Constant.Constant; namespace TMSSL.EndPoints.AssessmentQuestion { public class GetAssessmentQuestionList : BaseEndpoint> { private readonly IAssessmentQuestionBLL _AssesmentQuestionBLL; public GetAssessmentQuestionList(IAssessmentQuestionBLL AssesmentQuestionBLL) { _AssesmentQuestionBLL = AssesmentQuestionBLL; } public override void Configure() { Get("/AssessmentQuestion/GetAssesmentQuestionList"); AllowAnonymous(); } public record GetAssesmentQuestionListParameters( [property: FromHeader] string Login ); //protected override string? GetCacheKey(GeAssesmentQuestionListParameters req, LoginDTO loginDTO) //{ // try // { // return KeyGenerator.KeyGeneration(loginDTO.ClientId, EntityConstant.OBJECAssesmentQuestionPROFILE, CacheKeyLevel.CLIENT_LEVEL, loginDTO); // } // catch (Exception) { throw; } //} protected override async Task> ExecuteAsync(GetAssesmentQuestionListParameters req, LoginDTO loginDTO, CancellationToken ct) { try { var result = await _AssesmentQuestionBLL.GetSelectListAssessmentQuestion(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); } } } }