using FastEndpoints; using FrameworkBLL.EIPConversation.EIPAdmin.EIPActionRegistryAdmin; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using static GB5Shared.GB5Constant.Constant; namespace FrameworkSL.Endpoints.EIPAdmin { public class GetActionRegistry : BaseEndpoint> { private readonly IEIPActionRegistryAdminBLL _bll; public GetActionRegistry(IEIPActionRegistryAdminBLL bll) => _bll = bll; public override void Configure() { Get("/EIPAdmin/GetActionRegistry"); AllowAnonymous(); Description(b => b.WithTags("EIPAdmin")); } protected override string? GetCacheKey(Parameters req, LoginDTO login) => $"ActionRegistry:{login.ClientId}:{req.ActionId}"; protected override async Task> ExecuteAsync( Parameters req, LoginDTO login, CancellationToken ct) { var result = await _bll.GetActionRegistryAsync(req.ActionId, login, ct) .ConfigureAwait(false); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse( result, CacheKeyLevel.CLIENT_LEVEL, login); } public record Parameters( [property: FromHeader] string? Login, [property: QueryParam] int ActionId); } }