2025-10-09 16:26:44 +08:00
|
|
|
|
using LM.Core.Enums;
|
2025-09-25 14:37:10 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
|
2025-10-09 16:26:44 +08:00
|
|
|
|
namespace LM.Core.Extensions
|
2025-09-25 14:37:10 +08:00
|
|
|
|
{
|
|
|
|
|
|
public static class CacheKeyExtensions
|
|
|
|
|
|
{
|
|
|
|
|
|
public static string GetKey(this CPrefix prefix, object value)
|
|
|
|
|
|
{
|
|
|
|
|
|
return prefix.ToString() + value;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static string GetUserIdKey(this int userId)
|
|
|
|
|
|
{
|
|
|
|
|
|
return CPrefix.UID.ToString() + userId;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static string GetRoleIdKey(this int roleId)
|
|
|
|
|
|
{
|
|
|
|
|
|
return CPrefix.Role.ToString() + roleId;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|