namespace JiaZhiQuan.Common
{
    public static partial class CacheKeys
    {

        public const int ActivityCzdPointListCacheSecs = 60;

        public static string ActivityCzdPointList(int contractId)
        {
            return GenerateKey("activity_czd_pointlist:" + contractId);
        }

        public const int ActivityConfigCacheSecs = 60;

        public static string ActivityConfigCache(int activityId)
        {
            return GenerateKey("activity_config:" + activityId);
        }

        /// <summary>
        /// 阅读量大比拼预警邮件提醒，一个小时内最多发一次提醒邮件
        /// </summary>
        public const int ActivityYdldbpWarningCacheSecs = 60 * 60;

        public static string ActivityYdldbpWarningCache()
        {
            return GenerateKey("activity_warning:ydldbp");
        }

        /// <summary>
        /// 阅读量大比拼预警记录，同内容一小时内只提示一次
        /// </summary>
        public const int ActivityYdldbpWarningRecordCacheSecs = 60 * 60;

        public static string ActivityYdldbpWarningRecordCache(long userId, long postId)
        {
            return GenerateKey($"activity_warning_record:ydldbp:{userId}_{postId}");
        }

        /// <summary>
        /// 活动查看量
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static string ActivityQueryCount()
        {
            return GenerateKey($"activity_querycount");
        }

        /// <summary>
        /// 打卡
        /// </summary>
        /// <returns></returns>
        public static string ActivityDakaDeviceCache(int id, string time, bool isFinal = false)
        {
            string str = "";
            if (isFinal) str = "final_";
            return GenerateKey($"activity_daka:devicelist:{str}id_{id}_{time}");
        }
        /// <summary>
        /// 用户打卡今天是否打过卡
        /// </summary>
        /// <param name="id"></param>
        /// <param name="time"></param>
        /// <returns></returns>
        public static string ActivityDakaRecordsCache(int id, string time)
        {
            return GenerateKey($"activity_daka:records:id_{id}_{time}");
        }
        /// <summary>
        /// 用户用价值币购买次数
        /// </summary>
        /// <param name="id"></param>
        /// <param name="time"></param>
        /// <returns></returns>
        public static string ActivityDakaPointsCache(int id, string time)
        {
            return GenerateKey($"activity_daka:points:id_{id}_{time}");
        }

        /// <summary>
        /// 用户普通抽奖剩余次数
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static string ActivityDakaNormalDrawLeftCount(int id)
        {
            return GenerateKey($"activity_daka:normal_drawleft_count:id_{id}");
        }

        /// <summary>
        /// 用户终极抽奖剩余次数
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static string ActivityDakafinalDrawLeftCount(int id)
        {
            return GenerateKey($"activity_daka:final_drawleft_count:id_{id}");
        }
    }
}
