From 5a8d7c1aa8738803b32426f1a3b8d3544732f0d4 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 13 Mar 2026 10:26:51 +0100 Subject: [PATCH] Aggiunto verb versione x chiamate API REST --- Lux.API/Controllers/FileController.cs | 26 +++++++--- Lux.API/Controllers/GenericController.cs | 19 ++++--- Lux.API/Controllers/ImageController.cs | 13 +++++ Lux.API/Controllers/ProdController.cs | 66 +++++++++++++----------- Lux.API/Controllers/WindowController.cs | 17 ++++-- Lux.API/Lux.API.csproj | 2 +- Lux.UI/Lux.UI.csproj | 2 +- Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 2 +- 10 files changed, 100 insertions(+), 51 deletions(-) diff --git a/Lux.API/Controllers/FileController.cs b/Lux.API/Controllers/FileController.cs index 571b4d23..30ab4033 100644 --- a/Lux.API/Controllers/FileController.cs +++ b/Lux.API/Controllers/FileController.cs @@ -1,11 +1,9 @@ using EgwCoreLib.Lux.Data.Services; using EgwMultiEngineManager.Data; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using NLog; -using System; -using System.Data; using System.Diagnostics; +using System.Reflection; using System.Text; namespace Lux.API.Controllers @@ -30,8 +28,6 @@ namespace Lux.API.Controllers #endregion Public Constructors - #region Public Methods - #if false /// /// Chiamata GET: restituisce file PNG (da file o da cache) @@ -77,14 +73,16 @@ namespace Lux.API.Controllers sw.Stop(); _logger.LogInformation($"svgString | {sw.Elapsed.TotalMilliseconds:N3} ms"); return File(bytes, "image/svg+xml"); - } + } #endif + #region Public Methods + /// /// Chiamata GET: restituisce file di un determinato objType /// GET: api/file/POR.25.0000000E?env=WINDOW&type=POR /// GET: api/file/SOR.25.0000000E?env=WINDOW&type=SOR - /// + /// /// nb: al momento solo window e file jwd /// /// uid oggetto @@ -124,6 +122,7 @@ namespace Lux.API.Controllers { case Constants.EXECENVIRONMENTS.NULL: break; + case Constants.EXECENVIRONMENTS.WINDOW: mimeType = "application/octet-stream"; fileName = $"{fileName}.jwd"; @@ -146,6 +145,7 @@ namespace Lux.API.Controllers bytes = Encoding.UTF8.GetBytes(jsonContent); } break; + case Constants.EXECENVIRONMENTS.BEAM: case Constants.EXECENVIRONMENTS.WALL: case Constants.EXECENVIRONMENTS.CABINET: @@ -163,7 +163,17 @@ namespace Lux.API.Controllers } } + [HttpGet("version")] + public string version() + { + var version = Assembly + .GetExecutingAssembly() + .GetName() + .Version? + .ToString() ?? "unknown"; + return version; + } #endregion Public Methods @@ -176,8 +186,8 @@ namespace Lux.API.Controllers #region Private Properties - private ImageCacheService _imgService { get; set; } private DataLayerServices _DSService { get; set; } + private ImageCacheService _imgService { get; set; } #endregion Private Properties } diff --git a/Lux.API/Controllers/GenericController.cs b/Lux.API/Controllers/GenericController.cs index 16dab33f..eeb917ed 100644 --- a/Lux.API/Controllers/GenericController.cs +++ b/Lux.API/Controllers/GenericController.cs @@ -5,7 +5,7 @@ using EgwMultiEngineManager.Data; using Microsoft.AspNetCore.Mvc; using NLog; using System.Diagnostics; -using ZXing.QrCode.Internal; +using System.Reflection; namespace Lux.API.Controllers { @@ -128,6 +128,18 @@ namespace Lux.API.Controllers return Ok(retVal); } + [HttpGet("version")] + public string version() + { + var version = Assembly + .GetExecutingAssembly() + .GetName() + .Version? + .ToString() ?? "unknown"; + + return version; + } + #endregion Public Methods #region Private Fields @@ -146,10 +158,5 @@ namespace Lux.API.Controllers private ImageCacheService _imgService { get; set; } #endregion Private Properties - - #region Private Methods - - - #endregion Private Methods } } \ No newline at end of file diff --git a/Lux.API/Controllers/ImageController.cs b/Lux.API/Controllers/ImageController.cs index 616755e1..3fc2b8fe 100644 --- a/Lux.API/Controllers/ImageController.cs +++ b/Lux.API/Controllers/ImageController.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.StaticFiles; using NLog; using System.Diagnostics; +using System.Reflection; using System.Security.Cryptography; using System.Text; @@ -201,6 +202,18 @@ namespace Lux.API.Controllers return File(bytes, "image/svg+xml"); } + [HttpGet("version")] + public string version() + { + var version = Assembly + .GetExecutingAssembly() + .GetName() + .Version? + .ToString() ?? "unknown"; + + return version; + } + #endregion Public Methods #region Private Fields diff --git a/Lux.API/Controllers/ProdController.cs b/Lux.API/Controllers/ProdController.cs index f897d80b..6f8ca255 100644 --- a/Lux.API/Controllers/ProdController.cs +++ b/Lux.API/Controllers/ProdController.cs @@ -1,14 +1,11 @@ -using EgwCoreLib.Lux.Core.RestPayload; -using EgwCoreLib.Lux.Data.Services; +using EgwCoreLib.Lux.Data.Services; using EgwMultiEngineManager.Data; using Lux.API.Services; -using Microsoft.AspNetCore.Cors.Infrastructure; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.SignalR; using Newtonsoft.Json; using NLog; -using StackExchange.Redis; using System.Diagnostics; +using System.Reflection; using static EgwCoreLib.Lux.Data.Services.ProdService; namespace Lux.API.Controllers @@ -95,7 +92,6 @@ namespace Lux.API.Controllers return NotFound("No Data Found"); } } - private readonly CalcRuidService _calcRuidService; /// /// Chiamata GET: @@ -172,27 +168,6 @@ namespace Lux.API.Controllers return saved; } - /// - /// Chiamata GET: - /// - fornisce il job da eseguire dalla coda (SE presente) - /// GET: api/Prod/rep-answer/ABC012345 - /// - /// - [HttpGet("rep-answer/{uid}")] - public async Task> ReplayAnswer(string uid, int env) - { - Constants.EXECENVIRONMENTS envir = (Constants.EXECENVIRONMENTS)env; - string rawData = await EMProc.LoadRawData(uid, envir); - bool saved = false; - // provo a riprcessare... - var retData = JsonConvert.DeserializeObject(rawData); - if (retData != null) - { - saved = await EMProc.ProcessAnswer(retData); - } - return Ok(rawData); - } - /// /// Chiamata GET: num richieste in coda (se non specificato è waiting, altrimenti ) /// GET: api/Prod/queue-len/WINDOW/ @@ -240,15 +215,48 @@ namespace Lux.API.Controllers return Ok(queueStatus); } + /// + /// Chiamata GET: + /// - fornisce il job da eseguire dalla coda (SE presente) + /// GET: api/Prod/rep-answer/ABC012345 + /// + /// + [HttpGet("rep-answer/{uid}")] + public async Task> ReplayAnswer(string uid, int env) + { + Constants.EXECENVIRONMENTS envir = (Constants.EXECENVIRONMENTS)env; + string rawData = await EMProc.LoadRawData(uid, envir); + bool saved = false; + // provo a riprcessare... + var retData = JsonConvert.DeserializeObject(rawData); + if (retData != null) + { + saved = await EMProc.ProcessAnswer(retData); + } + return Ok(rawData); + } + + [HttpGet("version")] + public string version() + { + var version = Assembly + .GetExecutingAssembly() + .GetName() + .Version? + .ToString() ?? "unknown"; + + return version; + } + #endregion Public Methods #region Private Fields private static Logger Log = LogManager.GetCurrentClassLogger(); - private ProdService PService; + private readonly CalcRuidService _calcRuidService; private ExternalMessageProcessor EMProc; + private ProdService PService; #endregion Private Fields - } } \ No newline at end of file diff --git a/Lux.API/Controllers/WindowController.cs b/Lux.API/Controllers/WindowController.cs index f83a9c1d..9eaff569 100644 --- a/Lux.API/Controllers/WindowController.cs +++ b/Lux.API/Controllers/WindowController.cs @@ -1,11 +1,10 @@ -using Egw.Window.Data; -using EgwCoreLib.Lux.Core; -using EgwCoreLib.Lux.Data.DbModel.Config; +using EgwCoreLib.Lux.Data.DbModel.Config; using EgwCoreLib.Lux.Data.Services; using EgwMultiEngineManager.Data; using Microsoft.AspNetCore.Mvc; using NLog; using System.Diagnostics; +using System.Reflection; namespace Lux.API.Controllers { @@ -253,6 +252,18 @@ namespace Lux.API.Controllers return Ok(svgContent); } + [HttpGet("version")] + public string version() + { + var version = Assembly + .GetExecutingAssembly() + .GetName() + .Version? + .ToString() ?? "unknown"; + + return version; + } + #endregion Public Methods #region Private Fields diff --git a/Lux.API/Lux.API.csproj b/Lux.API/Lux.API.csproj index 3b534e54..f16eecf7 100644 --- a/Lux.API/Lux.API.csproj +++ b/Lux.API/Lux.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 1.1.2603.1207 + 1.1.2603.1310 diff --git a/Lux.UI/Lux.UI.csproj b/Lux.UI/Lux.UI.csproj index de6f460b..6c37c2fb 100644 --- a/Lux.UI/Lux.UI.csproj +++ b/Lux.UI/Lux.UI.csproj @@ -5,7 +5,7 @@ enable enable aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50 - 1.1.2603.1207 + 1.1.2603.1310 diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 7f6402c5..baff22cb 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ LUX - Web Windows MES -

Versione: 1.1.2603.1207

+

Versione: 1.1.2603.1310


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 73b6257b..99c55132 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2603.1207 +1.1.2603.1310 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index d36d2ed9..122035e9 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2603.1207 + 1.1.2603.1310 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false