Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

57 lines
1.8KB

  1. using HealthMonitor.Service.Biz.db;
  2. using Microsoft.AspNetCore.Mvc;
  3. namespace HealthMonitor.WebApi.Controllers
  4. {
  5. [ApiController]
  6. [Route("[controller]")]
  7. public class WeatherForecastController : ControllerBase
  8. {
  9. private static readonly string[] Summaries = new[]
  10. {
  11. "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
  12. };
  13. private readonly ILogger<WeatherForecastController> _logger;
  14. private readonly TDengineService _serviceTDengine;
  15. public WeatherForecastController(ILogger<WeatherForecastController> logger, TDengineService serviceDengine)
  16. {
  17. _logger = logger;
  18. _serviceTDengine = serviceDengine;
  19. }
  20. //[HttpGet(Name = "GetWeatherForecast")]
  21. //public IEnumerable<WeatherForecast> Get()
  22. //{
  23. // return Enumerable.Range(1, 5).Select(index => new WeatherForecast
  24. // {
  25. // Date = DateTime.Now.AddDays(index),
  26. // TemperatureC = Random.Shared.Next(-20, 55),
  27. // Summary = Summaries[Random.Shared.Next(Summaries.Length)]
  28. // })
  29. // .ToArray();
  30. //}
  31. //[HttpGet(Name = "GetWeatherForecast")]
  32. //public async Task<IActionResult> Get()
  33. //{
  34. // IntPtr conn = _serviceTDengine.Connection();
  35. // var sql = "select * from gps_bloodpress";
  36. // //Task.Factory.StartNew(async () =>
  37. // //{
  38. // // await _serviceTDengine.ExecuteQuerySQL(conn, sql);
  39. // //});
  40. // _serviceTDengine.ExecuteQuerySQL(conn, sql);
  41. // //var res= await _serviceAliIot.QueryDeviceStatisticseAsync(nameof(Get));
  42. // //var online = res?.OnlineCount;
  43. // return Ok("aa");
  44. //}
  45. }
  46. }