PDSF (Process Data Standard Format) to use EAF for

pushing to OI
This commit is contained in:
2023-07-24 13:29:13 -07:00
parent 6668806432
commit 4cc5219409
28 changed files with 268 additions and 329 deletions

View File

@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using OI.Metrology.Server.Models;
using OI.Metrology.Shared.Models;
using OI.Metrology.Shared.Models.Stateless;
@ -43,13 +42,6 @@ public partial class InboundController : ControllerBase, IInboundController<IAct
return result;
}
private static JToken GetJToken(Stream stream)
{
string? json = GetJson(stream);
JToken jsonbody = string.IsNullOrEmpty(json) ? JToken.Parse("{}") : JToken.Parse(json);
return jsonbody;
}
[HttpPost]
[Route("{tooltype}")]
public IActionResult Post(string tooltype)
@ -62,8 +54,8 @@ public partial class InboundController : ControllerBase, IInboundController<IAct
}
else
{
JToken jsonbody = GetJToken(Request.Body);
DataResponse dataResponse = _InboundRepository.Data(_MetrologyRepository, _InboundDataService, tooltype, jsonbody);
string? json = GetJson(Request.Body);
DataResponse dataResponse = _InboundRepository.Data(_MetrologyRepository, _InboundDataService, tooltype, json);
if (!dataResponse.Errors.Any())
return Ok(dataResponse);
else