minor typo su controller IOB
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using MP.Core.DTO;
|
||||
using MP.Core.Objects;
|
||||
using MP.Data.DbModels;
|
||||
@@ -798,31 +798,33 @@ namespace MP.IOC.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera TASK richiesto x macchina:
|
||||
/// Recupera i task richiesti per la macchina indicata:
|
||||
/// GET: IOB/getTask2Exe/SIMUL_03
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns>Json contenente 1..n task da eseguire</returns>
|
||||
/// <param name="id">ID della macchina</param>
|
||||
/// <returns>Dictionary contenente i task da eseguire</returns>
|
||||
[HttpGet("getTask2Exe/{id}")]
|
||||
public async Task<IActionResult> GetTask2Exe(string id)
|
||||
{
|
||||
if (string.IsNullOrEmpty(id)) return BadRequest("Missing ID");
|
||||
|
||||
// Multi: gestione carattere "|" trasformato in "#"
|
||||
id = id.Replace("|", "#");
|
||||
Dictionary<string, string> valori = new();
|
||||
id = id.Replace('|', '#');
|
||||
|
||||
try
|
||||
{
|
||||
await DService.ScriviKeepAliveAsync(id, DateTime.Now);
|
||||
// leggo da REDIS eventuale elenco task x macchina...
|
||||
valori = await DService.GetTask2ExeMacchinaAsync(id);
|
||||
await DService.ScriviKeepAliveAsync(id, DateTime.UtcNow);
|
||||
var valori = await DService.GetTask2ExeMacchinaAsync(id);
|
||||
|
||||
if (valori == null || valori.Count == 0)
|
||||
return Ok(new Dictionary<string, string>());
|
||||
|
||||
return Ok(valori);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore in GetTask2Exe{Environment.NewLine}{exc}");
|
||||
return StatusCode(StatusCodes.Status500InternalServerError, "NO");
|
||||
Log.Error(exc, "Errore nel recupero dei task per la macchina {MachineId}", id);
|
||||
return StatusCode(StatusCodes.Status500InternalServerError, "Errore interno | GetTask2Exe");
|
||||
}
|
||||
return Ok(valori);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user