Aggiunta RUID (raw) come segnaposto x richieste verso CALC, da integrare bene ora...

This commit is contained in:
Samuele Locatelli
2025-12-12 16:40:37 +01:00
parent 0960e30acd
commit 8cc25a3fe9
19 changed files with 326 additions and 81 deletions
+19 -1
View File
@@ -64,6 +64,9 @@ namespace Lux.API.Controllers
DictExec.Add("Mode", $"{(int)Egw.Window.Data.Enums.QuestionModes.BOM}");
// UID cablato x ora...
DictExec.Add("UID", id);
// FixMe! todo! gestire con VERE richieste ID da servizio ReqIndexServicer!!!!
DictExec.Add("RUID", GenerateId());
DictExec.Add("SerializedData", currJwd);
int nId = 1;
// da modificare con tipo richiesta...
@@ -77,6 +80,17 @@ namespace Lux.API.Controllers
return Ok(svgContent);
}
private readonly Random _rnd = new Random();
// ---------------------------------------------------------
// ✅ ID incrementale: timestamp ms + random 4-6 chars
// ---------------------------------------------------------
private string GenerateId()
{
long ts = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
string rand = Convert.ToString(_rnd.Next(0x1000, 0xFFFF), 16).ToUpper();
return $"{ts}-{rand}";
}
/// <summary>
/// Chiamata GET: invia richiesta modo 3 (HardwareModelList) che sarà poi salvata
/// GET: api/window/hwlist
@@ -106,6 +120,8 @@ namespace Lux.API.Controllers
DictExec.Add("Mode", $"{(int)Egw.Window.Data.Enums.QuestionModes.HARDWARE}");
// da rivedere?
DictExec.Add("UID", "HW.AGB");
// FixMe! todo! gestire con VERE richieste ID da servizio ReqIndexServicer!!!!
DictExec.Add("RUID", GenerateId());
DictExec.Add("SubMode", $"{(int)Egw.Window.Data.Enums.QuestionHwSubModes.LIST}");
DictExec.Add("Manufacturer", $"{(int)Egw.Window.Data.Enums.HardwareManufacturers.AGB}");
int nId = 1;
@@ -192,7 +208,7 @@ namespace Lux.API.Controllers
id = id.Replace(".svg", "");
}
// se contiene i caratteri casuali x forzare reload --> li levo
if(id.Contains("-"))
if (id.Contains("-"))
{
id = id.Substring(0, id.IndexOf("-"));
}
@@ -242,6 +258,8 @@ namespace Lux.API.Controllers
DictExec.Add("Mode", $"{(int)Egw.Window.Data.Enums.QuestionModes.PREVIEW}");
// UID cablato x ora...
DictExec.Add("UID", id);
// FixMe! todo! gestire con VERE richieste ID da servizio ReqIndexServicer!!!!
DictExec.Add("RUID", GenerateId());
DictExec.Add("SerializedData", currJwd);
int nId = 1;
// da modificare con tipo richiesta...