DD.WellWorkover.Cloud/AsbCloudWebApi/Controllers/WITS/WitsInfoController.cs
2022-06-15 14:57:37 +05:00

69 lines
2.2 KiB
C#

using AsbCloudInfrastructure.Services;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
namespace AsbCloudWebApi.Controllers.WITS
{
[Route("api/[controller]")]
[ApiController]
public class WitsInfoController : ControllerBase
{
private readonly WitsInfoService witsInfoService;
public WitsInfoController(WitsInfoService witsInfoService)
{
this.witsInfoService = witsInfoService;
}
/// <summary>
/// Список всех WITS items для всех известных records
/// </summary>
/// <returns></returns>
[HttpGet("item")]
[ProducesResponseType(typeof(IEnumerable<object>), (int)System.Net.HttpStatusCode.OK)]
public IActionResult GetItems()
{
var result = witsInfoService.GetItems();
return Ok(result);
}
/// <summary>
/// Список всех WITS items для конкретной record
/// </summary>
/// <param name="idRecord"></param>
/// <returns></returns>
[HttpGet("item/{idRecord}")]
[ProducesResponseType(typeof(IEnumerable<object>), (int)System.Net.HttpStatusCode.OK)]
public IActionResult GetItems(int idRecord)
{
var result = witsInfoService.GetItems(idRecord);
return Ok(result);
}
/// <summary>
/// Список описаний всех wits records
/// </summary>
/// <returns></returns>
[HttpGet("record")]
[ProducesResponseType(typeof(IEnumerable<object>), (int)System.Net.HttpStatusCode.OK)]
public IActionResult GetRecordInfo()
{
var result = witsInfoService.GetRecords();
return Ok(result);
}
/// <summary>
/// Описание конкретной record
/// </summary>
/// <param name="idRecord"></param>
/// <returns></returns>
[HttpGet("record/{idRecord}")]
[ProducesResponseType(typeof(IEnumerable<object>), (int)System.Net.HttpStatusCode.OK)]
public IActionResult GetRecordInfo(int idRecord)
{
var result = witsInfoService.GetRecords(idRecord);
return Ok(result);
}
}
}