using Microsoft.EntityFrameworkCore;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Models.Models.LOGDB
{

    /// <summary>
    ///  TCP通讯记录
    /// </summary>
    [Table("TBL_TCP_LOG"), Comment(" TCP通讯记录")]

    public class TBL_TCP_LOG
    {

        /// <summary>
        /// 自增id
        /// </summary>
        [Key, Column(TypeName = "int"), Comment("id,自增长"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int ID { get; set; }

        /// <summary>
        /// 生产者根据时间精确到mS生产ID 
        /// </summary>
        [ Column(TypeName = "nvarchar(100)"), Comment("生产者根据时间精确到mS生产ID ")]
        public string TCP_ID { get; set; }

        /// <summary>
        /// 方向
        /// </summary>
        [Column(TypeName = "nvarchar(100)"), Comment("方向")]
        public string DIRECTION { get; set; } = "RX";

        /// <summary>
        /// 时间（精确到mS）
        /// </summary>

        [Required, Column(TypeName = "datetime"), Comment("时间（精确到mS）")]

        public DateTime DATETIME { get; set; } = DateTime.Now;



        /// <summary>
        /// 源 IP 
        /// </summary>
        [ Column(TypeName = "nvarchar(100)"), Comment("源 IP ")]
        public string SOURCE_IP { get; set; }


        /// <summary>
        /// 源 TCP 端口 
        /// </summary>
        [Column(TypeName = "nvarchar(100)"), Comment("源 TCP 端口 ")]
        public string SOURCE_PORT { get; set; }


        /// <summary>
        /// 目的地 IP 
        /// </summary>
        [ Column(TypeName = "nvarchar(100)"), Comment("目的地 IP ")]
        public string DESTINATION { get; set; }


        /// <summary>
        /// 目的地 TCP 端口 
        /// </summary>
        [Column(TypeName = "nvarchar(100)"), Comment("目的地 TCP 端口 ")]
        public string DESTINATION_PORT { get; set; }



        /// <summary>
        /// 距离同一个端口上一包接收间隔
        /// </summary>
        [ Column(TypeName = "int"), Comment("距离同一个端口上一包接收间隔")]
        public int RCV_TIMEOUT { get; set; }

        /// <summary>
        /// 距离同一个端口上一包发送间隔 
        /// </summary>
        [ Column(TypeName = "int"), Comment("距离同一个端口上一包发送间隔 ")]
        public int SED_TIMEOUT { get; set; }


    


        /// <summary>
        /// 长度 
        /// </summary>
        [Column(TypeName = "int"), Comment("长度 ")]
        public int LENGTH { get; set; }


        

        /// <summary>
        /// 内容
        /// </summary>
        [ Column(TypeName = "nvarchar(5000)"), Comment("内容")]
        public string CONTENT { get; set; }

        /// <summary>
        /// 处理耗时 
        /// </summary>
        [ Column(TypeName = "int"), Comment("处理耗时 ")]
        public int PROCESSING_TIMESPENT { get; set; }

        /// <summary>
        /// 数据是否有效  0 无效 1有效
        /// </summary>
        [Column(TypeName = "int"), Comment("数据是否有效 0 无效 1有效")]
        public int DATA_VALID { get; set; }

        /// <summary>
        /// 处理结果   0 失败 1成功
        /// </summary>
        [Column(TypeName = "int"), Comment("处理结果  0 失败 1成功")]
        public int RESULT { get; set; }



        /// <summary>
        /// 关联MSG ID  
        /// </summary>
        [ Column(TypeName = "int"), Comment("关联MSG ID  ")]
        public int MSG_ID { get; set; }


        /// <summary>
        /// 关联UDP_ID
        /// </summary>
        [ Column(TypeName = "int"), Comment("关联UDP_ID")]
        public int UDP_ID { get; set; }

        /// <summary>
        /// 备注
        /// </summary>

        [Column(TypeName = "nvarchar(520)"), Comment("备注")]

        public string REMARK { get; set; }

    }
}
