Update metodi x nuove chaimate test non ancora completate
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using EgwCoreLib.Lux.Data.Services;
|
||||
using EgwCoreLib.Lux.Core;
|
||||
using EgwCoreLib.Lux.Data.Services;
|
||||
using EgwMultiEngineManager.Data;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NLog;
|
||||
@@ -63,7 +64,7 @@ namespace Lux.API.Controllers
|
||||
DictExec.Add("Jwd", currJwd);
|
||||
int nId = 1;
|
||||
// da modificare con tipo richiesta...
|
||||
QuestionDTO currArgs = new QuestionDTO(nId, Constants.EXECENVIRONMENTS.WINDOW, DictExec);
|
||||
QuestionDTO currArgs = new QuestionDTO(nId, EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, DictExec);
|
||||
|
||||
await _redisService.PublishAsync(pubChannel, currArgs.sProcessArgs);
|
||||
svgContent = "DONE";
|
||||
@@ -73,6 +74,42 @@ namespace Lux.API.Controllers
|
||||
return Ok(svgContent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiamata POST: riceve Json in formato serializzato, invia richiesta calcolo modo 3 (HardwareModelList)
|
||||
/// PUT: api/window/bom/00000000-0000-0000-0000-000000000000
|
||||
/// </summary>
|
||||
/// <param name="id">id oggetto</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("hwlist/{id}")]
|
||||
public async Task<ActionResult<string>> getHardwareList(string id, [FromBody] string currJwd)
|
||||
{
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
string hwContent = "";
|
||||
|
||||
// se messaggio vuoto --> uso default!
|
||||
currJwd = string.IsNullOrEmpty(currJwd) ? demoJwd : currJwd;
|
||||
|
||||
// ...se ricevo percorso --> leggo json raw
|
||||
if (!string.IsNullOrEmpty(currJwd))
|
||||
{
|
||||
Dictionary<string, string> DictExec = new Dictionary<string, string>();
|
||||
DictExec.Add("Mode", $"{(int)Enums.EngineQueryType.HardwareModelList}");
|
||||
// UID cablato x ora...
|
||||
DictExec.Add("UID", id);
|
||||
DictExec.Add("Jwd", currJwd);
|
||||
int nId = 1;
|
||||
// da modificare con tipo richiesta...
|
||||
QuestionDTO currArgs = new QuestionDTO(nId, EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, DictExec);
|
||||
|
||||
await _redisService.PublishAsync(pubChannel, currArgs.sProcessArgs);
|
||||
hwContent = "DONE";
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Info($"getBom | {sw.Elapsed.TotalMilliseconds:N3} ms");
|
||||
return Ok(hwContent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiamata GET: restituisce file SVG (da file o da cache)
|
||||
/// PUT: api/window/svg/00000000-0000-0000-0000-000000000000
|
||||
@@ -104,7 +141,7 @@ namespace Lux.API.Controllers
|
||||
/// <returns></returns>
|
||||
[HttpGet("svgfile/{id}")]
|
||||
[HttpGet("svg-file/{id}")]
|
||||
public async Task<ActionResult<string>> svgFile(string id, Constants.EXECENVIRONMENTS env = Constants.EXECENVIRONMENTS.WINDOW)
|
||||
public async Task<ActionResult<string>> svgFile(string id, EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS env = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW)
|
||||
{
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
@@ -120,7 +157,7 @@ namespace Lux.API.Controllers
|
||||
|
||||
string svgContent = await _imgService.LoadSvgAsync(id, env);
|
||||
// se vuoto --> leggo img logo...
|
||||
if(string.IsNullOrEmpty(svgContent))
|
||||
if (string.IsNullOrEmpty(svgContent))
|
||||
{
|
||||
string filePath = Path.Combine("DemoImg", "LogoEgalware.svg");
|
||||
svgContent = await System.IO.File.ReadAllTextAsync(filePath);
|
||||
@@ -166,7 +203,7 @@ namespace Lux.API.Controllers
|
||||
DictExec.Add("Jwd", currJwd);
|
||||
int nId = 1;
|
||||
// da modificare con tipo richiesta...
|
||||
QuestionDTO currArgs = new QuestionDTO(nId, Constants.EXECENVIRONMENTS.WINDOW, DictExec);
|
||||
QuestionDTO currArgs = new QuestionDTO(nId, EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, DictExec);
|
||||
|
||||
await _redisService.PublishAsync(pubChannel, currArgs.sProcessArgs);
|
||||
svgContent = "DONE";
|
||||
|
||||
Reference in New Issue
Block a user