温湿度接口

master
xjl 4 months ago
parent aa0543ac6b
commit aa0f3aad04

@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entity.Dto.Resp
{
public class HumitureResp
{
/// <summary>
/// 湿度
/// </summary>
public short Humidness { get; set; }
/// <summary>
/// 温度
/// </summary>
public short Temperature { get; set; }
/// <summary>
/// 设备型号
/// </summary>
public short EquipmentType { get; set; }
/// <summary>
/// 版本号(低 8 位)
/// </summary>
public short VersionNumber { get; set; }
/// <summary>
/// 设备 ID 高 16 位
/// </summary>
public short DeviceIdHigh { get; set; }
/// <summary>
/// 设备 ID 低 16 位
/// </summary>
public short DeviceIdLower { get; set; }
/// <summary>
/// 温度上限报警值
/// </summary>
public short UpperTemperatureAlarm { get; set; }
/// <summary>
/// 温度上限报警使能
/// </summary>
public short UpperTemperatureAlarmEnabled { get; set; }
/// <summary>
/// 温度下限报警值
/// </summary>
public short LowerTemperatureAlarm { get; set; }
/// <summary>
/// 温度下限报警使能
/// </summary>
public short LowerTemperatureAlarmEnabled { get; set; }
/// <summary>
/// 湿度上限报警值
/// </summary>
public short HumidityUpperAlarm { get; set; }
/// <summary>
/// 湿度上限报警使能
/// </summary>
public short HumidityUpperAlarmEnabled { get; set; }
/// <summary>
/// 湿度下限报警值
/// </summary>
public short HumidityLowerLimitAlarm { get; set; }
/// <summary>
/// 湿度下限报警使能
/// </summary>
public short HumidityLowerLimitAlarmEnabled { get; set; }
/// <summary>
/// 温度校正值更新
/// </summary>
public short TemperatureUpdated { get; set; }
/// <summary>
/// 湿度校正值更新
/// </summary>
public short HumidityValueUpdated { get; set; }
}
}

@ -15,7 +15,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SqlSugarCore" Version="5.1.4.115"/>
<PackageReference Include="SqlSugarCore" Version="5.1.4.115" />
</ItemGroup>
</Project>

@ -0,0 +1,65 @@

using Entity.Dto.Resp;
using HybirdFrameworkDriver.Session;
using log4net;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Service.Api.Resp;
using Service.Car.Msg.Car.Req;
using Service.Car.Msg.Host.Req;
using Service.Car.Server;
using Service.Humiture;
using Service.Humiture.Client;
using Service.TBox.Service;
using WebStarter.Dto.Req;
namespace WebStarter.Controllers;
/// <summary>
/// 温湿度
/// </summary>
[ApiController]
[Route("[controller]")]
public class HumitureController : ControllerBase
{
private static readonly ILog Log = LogManager.GetLogger(typeof(HumitureController));
/// <summary>
/// 获取温湿度
/// </summary>
/// <returns></returns>
[HttpGet("GetHumiture")]
public HumitureResp GetHumiture()
{
HumitureResp humitureResp = new HumitureResp();
if (HumiturePlcMgr.HumitureMsg!=null)
{
humitureResp = new HumitureResp()
{
Humidness = HumiturePlcMgr.HumitureMsg.Humidness.Value,
Temperature = HumiturePlcMgr.HumitureMsg.Temperature.Value,
EquipmentType = HumiturePlcMgr.HumitureMsg.EquipmentType.Value,
VersionNumber = HumiturePlcMgr.HumitureMsg.VersionNumber.Value,
DeviceIdHigh = HumiturePlcMgr.HumitureMsg.DeviceIdHigh.Value,
DeviceIdLower = HumiturePlcMgr.HumitureMsg.DeviceIdLower.Value,
UpperTemperatureAlarm = HumiturePlcMgr.HumitureMsg.UpperTemperatureAlarm.Value,
UpperTemperatureAlarmEnabled = HumiturePlcMgr.HumitureMsg.UpperTemperatureAlarmEnabled.Value,
LowerTemperatureAlarm = HumiturePlcMgr.HumitureMsg.LowerTemperatureAlarm.Value,
LowerTemperatureAlarmEnabled = HumiturePlcMgr.HumitureMsg.LowerTemperatureAlarmEnabled.Value,
HumidityUpperAlarm = HumiturePlcMgr.HumitureMsg.HumidityUpperAlarm.Value,
HumidityUpperAlarmEnabled = HumiturePlcMgr.HumitureMsg.HumidityUpperAlarmEnabled.Value,
HumidityLowerLimitAlarm = HumiturePlcMgr.HumitureMsg.HumidityLowerLimitAlarm.Value,
HumidityLowerLimitAlarmEnabled = HumiturePlcMgr.HumitureMsg.HumidityLowerLimitAlarmEnabled.Value,
TemperatureUpdated = HumiturePlcMgr.HumitureMsg.TemperatureUpdated.Value,
HumidityValueUpdated = HumiturePlcMgr.HumitureMsg.HumidityValueUpdated.Value,
};
}
return humitureResp;
}
}

@ -2,7 +2,7 @@
"ConnectionStrings": {
"ConfigId": "master",
"DbType": "MySql",
"SqlConnection": "server=192.168.2.2;Port=3306;Database=huanneng_dev;Uid=root;Pwd=Rszn123;Charset=utf8;"
"SqlConnection": "server=180.76.133.253;Port=3306;Database=huanneng_dev;Uid=root;Pwd=Rszn123;Charset=utf8;"
},
"Update": {
"AutoUpdate": "false",

Loading…
Cancel
Save