diff --git a/DysonNetwork.Sphere/Account/RelationshipService.cs b/DysonNetwork.Sphere/Account/RelationshipService.cs index f084910..2d60c84 100644 --- a/DysonNetwork.Sphere/Account/RelationshipService.cs +++ b/DysonNetwork.Sphere/Account/RelationshipService.cs @@ -6,7 +6,7 @@ namespace DysonNetwork.Sphere.Account; public class RelationshipService(AppDatabase db, ICacheService cache) { - private const string UserFriendsCacheKeyPrefix = "UserFriends_"; + private const string UserFriendsCacheKeyPrefix = "user:friends:"; public async Task HasExistingRelationship(Guid accountId, Guid relatedId) { diff --git a/DysonNetwork.Sphere/Auth/Auth.cs b/DysonNetwork.Sphere/Auth/Auth.cs index fe47dbb..c987ee4 100644 --- a/DysonNetwork.Sphere/Auth/Auth.cs +++ b/DysonNetwork.Sphere/Auth/Auth.cs @@ -77,7 +77,7 @@ public class DysonTokenAuthHandler( { // Store in cache for future requests await cache.SetWithGroupsAsync( - $"Auth_{sessionId}", + $"auth:{sessionId}", session, [$"{AccountService.AccountCachePrefix}{session.Account.Id}"], TimeSpan.FromHours(1) diff --git a/DysonNetwork.Sphere/Chat/ChatRoomService.cs b/DysonNetwork.Sphere/Chat/ChatRoomService.cs index 33f3a19..be57a69 100644 --- a/DysonNetwork.Sphere/Chat/ChatRoomService.cs +++ b/DysonNetwork.Sphere/Chat/ChatRoomService.cs @@ -6,9 +6,9 @@ namespace DysonNetwork.Sphere.Chat; public class ChatRoomService(AppDatabase db, ICacheService cache) { - public const string ChatRoomGroupPrefix = "ChatRoom_"; - private const string RoomMembersCacheKeyPrefix = "ChatRoomMembers_"; - private const string ChatMemberCacheKey = "ChatMember_{0}_{1}"; + public const string ChatRoomGroupPrefix = "chatroom:"; + private const string RoomMembersCacheKeyPrefix = "chatroom:members:"; + private const string ChatMemberCacheKey = "chatroom:{0}:member:{1}"; public async Task> ListRoomMembers(Guid roomId) { diff --git a/DysonNetwork.Sphere/Permission/PermissionService.cs b/DysonNetwork.Sphere/Permission/PermissionService.cs index 2c39dc0..1c7a865 100644 --- a/DysonNetwork.Sphere/Permission/PermissionService.cs +++ b/DysonNetwork.Sphere/Permission/PermissionService.cs @@ -12,9 +12,9 @@ public class PermissionService( { private static readonly TimeSpan CacheExpiration = TimeSpan.FromMinutes(1); - private const string PermCacheKeyPrefix = "Perm_"; - private const string PermGroupCacheKeyPrefix = "PermCacheGroup_"; - private const string PermissionGroupPrefix = "PermGroup_"; + private const string PermCacheKeyPrefix = "perm:"; + private const string PermGroupCacheKeyPrefix = "perm-cg:"; + private const string PermissionGroupPrefix = "perm-g:"; private static string _GetPermissionCacheKey(string actor, string area, string key) => PermCacheKeyPrefix + actor + ":" + area + ":" + key;