配合风控 验资改造 缓存设置

This commit is contained in:
yexuzhong
2025-08-27 14:39:43 +08:00
parent b3ddc1c898
commit 165f7c7df1
3 changed files with 16 additions and 0 deletions
+10
View File
@@ -18,6 +18,16 @@ namespace YLErp.Cache
/// <returns></returns>
bool DeleteKey(string key);
/// <summary>
/// Hash数据类型的保存
/// </summary>
/// <param name="key"></param>
/// <param name="hashKey"></param>
/// <param name="value"></param>
/// <returns></returns>
/// </summary>
bool HashSet<T>(string key, string hashKey, T value);
/// <summary>
/// 字符串数据类型的保存
/// </summary>
+5
View File
@@ -54,6 +54,11 @@ namespace YLErp.Cache
return db.StringSet(GenerateKey(key), value);
}
public bool HashSet<T>(string key, string hashKey, T value)
{
return db.HashSet(key, hashKey, JsonConvert.SerializeObject(value));
}
public string StringGet(string key)
{
return db.StringGet(GenerateKey(key));
@@ -81,6 +81,7 @@ namespace RealTimeCalcPositionService
if (_yLCache != null)
{
_yLCache.StringSet<ClientBalanceForTrsResponse>("ClientBalance:" + cb.ClientId, obj);
_yLCache.HashSet<decimal>("risk:cash:balance:amount", cb.ClientId.ToString(), (decimal)obj.AvailableAmount);
}
}
catch (Exception ex)