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