This commit is contained in:
@@ -165,12 +165,11 @@ namespace AyaNova.Api.Controllers
|
||||
/// <summary>
|
||||
/// Render Report
|
||||
/// </summary>
|
||||
/// <param name="reportId">Id of report template saved to db</param>
|
||||
/// <param name="objectIdArray">An array of id values for the object type specified by the report template</param>
|
||||
/// <param name="reportParam">report id and object id values for object type specified in report template</param>
|
||||
/// <param name="apiVersion">From route path</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("render")]
|
||||
public async Task<IActionResult> RenderReport([FromBody] long reportId, long[] objectIdArray, ApiVersion apiVersion)
|
||||
public async Task<IActionResult> RenderReport([FromBody] RenderReportParameter reportParam, ApiVersion apiVersion)
|
||||
{
|
||||
if (!serverState.IsOpen)
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
@@ -183,7 +182,7 @@ namespace AyaNova.Api.Controllers
|
||||
var httpConnectionFeature = HttpContext.Features.Get<IHttpConnectionFeature>();
|
||||
var API_URL = $"http://127.0.0.1:{httpConnectionFeature.LocalPort}/api/v8/";
|
||||
|
||||
var result = await biz.RenderReport(reportId, objectIdArray, API_URL);
|
||||
var result = await biz.RenderReport(reportParam.ReportId, reportParam.objectIdArray, API_URL);
|
||||
if (result == null)
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
else
|
||||
@@ -191,6 +190,12 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
}
|
||||
|
||||
public class RenderReportParameter
|
||||
{
|
||||
public long ReportId { get; set; }
|
||||
public long[] objectIdArray { get; set; }
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("render-test")]
|
||||
[AllowAnonymous]
|
||||
|
||||
Reference in New Issue
Block a user