doc and terurn types

This commit is contained in:
Фролов 2021-08-12 11:52:23 +05:00
parent 95a3a0d207
commit bef1292e7c

View File

@ -8,6 +8,9 @@ using System.Threading.Tasks;
namespace AsbCloudWebApi.Controllers namespace AsbCloudWebApi.Controllers
{ {
/// <summary>
/// Контроллер секций скважины
/// </summary>
[Route("api/well/{idWell}/sections")] [Route("api/well/{idWell}/sections")]
[ApiController] [ApiController]
[Authorize] [Authorize]
@ -23,6 +26,7 @@ namespace AsbCloudWebApi.Controllers
} }
[HttpGet] [HttpGet]
[ProducesResponseType(typeof(IEnumerable<WellSectionDto>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetAllAsync(int idWell, int skip = 0, int take = 32, public async Task<IActionResult> GetAllAsync(int idWell, int skip = 0, int take = 32,
CancellationToken token = default) CancellationToken token = default)
{ {
@ -35,6 +39,7 @@ namespace AsbCloudWebApi.Controllers
[HttpGet] [HttpGet]
[Route("{idSection}")] [Route("{idSection}")]
[ProducesResponseType(typeof(WellSectionDto), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetAsync(int idWell, int idSection, public async Task<IActionResult> GetAsync(int idWell, int idSection,
CancellationToken token = default) CancellationToken token = default)
{ {
@ -46,6 +51,7 @@ namespace AsbCloudWebApi.Controllers
} }
[HttpPost] [HttpPost]
[ProducesResponseType(typeof(IEnumerable<WellSectionDto>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> InsertAsync(int idWell, [FromBody] IEnumerable<WellSectionDto> values, public async Task<IActionResult> InsertAsync(int idWell, [FromBody] IEnumerable<WellSectionDto> values,
CancellationToken token = default) CancellationToken token = default)
{ {
@ -57,6 +63,7 @@ namespace AsbCloudWebApi.Controllers
} }
[HttpPut("{idSection}")] [HttpPut("{idSection}")]
[ProducesResponseType(typeof(WellSectionDto), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> UpdateAsync(int idWell, int idSection, [FromBody] WellSectionDto value, CancellationToken token = default) public async Task<IActionResult> UpdateAsync(int idWell, int idSection, [FromBody] WellSectionDto value, CancellationToken token = default)
{ {
if (!await CanUserAccessToWellAsync(idWell, token)) if (!await CanUserAccessToWellAsync(idWell, token))
@ -67,6 +74,7 @@ namespace AsbCloudWebApi.Controllers
} }
[HttpDelete("{idSection}")] [HttpDelete("{idSection}")]
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> DeleteAsync(int idWell, int idSection, CancellationToken token = default) public async Task<IActionResult> DeleteAsync(int idWell, int idSection, CancellationToken token = default)
{ {
if (!await CanUserAccessToWellAsync(idWell, token)) if (!await CanUserAccessToWellAsync(idWell, token))