namespace JiaZhiQuan.Common
{
public static partial class CacheKeys
{
public const int PushMsgThumbsupCacheSecs = 60 * 60 * 24;
///
/// 点赞消息推送缓存,对于同一目标点赞,一天只收一次通知
///
/// 点赞的用户Id
/// 点赞目标类型
/// 目标编号
///
public static string PushMsgThumbsupRepeatability(long fromUserId, ThumbsupTargetType type, long targetId)
{
return GenerateKey($"push_thumbsup:{fromUserId}:{(int)type}:{targetId}");
}
public const int PushMsgThumbsupReceivePerMinCacheSecs = 60;
///
/// 同一用户一分钟内只收到1次点赞推送
///
public static string PushMsgThumbsupReceivePerMin(long toUserId)
{
return GenerateKey($"push_thumbsup:m1:{toUserId}");
}
public const int PushMsgThumbsupReceivePerHourCacheSecs = 60 * 60;
///
/// 同一用户一小时内只收到2次点赞推送
///
public static string PushMsgThumbsupReceivePerHour(long toUserId)
{
return GenerateKey($"push_thumbsup:h1:{toUserId}");
}
public const int PushMsgThumbsupReceivePerDayCacheSecs = 24 * 60 * 60;
///
/// 同一用户一天内只收到3次点赞推送
///
public static string PushMsgThumbsupReceivePerDay(long toUserId)
{
return GenerateKey($"push_thumbsup:d1:{toUserId}");
}
public const int PushMsgFocusUserCacheSecs = 60 * 60 * 24;
///
/// 关注消息推送缓存,对于同一目标关注,一天只收一次通知
///
public static string PushMsgFocusRepeatability(long fromUserId, long toUserId)
{
return GenerateKey($"push_focus:{fromUserId}:{toUserId}");
}
///
/// 用户一个小时内收到的关注通知数量
///
public static string PushMsgFocusReceivePerHour(long toUserId)
{
return GenerateKey($"push_focus_count:h1:{toUserId}");
}
///
/// 用户一天内收到的关注通知数量
///
public static string PushMsgFocusReceivePerDay(long toUserId)
{
return GenerateKey($"push_focus_count:d1:{toUserId}");
}
public const int PushMsgCommentPerDayCacheSecs = 60 * 60 * 24;
///
/// 同一ID对另一ID用户,一天最多3次评论,除非楼主回复了后,再进行提醒(清除逻辑放在了评论通知中)
///
public static string PushMsgCommentPertDay(long fromUserId, long toUserId)
{
return GenerateKey($"push_comment:d1:{fromUserId}:{toUserId}");
}
public const int PushMsgCommentReceivePerHourCacheSecs = 60 * 60 * 24;
///
/// 用户一个小时内收到的评论通知数量
///
public static string PushMsgCommentReceivePerHour(long toUserId)
{
return GenerateKey($"push_comment_count:h1:{toUserId}");
}
public const int PushMsgCommentReceivePerDayCacheSecs = 24 * 60 * 60;
///
/// 用户一天内收到的评论通知数量
///
public static string PushMsgCommentReceivePerDay(long toUserId)
{
return GenerateKey($"push_comment_count:d1:{toUserId}");
}
public const int PushMsgUserConfigCacheSecs = 60 * 30;
///
/// 推送用户配置
///
public static string PushMsgUserConfig(long userId)
{
return GenerateKey($"push_userconfig:{userId}");
}
}
}