using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Yi.Framework.ChatHub.Domain.Shared.Caches { public class ChatOnlineUserCacheItem { public ChatOnlineUserCacheItem() { } /// /// 用户id /// public Guid UserId { get; set; } /// /// 用户名称 /// public string UserName { get; set; } /// /// 用户头像 /// public string UserIcon { get; set; } /// /// 客户端id /// public string ClientId { get; set; } /// /// 连接时间 /// public DateTime CreationTime { get; }=DateTime.Now; public override string ToString() { return System.Text.Json.JsonSerializer.Serialize(this); } } public class ChatOnlineUserCacheKey { public string CacheKeyPrefix; public ChatOnlineUserCacheKey(string cacheKeyPrefix ) { CacheKeyPrefix=cacheKeyPrefix; } public string GetKey() { return $"{CacheKeyPrefix}ChatOnline"; } public string GetField(Guid userId) { return $"{userId}"; } } }