Files
jinko.yikatong/Src/Dlhis.Basic/Device/Response/DeviceResponse.cs
2024-02-23 17:04:33 +08:00

105 lines
2.1 KiB
C#

using Dlhis.Entity.Device.Enums;
using Kurisu.AspNetCore.Utils.Extensions;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Dlhis.Basic.Device.Response;
public class DeviceResponse
{
public long Id { get; set; }
/// <summary>
/// 设备code
/// </summary>
public Guid Code { get; set; }
/// <summary>
/// 设备唯一码,IP/MAC/SNO
/// </summary>
public string UniqueNo { get; set; }
/// <summary>
/// 心跳间隔
/// </summary>
public int HeartbeatInterval { get; set; }
/// <summary>
/// 品牌
/// </summary>
public string Brand { get; set; }
/// <summary>
/// 供应商
/// </summary>
public string Supplier { get; set; }
/// <summary>
/// 设备功能 DeviceFuncEnumType
/// </summary>
public List<DeviceFuncEnumType> Funcs
{
get
{
if (FuncsStr.IsEmpty()) FuncsStr = "[]";
return FuncsStr.ToObject<List<DeviceFuncEnumType>>();
}
}
[JsonIgnore]
public string FuncsStr { get; set; }
/// <summary>
/// 部署点
/// </summary>
public string DeployPlace { get; set; }
/// <summary>
/// 部署坐标
/// </summary>
public string DeployPosition { get; set; }
/// <summary>
/// 部署方向
/// </summary>
public string DeployDirection { get; set; }
/// <summary>
/// 模板code
/// </summary>
public Guid TemplateCode { get; set; }
/// <summary>
/// 连接信息
/// </summary>
public object ConnectionInfo
{
get
{
try
{
return JObject.Parse(ConnectionInfoStr);
}
catch (Exception)
{
return JObject.Parse("{}");
}
}
}
public DeviceTypeEnumType Type { get; set; }
public string TypeDesc => Type.GetDescription();
/// <summary>
/// 连接信息
/// </summary>
[JsonIgnore]
public string ConnectionInfoStr { get; set; }
/// <summary>
/// 是否启用
/// </summary>
public bool Enable { get; set; }
}