using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JiShe.CollectBus.Common.Models
{
    /// <summary>
    /// 设备缓存基础模型
    /// </summary>
    public abstract class DeviceCacheBasicModel
    {
        /// <summary>
        /// 集中器Id
        /// </summary>
        public int FocusId { get; set; }

        /// <summary>
        /// 表Id
        /// </summary>
        public int MeterId { get; set; }

        /// <summary>
        /// 关系映射标识，用于ZSet的Member字段和Set的Value字段，具体值可以根据不同业务场景进行定义
        /// </summary>
        public virtual string MemberId => $"{FocusId}:{MeterId}";

        /// <summary>
        /// ZSet排序索引分数值，具体值可以根据不同业务场景进行定义，例如时间戳
        /// </summary>
        public virtual long ScoreValue=> ((long)FocusId << 32) | (uint)MeterId;

        /// <summary>
        /// 是否已处理
        /// </summary>
        public virtual bool IsHandle { get; set; } = false;

        /// <summary>
        /// 集中器地址
        /// </summary>
        public string FocusAddress { get; set;}
    }
}
