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; }
///
/// 设备code
///
public Guid Code { get; set; }
///
/// 设备唯一码,IP/MAC/SNO
///
public string UniqueNo { get; set; }
///
/// 心跳间隔
///
public int HeartbeatInterval { get; set; }
///
/// 品牌
///
public string Brand { get; set; }
///
/// 供应商
///
public string Supplier { get; set; }
///
/// 设备功能 DeviceFuncEnumType
///
public List Funcs
{
get
{
if (FuncsStr.IsEmpty()) FuncsStr = "[]";
return FuncsStr.ToObject>();
}
}
[JsonIgnore]
public string FuncsStr { get; set; }
///
/// 部署点
///
public string DeployPlace { get; set; }
///
/// 部署坐标
///
public string DeployPosition { get; set; }
///
/// 部署方向
///
public string DeployDirection { get; set; }
///
/// 模板code
///
public Guid TemplateCode { get; set; }
///
/// 连接信息
///
public object ConnectionInfo
{
get
{
try
{
return JObject.Parse(ConnectionInfoStr);
}
catch (Exception)
{
return JObject.Parse("{}");
}
}
}
public DeviceTypeEnumType Type { get; set; }
public string TypeDesc => Type.GetDescription();
///
/// 连接信息
///
[JsonIgnore]
public string ConnectionInfoStr { get; set; }
///
/// 是否启用
///
public bool Enable { get; set; }
}