forked from ddrilling/AsbCloudServer
Добавлено возвращение 204
This commit is contained in:
parent
4d69e4ecbb
commit
73d25b4e1b
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user