|
|
|
@ -91,6 +91,28 @@ namespace GDZZ.Application.Help
|
|
|
|
|
await _redisCache.SetAsync(cacheKey, liveMessages, TimeSpan.FromHours(1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 设置未读数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="UserID"></param>
|
|
|
|
|
/// <param name="ChatUserID"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task SetUnreadAsync(long UserID)
|
|
|
|
|
{
|
|
|
|
|
string cacheKey = SystemConst.LIVE_UNREAD + $"{UserID}";
|
|
|
|
|
var res = _redisCache.Get<int>(cacheKey);
|
|
|
|
|
await _redisCache.SetAsync(cacheKey, 1+res);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async Task<int> GetUnreadAsync(long UserID)
|
|
|
|
|
{
|
|
|
|
|
string cacheKey = SystemConst.LIVE_UNREAD + $"{UserID}";
|
|
|
|
|
return _redisCache.Get<int>(cacheKey);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取聊天列表
|
|
|
|
|
/// </summary>
|
|
|
|
|