From 17201d746f810e2ac4b9dce20145f39533d74569 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 23 Mar 2026 19:39:17 +0100 Subject: [PATCH] Refresh (da testare) --- .../DataServiceCollectionExtensions.cs | 3 ++- Lux.API/Controllers/GenericController.cs | 11 +++-------- Lux.API/Controllers/ProdController.cs | 4 ++-- Lux.API/Controllers/WindowController.cs | 7 +++---- Lux.API/Program.cs | 5 +++-- Lux.API/Services/ExternalMessageProcessor.cs | 13 +++++-------- Lux.UI/Program.cs | 6 +++--- 7 files changed, 21 insertions(+), 28 deletions(-) diff --git a/EgwCoreLib.Lux.Data/DataServiceCollectionExtensions.cs b/EgwCoreLib.Lux.Data/DataServiceCollectionExtensions.cs index f84c28cc..f9e5be71 100644 --- a/EgwCoreLib.Lux.Data/DataServiceCollectionExtensions.cs +++ b/EgwCoreLib.Lux.Data/DataServiceCollectionExtensions.cs @@ -94,8 +94,9 @@ namespace EgwCoreLib.Lux.Data services.TryAddScoped(); // Facade / DataLayerService - //builder.Services.AddSingleton(); services.TryAddScoped(); + services.TryAddScoped(); + //builder.Services.AddSingleton(); //services.TryAddScoped(); // aggiunta servizi finali Singleton... diff --git a/Lux.API/Controllers/GenericController.cs b/Lux.API/Controllers/GenericController.cs index 8c213aa9..72493495 100644 --- a/Lux.API/Controllers/GenericController.cs +++ b/Lux.API/Controllers/GenericController.cs @@ -16,7 +16,7 @@ namespace Lux.API.Controllers { #region Public Constructors - public GenericController(IConfiguration config, IRedisService redisService, ImageCacheService imgServ, CalcRuidService crService) + public GenericController(IConfiguration config, IRedisService redisService, IImageCacheService imgServ, ICalcRuidService crService) { _config = config; _redisService = redisService; @@ -146,18 +146,13 @@ namespace Lux.API.Controllers #region Private Fields private static Logger Log = LogManager.GetCurrentClassLogger(); - private readonly CalcRuidService _calcRuidService; + private readonly ICalcRuidService _calcRuidService; + private readonly IImageCacheService _imgService; private readonly IRedisService _redisService; private readonly string chPub = ""; private IConfiguration _config; #endregion Private Fields - - #region Private Properties - - private ImageCacheService _imgService { get; set; } - - #endregion Private Properties } } \ No newline at end of file diff --git a/Lux.API/Controllers/ProdController.cs b/Lux.API/Controllers/ProdController.cs index 6f8ca255..68a6d12a 100644 --- a/Lux.API/Controllers/ProdController.cs +++ b/Lux.API/Controllers/ProdController.cs @@ -22,7 +22,7 @@ namespace Lux.API.Controllers /// /// /// - public ProdController(ProdService prodService, ExternalMessageProcessor extMessProc, CalcRuidService crService) + public ProdController(ProdService prodService, ExternalMessageProcessor extMessProc, ICalcRuidService crService) { PService = prodService; EMProc = extMessProc; @@ -253,7 +253,7 @@ namespace Lux.API.Controllers #region Private Fields private static Logger Log = LogManager.GetCurrentClassLogger(); - private readonly CalcRuidService _calcRuidService; + private readonly ICalcRuidService _calcRuidService; private ExternalMessageProcessor EMProc; private ProdService PService; diff --git a/Lux.API/Controllers/WindowController.cs b/Lux.API/Controllers/WindowController.cs index dcf321a8..3588be73 100644 --- a/Lux.API/Controllers/WindowController.cs +++ b/Lux.API/Controllers/WindowController.cs @@ -15,7 +15,7 @@ namespace Lux.API.Controllers { #region Public Constructors - public WindowController(IConfiguration config, IRedisService redisService, ImageCacheService imgServ, ConfigDataService confServ, CalcRuidService crService) + public WindowController(IConfiguration config, IRedisService redisService, IImageCacheService imgServ, ConfigDataService confServ, ICalcRuidService crService) { _config = config; _redisService = redisService; @@ -270,7 +270,8 @@ namespace Lux.API.Controllers #region Private Fields private static Logger Log = LogManager.GetCurrentClassLogger(); - private readonly CalcRuidService _calcRuidService; + private readonly ICalcRuidService _calcRuidService; + private readonly IImageCacheService _imgService; private readonly IRedisService _redisService; private readonly string chPub = ""; @@ -289,8 +290,6 @@ namespace Lux.API.Controllers private ConfigDataService _confService { get; set; } - private ImageCacheService _imgService { get; set; } - #endregion Private Properties #region Private Methods diff --git a/Lux.API/Program.cs b/Lux.API/Program.cs index e79417c9..7608f133 100644 --- a/Lux.API/Program.cs +++ b/Lux.API/Program.cs @@ -166,8 +166,9 @@ builder.Services.AddScoped(); // servizi hosted usano scope factory builder.Services.AddHostedService(); -// init servizio gestone ReqIndex -builder.Services.AddScoped(); +//// init servizio gestone ReqIndex +////builder.Services.AddScoped(); +//builder.Services.AddScoped(); builder.Services.AddHostedService(); diff --git a/Lux.API/Services/ExternalMessageProcessor.cs b/Lux.API/Services/ExternalMessageProcessor.cs index 6bdef134..05dbe040 100644 --- a/Lux.API/Services/ExternalMessageProcessor.cs +++ b/Lux.API/Services/ExternalMessageProcessor.cs @@ -19,7 +19,7 @@ namespace Lux.API.Services /// /// /// - public ExternalMessageProcessor(ImageCacheService imgService, DataLayerServices dlService, CalcRuidService crService, ProdService prodService) + public ExternalMessageProcessor(IImageCacheService imgService, DataLayerServices dlService, ICalcRuidService crService, ProdService prodService) { cacheService = imgService; dbService = dlService; @@ -27,9 +27,6 @@ namespace Lux.API.Services _prodService = prodService; } - private readonly CalcRuidService _calcRuidService; - private readonly ProdService _prodService; - #endregion Public Constructors #region Public Methods @@ -199,7 +196,7 @@ namespace Lux.API.Services // gestione ritorno tipo Balance dei gruppi di lavorazione (x carico macchine/schedulazione) if (retData.Args.ContainsKey("Balance")) { - // ATTENZIONE! qui oltre al valore UID deve leggere ANCHE il gruppo cui è riferito (es: Group: 1) + // ATTENZIONE! qui oltre al valore UID deve leggere ANCHE il gruppo cui è riferito (es: Group: 1) // recupero lista risultati calcolo... string refGroup = retData.Args["Group"]; string rawBalance = retData.Args["Balance"]; @@ -258,7 +255,6 @@ namespace Lux.API.Services saved = true; } - // gestione ritorno lista AreaProfiles per live JWD if (retData.Args.ContainsKey("AreaProfiles")) { @@ -287,7 +283,6 @@ namespace Lux.API.Services return saved; } - /// /// Salvataggio della risposta in formato RawData x Debug /// @@ -304,7 +299,9 @@ namespace Lux.API.Services #region Private Fields private static Logger Log = LogManager.GetCurrentClassLogger(); - private readonly ImageCacheService cacheService; + private readonly ICalcRuidService _calcRuidService; + private readonly ProdService _prodService; + private readonly IImageCacheService cacheService; private readonly DataLayerServices dbService; private string redisBaseKey = "Lux:Cache"; diff --git a/Lux.UI/Program.cs b/Lux.UI/Program.cs index d42a7b24..65580bb1 100644 --- a/Lux.UI/Program.cs +++ b/Lux.UI/Program.cs @@ -190,9 +190,9 @@ builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); -// init servizio gestone ReqIndex -builder.Services.AddScoped(); -//builder.Services.AddSingleton(new CalcRuidService(configuration, redisConn)); +//// init servizio gestone ReqIndex +//builder.Services.AddScoped(); +////builder.Services.AddSingleton(new CalcRuidService(configuration, redisConn)); // lo gestisco solo via API... #if false