using JiShe.CollectBus.Common.Enums;
using JiShe.ServicePro.Enums;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JiShe.CollectBus.Protocol.Contracts.Protocol.Dto
{
    public class AnalysisBaseDto
    {

        /// <summary>
        /// 是否有效数据
        /// </summary>
        public bool ValidData { get; set; } = true;

        /// <summary>
        /// 数据项类型
        /// </summary>
        public string ItemType { get; set; } = null!;

        /// <summary>
        /// 错误码信息
        /// </summary>
        public string? ErrorCodeMsg { get; set; }

        /// <summary>
        /// 字段名
        /// </summary>
        public string? FiledName { get; set; }

        /// <summary>
        /// 字段描述
        /// </summary>
        public string? FiledDesc { get; set; }

        /// <summary>
        /// 数据时标
        /// </summary>
        public DateTime? TimeSpan { get; set; }

        /// <summary>
        /// 项目Id
        /// </summary>
        public string ProjectId { get; set; }

        /// <summary>
        /// 设备ID(电表ID,水表ID，气表ID，集中器ID等)
        /// </summary>
        public int DeviceId { get; set; }

        /// <summary>
        /// 设备类型
        /// </summary>
        public MeterTypeEnum DeviceType { get; set;}


        /// <summary>
        /// 数据业务库ID
        /// </summary>
        public int DatabaseBusiID { get; set; }

        /// <summary>
        /// 设备地址(电表地址,水表地址，气表地址，集中器地址等)
        /// </summary>
        public string DeviceAddress { get; set; } = null!;

        /// <summary>
        /// 集中器ID
        /// </summary>
        public int FocusId { get; set; }
    }

    public class AnalysisBaseDto<T> : AnalysisBaseDto 
    {
        /// <summary>
        /// 抄读值
        /// </summary>
        public T? DataValue { get; set; } = default;
    }

}
