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