Добавлено возвращение 204

This commit is contained in:
Степанов Дмитрий 2023-11-15 14:32:48 +05:00
parent 4d69e4ecbb
commit 73d25b4e1b
2 changed files with 9 additions and 0 deletions

View File

@ -133,6 +133,7 @@ namespace AsbCloudWebApi.Controllers
[HttpGet("datesRange")]
[Permission]
[ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)]
[ProducesResponseType((int)System.Net.HttpStatusCode.NoContent)]
public async Task<IActionResult> GetReportsDateRangeAsync(int idWell, CancellationToken token)
{
int? idCompany = User.GetCompanyId();
@ -146,6 +147,9 @@ namespace AsbCloudWebApi.Controllers
var wellReportsDatesRange = reportService.GetDatesRangeOrDefault(idWell);
if (wellReportsDatesRange is null)
return NoContent();
return Ok(wellReportsDatesRange);
}
}

View File

@ -139,6 +139,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
[HttpGet("{idWell}/dateRange")]
[ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)]
[ProducesResponseType((int)System.Net.HttpStatusCode.NotFound)]
[ProducesResponseType((int)System.Net.HttpStatusCode.NoContent)]
public virtual async Task<ActionResult<DatesRangeDto?>> GetRangeAsync(
[FromRoute] int idWell,
[Required] DateTimeOffset geDate,
@ -158,6 +159,9 @@ namespace AsbCloudWebApi.Controllers.SAUB
var content = await telemetryDataService.GetRangeAsync(idWell, geDate, leDate, token);
if (content is null)
return NoContent();
return Ok(content);
}
@ -171,6 +175,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
[Permission]
[ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)]
[ProducesResponseType((int)System.Net.HttpStatusCode.NotFound)]
[ProducesResponseType((int)System.Net.HttpStatusCode.NoContent)]
public virtual async Task<ActionResult<DatesRangeDto?>> GetDataDatesRangeAsync(int idWell,
CancellationToken token)
{