using SqlSugar;
namespace Model.Entity.Config
{
///
/// 产品(按型号区分;产品给设备归类,产品的物模型/告警等配置与设备相互独立)
///
public class ProductEntity : BaseEntity
{
///
/// 型号(唯一,如 GT-100)
///
[SugarColumn(ColumnDescription = "型号", Length = 100)]
public string Model { get; set; }
///
/// 产品名称
///
[SugarColumn(ColumnDescription = "产品名称", Length = 100, IsNullable = true)]
public string? Name { get; set; }
///
/// 产品分类Id(关联 ProductCategoryEntity.Id,0 表示未分类)
///
[SugarColumn(ColumnDescription = "产品分类Id")]
public long CategoryId { get; set; }
///
/// 制造商
///
[SugarColumn(ColumnDescription = "制造商", Length = 100, IsNullable = true)]
public string? Manufacturer { get; set; }
///
/// 产品描述
///
[SugarColumn(ColumnDescription = "产品描述", Length = 500, IsNullable = true)]
public string? Description { get; set; }
///
/// 通讯协议(复用 IotDeviceProtocolEnum:决定 DeviceCommand 驱动分支)
///
[SugarColumn(ColumnDescription = "通讯协议")]
public IotDeviceProtocolEnum ProtocolType { get; set; } = IotDeviceProtocolEnum.ModbusTcp;
///
/// 消息模型(消息协议/报文格式描述,如 JSON / 透传)
///
[SugarColumn(ColumnDescription = "消息模型", Length = 64, IsNullable = true)]
public string? MessageModel { get; set; }
///
/// 是否启用
///
[SugarColumn(ColumnDescription = "是否启用")]
public bool IsEnabled { get; set; } = true;
///
/// 备注
///
[SugarColumn(ColumnDescription = "备注", Length = 500, IsNullable = true)]
public string? Remark { get; set; }
}
}