You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.5 KiB

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