using EnablementBLL.Show; using EnablementSL.Parameters.Show; using FastEndpoints; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; namespace EnablementSL.Endpoints.Show; // Dropdown data (Module/Space/Channel/ContentCategory/UserGroup/SubscriptionType) for the Show // authoring form. Separate from GetSelectListShow, which returns existing Shows rather than the // option lists needed to fill out the form fields. public class GetShowPicklist : BaseEndpoint> { private readonly IShowBLL _bll; public GetShowPicklist(IShowBLL bll) => _bll = bll; public override void Configure() { Get("/Enablement/GetShowPicklist"); AllowAnonymous(); } protected override string? GetCacheKey(GetShowPicklistParameters req, LoginDTO login) => null; protected override async Task> ExecuteAsync( GetShowPicklistParameters req, LoginDTO login, CancellationToken ct) { try { var result = await _bll.GetShowPicklist(login).ConfigureAwait(false); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse( result, GB5Shared.GB5Constant.Constant.CacheKeyLevel.CLIENT_LEVEL, login); } catch (Exception ex) { return await GB5Shared.ResponseStandard.Response.CreateExceptionError( ex, GB5Shared.GB5Constant.Constant.CacheKeyLevel.CLIENT_LEVEL, login, ex.Message, 500); } } }