using System;

namespace JiaZhiQuan.Common
{
    public static partial class CacheKeys
    {

        public static string StatisticPostReadMaxTimesPerUser(DateTime date, long userId)
        {
            return GenerateKey("stat_postread_mt_pu:" + date.ToString("MMdd") + ":" + userId);
        }

        public static string StatisticPostReadUserPost(DateTime date, long userId, long postId)
        {
            return GenerateKey("stat_postread_up:" + date.ToString("MMdd") + ":" + userId + ":" + postId);
        }

        public static string StatisticPostReadClientIdPost(DateTime date, string clientId, long postId)
        {
            return GenerateKey("stat_postread_cp:" + date.ToString("MMdd") + ":" + clientId + ":" + postId);
        }

        public static string StatisticPostReadMaxTimesPerIP(DateTime date, string ip, long postId)
        {
            return GenerateKey("stat_postread_mt_pi:" + date.ToString("MMdd") + ":" + ip + ":" + postId);
        }

        /// <summary>
        /// 每天每个用户分享次数缓存
        /// </summary>
        public static string StatisticPostSahreMaxTimesPerUser(DateTime date, long userId)
        {
            return GenerateKey("stat_postshare_mt_pu:" + date.ToString("MMdd") + ":" + userId);
        }
        /// <summary>
        /// 每天每个用户每篇文章分享次数缓存
        /// </summary>
        public static string StatisticPostSahreMaxTimesPerUserPerPost(DateTime date, long userId, long postId)
        {
            return GenerateKey("stat_postshare_mt_pupp:" + date.ToString("MMdd") + ":" + userId + ":" + postId);
        }

        /// <summary>
        /// 每天每个人访问的用户主页缓存
        /// </summary>
        /// <param name="date">日期</param>
        /// <param name="userId">访问者编号</param>
        /// <param name="pageUserId">受访者编号</param>
        public static string StatisticPersonalPageViewUser2User(DateTime date, long userId, long pageUserId)
        {
            return GenerateKey("stat_personalpage_uu:" + date.ToString("MMdd") + ":" + userId + ":" + pageUserId);
        }

    }
}
