Riorganizzaizone API
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NLog;
|
||||
using WebDoorCreator.Data.DTO;
|
||||
using WebDoorCreator.Data.Services;
|
||||
|
||||
namespace WebDoorCreator.API.Controllers
|
||||
@@ -20,8 +21,7 @@ namespace WebDoorCreator.API.Controllers
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Lunghezza coda in attesa
|
||||
/// </summary>
|
||||
@@ -43,63 +43,39 @@ namespace WebDoorCreator.API.Controllers
|
||||
long numQueue = await QDataServ.NumRequestProcessing();
|
||||
return numQueue;
|
||||
}
|
||||
#endif
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Invio elenco messaggi elaborazioni (se ho errori --> messaggi oppure libero)
|
||||
/// Lunghezza coda in fase di processing
|
||||
/// </summary>
|
||||
/// <param name="ProcMessageList"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("PostProcessingMessage")]
|
||||
public async Task<bool> PostProcessingMessage(Dictionary<string, string> ProcMessageList)
|
||||
[HttpGet("ActLenght")]
|
||||
public async Task<Dictionary<string, long>> ActLenght()
|
||||
{
|
||||
bool answ = false;
|
||||
await Task.Delay(1);
|
||||
Dictionary<string, long> answ = new Dictionary<string, long>();
|
||||
var actPend = await QDataServ.NumRequestPending();
|
||||
answ.Add("pending", actPend);
|
||||
|
||||
var actProc = await QDataServ.NumRequestProcessing();
|
||||
answ.Add("processing", actProc);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invio elenco risultati elaborazioni (modalità boolean di esecuzione corretta)
|
||||
/// </summary>
|
||||
/// <param name="ProcResultList"></param>
|
||||
/// <param name="calcResults">Risultati elaborazioni in formato CalcResultDTO</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("PostProcessingResult")]
|
||||
public async Task<bool> PostProcessingResult(Dictionary<string, bool> ProcResultList)
|
||||
[HttpPost("SaveProcessingResult")]
|
||||
public async Task<bool> SaveProcessingResult(List<CalcResultDTO> calcResults)
|
||||
{
|
||||
bool answ = false;
|
||||
//VC19Check answ = new VC19Check()
|
||||
//{
|
||||
// Result = "KO"
|
||||
//};
|
||||
//var result = await _DataService.InsertCheck(DecodedData, "10.74.82.255");
|
||||
//if (result)
|
||||
//{
|
||||
// answ = new VC19Check
|
||||
// {
|
||||
// DTRecord = DateTime.Now,
|
||||
// CheckRecorded = true,
|
||||
// TimbrRecorder = true,
|
||||
// Result = $"OK, Check Recorded for {DecodedData.nam.fn} {DecodedData.nam.gn} {DecodedData.dob:yyyy.MM.dd}"
|
||||
// };
|
||||
//}
|
||||
//else
|
||||
//{ }
|
||||
await Task.Delay(1);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invio elenco risultati elaborazioni come elenco di SVG
|
||||
/// </summary>
|
||||
/// <param name="ProcSvgList"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("PostProcessingSvg")]
|
||||
public async Task<bool> PostProcessingSvg(Dictionary<string, string> ProcSvgList)
|
||||
{
|
||||
bool answ = false;
|
||||
await Task.Delay(1);
|
||||
bool answ = await QDataServ.SaveProcessingResult(calcResults);
|
||||
return answ;
|
||||
}
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Elenco richieste in stato pending
|
||||
/// </summary>
|
||||
@@ -111,24 +87,6 @@ namespace WebDoorCreator.API.Controllers
|
||||
return actQueue;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Elenco richieste raggruppate x stato
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("ShowQueue")]
|
||||
public async Task<Dictionary<string,Dictionary<string, string>>> ShowQueue()
|
||||
{
|
||||
Dictionary<string, Dictionary<string, string>> answ = new Dictionary<string, Dictionary<string, string>>();
|
||||
var actPend = await QDataServ.RequestPending();
|
||||
answ.Add("pending", actPend);
|
||||
|
||||
var actProc = await QDataServ.RequestProcessing();
|
||||
answ.Add("processing", actProc);
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Elenco richeiste in stato processing
|
||||
/// </summary>
|
||||
@@ -139,6 +97,23 @@ namespace WebDoorCreator.API.Controllers
|
||||
var actQueue = await QDataServ.RequestProcessing();
|
||||
return actQueue;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Elenco richieste raggruppate x stato
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("StatusList")]
|
||||
public async Task<Dictionary<string, Dictionary<string, string>>> StatusList()
|
||||
{
|
||||
Dictionary<string, Dictionary<string, string>> answ = new Dictionary<string, Dictionary<string, string>>();
|
||||
var actPend = await QDataServ.RequestPending();
|
||||
answ.Add("pending", actPend);
|
||||
|
||||
var actProc = await QDataServ.RequestProcessing();
|
||||
answ.Add("processing", actProc);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiede un numero massimo di items dalla coda NB:
|
||||
|
||||
Reference in New Issue
Block a user