From b553f74a50329e7ae77a2bc2510e571d113f6673 Mon Sep 17 00:00:00 2001 From: KharchenkoVladimir Date: Mon, 25 Oct 2021 17:38:52 +0500 Subject: [PATCH] Added return type descriptions for BaseControllers classes --- AsbCloudWebApi/Controllers/CrudController.cs | 8 ++++++-- AsbCloudWebApi/Controllers/TelemetryDataBaseController.cs | 3 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/AsbCloudWebApi/Controllers/CrudController.cs b/AsbCloudWebApi/Controllers/CrudController.cs index 06bef091..20cf2c4e 100644 --- a/AsbCloudWebApi/Controllers/CrudController.cs +++ b/AsbCloudWebApi/Controllers/CrudController.cs @@ -38,7 +38,8 @@ namespace AsbCloudWebApi.Controllers /// CancellationToken /// страница с записями в PaginationContainer [HttpGet()] - public virtual async Task GetPage(int skip = 0, int take = 32, CancellationToken token = default) + public virtual async Task>> GetPage(int skip = 0, int take = 32, + CancellationToken token = default) { if (!Roles.Any(role => User.IsInRole(role))) return Forbid(); @@ -54,7 +55,7 @@ namespace AsbCloudWebApi.Controllers /// /// запись [HttpGet("{id}")] - public virtual async Task Get(int id, CancellationToken token = default) + public virtual async Task> Get(int id, CancellationToken token = default) { if (!Roles.Any(role => User.IsInRole(role))) return Forbid(); @@ -70,6 +71,7 @@ namespace AsbCloudWebApi.Controllers /// /// 1 - добавлено, 0 - нет [HttpPost] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public virtual async Task Insert([FromBody] T value, CancellationToken token = default) { if (!Roles.Any(role => User.IsInRole(role))) @@ -87,6 +89,7 @@ namespace AsbCloudWebApi.Controllers /// /// 1 - успешно отредактировано, 0 - нет [HttpPut("{id}")] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public virtual async Task Put(int id, [FromBody] T value, CancellationToken token = default) { if (!Roles.Any(role => User.IsInRole(role))) @@ -103,6 +106,7 @@ namespace AsbCloudWebApi.Controllers /// /// 1 - успешно удалено, 0 - нет [HttpDelete("{id}")] + [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public virtual async Task Delete(int id, CancellationToken token = default) { if (!Roles.Any(role => User.IsInRole(role))) diff --git a/AsbCloudWebApi/Controllers/TelemetryDataBaseController.cs b/AsbCloudWebApi/Controllers/TelemetryDataBaseController.cs index 531f5eee..35a5df20 100644 --- a/AsbCloudWebApi/Controllers/TelemetryDataBaseController.cs +++ b/AsbCloudWebApi/Controllers/TelemetryDataBaseController.cs @@ -72,8 +72,7 @@ namespace AsbCloudWebApi.Controllers /// Токен завершения задачи /// [HttpGet("{idWell}")] - //[ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public virtual async Task GetDataAsync(int idWell, DateTime begin = default, + public virtual async Task> GetDataAsync(int idWell, DateTime begin = default, int intervalSec = 600, int approxPointsCount = 1024, CancellationToken token = default) { int? idCompany = User.GetCompanyId();