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

namespace JiShe.CollectBus.Common.Consts
{
    public class RedisConst
    {
        /// <summary>
        /// 缓存基础目录
        /// </summary>
        public const string CacheBasicDirectoryKey = "CollectBus:";

        /// <summary>
        /// 1分钟采集间隔
        /// </summary>
        public const string OneMinuteAcquisitionTimeInterval = "One";

        /// <summary>
        /// 5分钟采集间隔
        /// </summary>
        public const string FiveMinuteAcquisitionTimeInterval = "Five";

        /// <summary>
        /// 15分钟采集间隔
        /// </summary>
        public const string FifteenMinuteAcquisitionTimeInterval = "Fifteen";

        /// <summary>
        /// 集中器连接信息缓存数据，{0}=>系统类型，{1}=>应用服务部署标记
        /// </summary>
        public const string ConcentratorCacheHashKey = $"{CacheBasicDirectoryKey}{"{0}:{1}"}:Concentrator";


        public const string MeterInfo = "MeterInfo";

        /// <summary>
        /// 缓存表计信息,{0}=>系统类型，{1}=>应用服务部署标记，{2}=>表计类别，{3}=>采集频率
        /// </summary>
        public const string CacheMeterInfoHashKey = $"{CacheBasicDirectoryKey}{"{0}:{1}"}:{MeterInfo}:{"{2}"}:{"{3}"}";

        /// <summary>
        /// 缓存表计信息索引Set缓存Key,{0}=>系统类型，{1}=>应用服务部署标记，{2}=>表计类别，{3}=>采集频率
        /// </summary>
        public const string CacheMeterInfoSetIndexKey = $"{CacheBasicDirectoryKey}{"{0}:{1}"}:{MeterInfo}:{"{2}"}:SetIndex:{"{3}"}";

        /// <summary>
        /// 缓存表计信息排序索引ZSET缓存Key,{0}=>系统类型，{1}=>应用服务部署标记，{2}=>表计类别，{3}=>采集频率
        /// </summary>
        public const string CacheMeterInfoZSetScoresIndexKey = $"{CacheBasicDirectoryKey}{"{0}:{1}"}:{MeterInfo}:{"{2}"}:ZSetScoresIndex:{"{3}"}";
          

        public const string TaskInfo = "TaskInfo";
        /// <summary>
        /// 缓存待下发的指令生产任务数据,{0}=>系统类型，{1}=>应用服务部署标记，{2}=>表计类别，{3}=>采集频率
        /// </summary>
        public const string CacheTasksToBeIssuedKey = $"{CacheBasicDirectoryKey}{"{0}:{1}"}:{TaskInfo}:{"{2}"}:{"{3}"}";

        public const string TelemetryPacket = "TelemetryPacket";
        /// <summary>
        /// 缓存表计下发指令数据集,{0}=>系统类型，{1}=>应用服务部署标记，{2}=>表计类别，{3}=>采集频率，{4}=>集中器所在分组，{5}=>时间格式的任务批次
        /// </summary>
        public const string CacheTelemetryPacketInfoHashKey = $"{CacheBasicDirectoryKey}{"{0}:{1}"}:{TelemetryPacket}:{"{2}"}:{"{3}"}:{"{4}"}:{"{5}"}";

        /// <summary>
        /// 缓存表计下发指令数据集索引Set缓存Key,{0}=>系统类型，{1}=>应用服务部署标记，{2}=>表计类别，{3}=>采集频率，{4}=>集中器所在分组，{5}=>时间格式的任务批次
        /// </summary>
        public const string CacheTelemetryPacketInfoSetIndexKey = $"{CacheBasicDirectoryKey}{"{0}:{1}"}:{TelemetryPacket}:{"{2}"}:SetIndex:{"{3}"}:{"{4}"}:{"{5}"}";

        /// <summary>
        /// 缓存表计下发指令数据集排序索引ZSET缓存Key,{0}=>系统类型，{1}=>应用服务部署标记，{2}=>表计类别，{3}=>采集频率，{4}=>集中器所在分组，{5}=>时间格式的任务批次
        /// </summary>
        public const string CacheTelemetryPacketInfoZSetScoresIndexKey = $"{CacheBasicDirectoryKey}{"{0}:{1}"}:{TelemetryPacket}:{"{2}"}:ZSetScoresIndex:{"{3}"}:{"{4}"}:{"{5}"}";

        ///// <summary>
        ///// 缓存设备平衡关系映射结果,{0}=>系统类型，{1}=>应用服务部署标记
        ///// </summary>
        //public const string CacheDeviceBalanceRelationMapResultKey = $"{CacheBasicDirectoryKey}{"{0}:{1}"}:RelationMap";

        public const string CacheAmmeterFocusKey = $"{CacheBasicDirectoryKey}CacheAmmeterFocusKey";

        /// <summary>
        /// 协议池缓存标识
        /// </summary>
        public const string ProtocolKey = $"{CacheBasicDirectoryKey}Protocols";
    }
}
