Files
IOT_API/Model/Model/EnovaChannelData.cs
T
2026-08-27 17:10:56 +08:00

73 lines
2.7 KiB
C#

using System.Text.Json.Serialization;
namespace Model.Model
{
//没啥逼用,后续得改
public class EnovaChannelData
{
public string Laboratory { get; set; }
public string Manufacture { get; set; }
public string TaskId { get; set; }
// 针对文档命名不一致的字段进行别名特性处理(优先匹配真实JSON示例)
[JsonPropertyName("deviceCode")]
public string DeviceCode { get; set; }
[JsonPropertyName("devCode")] // 兼容参数表
public string DevCodeAlternate { set => DeviceCode = value; }
[JsonPropertyName("channelCode")]
public string ChannelCode { get; set; }
[JsonPropertyName("chnCode")]
public string ChnCodeAlternate { set => ChannelCode = value; }
[JsonPropertyName("channelIP")]
public string ChannelIP { get; set; }
[JsonPropertyName("chnlP")]
public string ChnlPAlternate { set => ChannelIP = value; }
[JsonPropertyName("pcIP")]
public string PcIP { get; set; }
[JsonPropertyName("pclP")]
public string PclPAlternate { set => PcIP = value; }
public string PcName { get; set; }
public string BarCode { get; set; }
public string ProjectName { get; set; }
public string StepId { get; set; }
public string CycleDepth { get; set; }
public string Cycles { get; set; }
public string StepTime { get; set; }
public string TotalTime { get; set; }
public string PowerState { get; set; }
public string ChannelState { get; set; }
public string Voltage { get; set; }
public string Current { get; set; }
public string Power { get; set; }
public string GivenVoltage { get; set; }
public string GivenCurrent { get; set; }
public string GivenPower { get; set; }
public string Cap { get; set; }
public string ChgCap { get; set; }
public string DchgCap { get; set; }
public string CapDiff { get; set; }
public string Energy { get; set; }
public string ChgEnergy { get; set; }
public string DchgEnergy { get; set; }
public string EnergyDiff { get; set; }
[JsonPropertyName("timestamp")]
public string Timestamp { get; set; }
[JsonPropertyName("timeStamp")]
public string TimestampAlternate { set => Timestamp = value; }
// 对应 elements 里的 dict 动态解析
public Dictionary<string, string> OtherSignals { get; set; }
}
// 严格按照文档 Page 6 要求返回的响应结构
public class ApiResponse
{
public bool Success { get; set; }
public string ErrorInfo { get; set; }
}
}