forked from ddrilling/AsbCloudServer
71 lines
2.1 KiB
C#
71 lines
2.1 KiB
C#
using AsbCloudInfrastructure.Services;
|
||
using Microsoft.AspNetCore.Mvc;
|
||
using System.Collections.Generic;
|
||
|
||
namespace AsbCloudWebApi.Controllers.WITS;
|
||
|
||
/// <summary>
|
||
/// Инфо о WITS параметрах
|
||
/// </summary>
|
||
[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);
|
||
}
|
||
}
|