This commit is contained in:
2025-12-04 00:40:12 +08:00
parent 4f3eecabc4
commit c6a95fa28d
20 changed files with 874 additions and 9 deletions

View File

@@ -2,6 +2,7 @@
using Microsoft.Extensions.Caching.Distributed;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
namespace Atomx.Data.CacheServices
{
@@ -40,6 +41,12 @@ namespace Atomx.Data.CacheServices
/// <returns></returns>
Task Remove(string key);
/// <summary>
/// 获取缓存的字符串内容
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
Task<string?> GetCacheString(string key);
}
@@ -61,6 +68,10 @@ namespace Atomx.Data.CacheServices
return Task.CompletedTask;
}
public async Task<string?> GetCacheString(string key)
{
return await _cache.GetStringAsync(key);
}
public T? GetCache<T>(string key)
{