Removed FromBody
This commit is contained in:
.vscode/thunder-tests
Server
Shared/Models/Stateless
Tests
@ -15,25 +15,60 @@ public class ExportController : Controller, IExportController<IActionResult>
|
||||
public ExportController(IExportRepository exportRepository) =>
|
||||
_ExportRepository = exportRepository;
|
||||
|
||||
private static HeaderCommon GetHeaderCommon(Stream stream)
|
||||
{
|
||||
HeaderCommon? result;
|
||||
if (!stream.CanRead)
|
||||
result = new();
|
||||
else
|
||||
{
|
||||
Task<string> task = new StreamReader(stream).ReadToEndAsync();
|
||||
result = string.IsNullOrEmpty(task.Result) ? null : JsonSerializer.Deserialize<HeaderCommon>(task.Result);
|
||||
result ??= new();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Route("export")]
|
||||
public IActionResult GetExport(HeaderCommon headerCommon) =>
|
||||
Content(_ExportRepository.GetExport(headerCommon));
|
||||
public IActionResult GetExport() =>
|
||||
Content(_ExportRepository.GetExport(GetHeaderCommon(Request.Body)));
|
||||
|
||||
[HttpGet]
|
||||
[Route("headers")]
|
||||
public IActionResult GetHeaders(HeaderCommon headerCommon) =>
|
||||
Json(_ExportRepository.GetHeaders(headerCommon), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
|
||||
public IActionResult GetHeaders() =>
|
||||
Json(_ExportRepository.GetHeaders(GetHeaderCommon(Request.Body)), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
|
||||
|
||||
[HttpGet]
|
||||
[Route("logistics")]
|
||||
public IActionResult GetLogistics(HeaderCommon headerCommon) =>
|
||||
Json(_ExportRepository.GetLogistics(headerCommon), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
|
||||
public IActionResult GetLogistics() =>
|
||||
Json(_ExportRepository.GetLogistics(GetHeaderCommon(Request.Body)), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
|
||||
|
||||
[HttpGet]
|
||||
[Route("pdsf")]
|
||||
[Route("processDataStandardFormat")]
|
||||
public IActionResult GetProcessDataStandardFormat(HeaderCommon headerCommon) =>
|
||||
Content(_ExportRepository.GetProcessDataStandardFormat(headerCommon));
|
||||
public IActionResult GetProcessDataStandardFormat() =>
|
||||
Content(_ExportRepository.GetProcessDataStandardFormat(GetHeaderCommon(Request.Body)));
|
||||
|
||||
[HttpPost]
|
||||
[Route("export")]
|
||||
public IActionResult PostExport() =>
|
||||
Content(_ExportRepository.GetExport(GetHeaderCommon(Request.Body)));
|
||||
|
||||
[HttpPost]
|
||||
[Route("headers")]
|
||||
public IActionResult PostHeaders() =>
|
||||
Json(_ExportRepository.GetHeaders(GetHeaderCommon(Request.Body)), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
|
||||
|
||||
[HttpPost]
|
||||
[Route("logistics")]
|
||||
public IActionResult PostLogistics() =>
|
||||
Json(_ExportRepository.GetLogistics(GetHeaderCommon(Request.Body)), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
|
||||
|
||||
[HttpPost]
|
||||
[Route("pdsf")]
|
||||
[Route("processDataStandardFormat")]
|
||||
public IActionResult PostProcessDataStandardFormat() =>
|
||||
Content(_ExportRepository.GetProcessDataStandardFormat(GetHeaderCommon(Request.Body)));
|
||||
|
||||
}
|
Reference in New Issue
Block a user