DD.WellWorkover.Cloud/AsbCloudWebApi/Controllers/WITS/WitsInfoController.cs
2024-08-19 10:01:07 +05:00

71 lines
2.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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);
}
}