forked from ddrilling/AsbCloudServer
Added return type descriptions for BaseControllers classes
This commit is contained in:
parent
f800e23aab
commit
b553f74a50
@ -38,7 +38,8 @@ namespace AsbCloudWebApi.Controllers
|
||||
/// <param name="token">CancellationToken</param>
|
||||
/// <returns>страница с записями в PaginationContainer</returns>
|
||||
[HttpGet()]
|
||||
public virtual async Task<IActionResult> GetPage(int skip = 0, int take = 32, CancellationToken token = default)
|
||||
public virtual async Task<ActionResult<PaginationContainer<T>>> 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
|
||||
/// <param name="token"></param>
|
||||
/// <returns>запись</returns>
|
||||
[HttpGet("{id}")]
|
||||
public virtual async Task<IActionResult> Get(int id, CancellationToken token = default)
|
||||
public virtual async Task<ActionResult<T>> Get(int id, CancellationToken token = default)
|
||||
{
|
||||
if (!Roles.Any(role => User.IsInRole(role)))
|
||||
return Forbid();
|
||||
@ -70,6 +71,7 @@ namespace AsbCloudWebApi.Controllers
|
||||
/// <param name="token"></param>
|
||||
/// <returns>1 - добавлено, 0 - нет</returns>
|
||||
[HttpPost]
|
||||
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
|
||||
public virtual async Task<IActionResult> Insert([FromBody] T value, CancellationToken token = default)
|
||||
{
|
||||
if (!Roles.Any(role => User.IsInRole(role)))
|
||||
@ -87,6 +89,7 @@ namespace AsbCloudWebApi.Controllers
|
||||
/// <param name="token"></param>
|
||||
/// <returns>1 - успешно отредактировано, 0 - нет</returns>
|
||||
[HttpPut("{id}")]
|
||||
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
|
||||
public virtual async Task<IActionResult> Put(int id, [FromBody] T value, CancellationToken token = default)
|
||||
{
|
||||
if (!Roles.Any(role => User.IsInRole(role)))
|
||||
@ -103,6 +106,7 @@ namespace AsbCloudWebApi.Controllers
|
||||
/// <param name="token"></param>
|
||||
/// <returns>1 - успешно удалено, 0 - нет</returns>
|
||||
[HttpDelete("{id}")]
|
||||
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
|
||||
public virtual async Task<IActionResult> Delete(int id, CancellationToken token = default)
|
||||
{
|
||||
if (!Roles.Any(role => User.IsInRole(role)))
|
||||
|
@ -72,8 +72,7 @@ namespace AsbCloudWebApi.Controllers
|
||||
/// <param name="token">Токен завершения задачи</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{idWell}")]
|
||||
//[ProducesResponseType(typeof(IEnumerable<Tdto>), (int)System.Net.HttpStatusCode.OK)]
|
||||
public virtual async Task<IActionResult> GetDataAsync(int idWell, DateTime begin = default,
|
||||
public virtual async Task<ActionResult<TDto>> GetDataAsync(int idWell, DateTime begin = default,
|
||||
int intervalSec = 600, int approxPointsCount = 1024, CancellationToken token = default)
|
||||
{
|
||||
int? idCompany = User.GetCompanyId();
|
||||
|
Loading…
Reference in New Issue
Block a user