From 3cee0fb902b668cd2dd601b2eb81c7d132a5e80e Mon Sep 17 00:00:00 2001 From: Bruno Date: Mon, 28 Oct 2024 19:11:50 -0300 Subject: [PATCH] fix --- OpenAdm.Api/Program.cs | 8 ++++---- OpenAdm.Infra/Cached/Services/CachedService.cs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/OpenAdm.Api/Program.cs b/OpenAdm.Api/Program.cs index e03f16c..0cac77c 100644 --- a/OpenAdm.Api/Program.cs +++ b/OpenAdm.Api/Program.cs @@ -62,10 +62,10 @@ app.UseSwagger(c => { c.RouteTemplate = "swagger/{documentName}/swagger.json"; - c.PreSerializeFilters.Add((swaggerDoc, httpReq) => - { - swaggerDoc.Servers = new List { new OpenApiServer { Url = $"{httpReq.Scheme}://{httpReq.Host.Value}{basePath}" } }; - }); + //c.PreSerializeFilters.Add((swaggerDoc, httpReq) => + //{ + // swaggerDoc.Servers = new List { new OpenApiServer { Url = $"{httpReq.Scheme}://{httpReq.Host.Value}{basePath}" } }; + //}); }); app.UseSwaggerUI(); } diff --git a/OpenAdm.Infra/Cached/Services/CachedService.cs b/OpenAdm.Infra/Cached/Services/CachedService.cs index ef39063..a18aa88 100644 --- a/OpenAdm.Infra/Cached/Services/CachedService.cs +++ b/OpenAdm.Infra/Cached/Services/CachedService.cs @@ -13,7 +13,7 @@ public class CachedService : ICachedService where T : class private readonly JsonSerializerOptions _serializerOptions; private static readonly double _absolutExpiration = 5; private static readonly double _slidingExpiration = 3; - private readonly string _keyParceiro; + private readonly IParceiroAutenticado _parceiroAutenticado; public CachedService(IDistributedCache distributedCache, IParceiroAutenticado parceiroAutenticado) @@ -29,7 +29,7 @@ public CachedService(IDistributedCache distributedCache, .SetSlidingExpiration(TimeSpan.FromMinutes(_slidingExpiration)); _distributedCache = distributedCache; - _keyParceiro = parceiroAutenticado.KeyParceiro; + _parceiroAutenticado = parceiroAutenticado; } public async Task GetItemAsync(string key) @@ -74,6 +74,6 @@ private static void Valid(string key) private string GetNewKey(string key) { - return $"{_keyParceiro}-{key}"; + return $"{_parceiroAutenticado.KeyParceiro}-{key}"; } }