using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using CoreAgent.ProtocolClient.Enums; namespace CoreAgent.ProtocolClient.Models { /// /// 传输协议日志模型 /// 用于传输给上层的协议日志数据 /// public class TransferProtocolLog { /// /// 主键ID /// public long Id { get; set; } /// /// 协议层类型 /// public ProtocolLayer LayerType { get; set; } /// /// 消息详情集合(JSON格式存储) /// public string? MessageDetailJson { get; set; } /// /// 小区ID /// public int? CellID { get; set; } /// /// 国际移动用户识别码 /// public string? IMSI { get; set; } /// /// 日志方向类型 /// public int Direction { get; set; } /// /// 用户设备ID /// public int? UEID { get; set; } /// /// 公共陆地移动网络标识 /// public string? PLMN { get; set; } /// /// 时间间隔(毫秒) /// public long TimeMs { get; set; } /// /// 时间戳 /// public long Timestamp { get; set; } /// /// 信息字段 /// public string? Info { get; set; } /// /// 消息字段 /// public string? Message { get; set; } /// /// 消息详情集合(用于业务逻辑) /// public IEnumerable? MessageDetail { get => !string.IsNullOrEmpty(MessageDetailJson) ? Newtonsoft.Json.JsonConvert.DeserializeObject>(MessageDetailJson) : null; set => MessageDetailJson = value != null ? Newtonsoft.Json.JsonConvert.SerializeObject(value) : null; } /// /// 时间间隔(用于业务逻辑) /// public TimeSpan Time { get => TimeSpan.FromMilliseconds(TimeMs); set => TimeMs = (long)value.TotalMilliseconds; } } }