|
- using HealthMonitor.Service.Biz.db;
- using Microsoft.AspNetCore.Mvc;
-
- namespace HealthMonitor.WebApi.Controllers
- {
- [ApiController]
- [Route("[controller]")]
- public class WeatherForecastController : ControllerBase
- {
- private static readonly string[] Summaries = new[]
- {
- "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
- };
-
- private readonly ILogger<WeatherForecastController> _logger;
-
- private readonly TDengineService _serviceTDengine;
-
- public WeatherForecastController(ILogger<WeatherForecastController> logger, TDengineService serviceDengine)
- {
- _logger = logger;
- _serviceTDengine = serviceDengine;
- }
-
- //[HttpGet(Name = "GetWeatherForecast")]
- //public IEnumerable<WeatherForecast> Get()
- //{
- // return Enumerable.Range(1, 5).Select(index => new WeatherForecast
- // {
- // Date = DateTime.Now.AddDays(index),
- // TemperatureC = Random.Shared.Next(-20, 55),
- // Summary = Summaries[Random.Shared.Next(Summaries.Length)]
- // })
- // .ToArray();
- //}
-
- [HttpGet(Name = "GetWeatherForecast")]
- public async Task<IActionResult> Get()
- {
- IntPtr conn = _serviceTDengine.Connection();
- var sql = "select * from gps_bloodpress";
- //Task.Factory.StartNew(async () =>
- //{
- // await _serviceTDengine.ExecuteQuerySQL(conn, sql);
- //});
-
- _serviceTDengine.ExecuteQuerySQL(conn, sql);
-
-
-
- //var res= await _serviceAliIot.QueryDeviceStatisticseAsync(nameof(Get));
- //var online = res?.OnlineCount;
- return Ok("aa");
-
- }
- }
- }
|