using FastEndpoints; using FrameworkBLL.ActionPanel; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using System; using System.Threading; using System.Threading.Tasks; using static GB5Shared.GB5Constant.Constant; namespace FrameworkSL.Endpoints.QuickAction { // Full-row load for the Quick Action admin screen (mirrors ActionPanel/GetAllActionPanel). public class GetAllQuickAction : BaseEndpoint { private readonly IActionPanelBLL _actionPanelBLL; public GetAllQuickAction(IActionPanelBLL actionPanelBLL) { _actionPanelBLL = actionPanelBLL; } public override void Configure() { Get("/QuickAction/GetAllQuickAction"); AllowAnonymous(); } public record GetAllQuickActionParameters([property: FromHeader] string Login); protected override async Task> ExecuteAsync(GetAllQuickActionParameters req, LoginDTO loginDTO, CancellationToken ct) { try { var result = await _actionPanelBLL.GetAllQuickAction(loginDTO, ct); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse(result, CacheKeyLevel.CLIENT_LEVEL, loginDTO); } catch (Exception ex) { return await GB5Shared.ResponseStandard.Response.CreateExceptionError(ex, CacheKeyLevel.CLIENT_LEVEL, loginDTO, ex.Message, 500); } } } }