Redis获取数采数据

This commit is contained in:
qianjiawei
2023-11-03 15:42:51 +08:00
parent 821358621c
commit e12cc45299
5 changed files with 118 additions and 14 deletions

View File

@@ -224,12 +224,20 @@ public class RedisCache : ICache, ISingleton
long second = RedisHelper.PTtl(key);
return DateTime.Now.AddMilliseconds(second);
}
public string GetHash(string key, string field)
public Task<string> GetHash(string key, string field)
{
return RedisHelper.HGet(key, field);
return RedisHelper.HGetAsync(key, field);
}
public bool HashExist(string key, string field)
public Task<bool> HashExist(string key, string field)
{
return RedisHelper.HExists(key, field);
return RedisHelper.HExistsAsync(key, field);
}
public Task<Dictionary<string, string>> HGetAll(string key)
{
return RedisHelper.HGetAllAsync(key);
}
public Task<bool> HSet(string key, string field, string value)
{
return RedisHelper.HSetAsync(key, field,value);
}
}