using EAIAdminBLL.EAIModelConfigAdmin; using FastEndpoints; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using static GB5Shared.GB5Constant.Constant; namespace EAIAdminSL.Endpoints { public class GetEAIModelConfigList : BaseEndpoint> { private readonly IEAIModelConfigAdminBLL _bll; public GetEAIModelConfigList(IEAIModelConfigAdminBLL bll) => _bll = bll; public override void Configure() { Get("/EAIAdmin/GetModelConfigList"); AllowAnonymous(); Description(b => b.WithTags("EAIAdmin")); } protected override string? GetCacheKey(Parameters req, LoginDTO login) => $"EAIModelConfigList:{login.ClientId}:{req.Search}"; protected override async Task> ExecuteAsync( Parameters req, LoginDTO login, CancellationToken ct) { var result = await _bll.GetModelConfigListAsync(req.Search, login, ct) .ConfigureAwait(false); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse( result, CacheKeyLevel.CLIENT_LEVEL, login); } public record Parameters( [property: FromHeader] string? Login, string? Search); } }