配合风控 验资改造 缓存设置
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user