feat: 异常请求处理
This commit is contained in:
@@ -13,30 +13,28 @@ namespace YLErp.Modules.SystemModule
|
||||
public XBondSpreadService()
|
||||
{
|
||||
}
|
||||
|
||||
public XBondSpread Result { get; private set; }
|
||||
|
||||
public void SetXBondSpread(XBondSpread xBondSpread, IYLCache ylCache)
|
||||
{
|
||||
if (ylCache.CacheEnable())
|
||||
try
|
||||
{
|
||||
ylCache.StringSet<XBondSpread>(RedisKey, xBondSpread);
|
||||
ylCache.StringSetWithNoPrefix<XBondSpread>(RedisKey, xBondSpread, null);
|
||||
}
|
||||
else
|
||||
catch(Exception)
|
||||
{
|
||||
Result = xBondSpread;
|
||||
throw new Exception("偏移设置保存失败");
|
||||
}
|
||||
}
|
||||
|
||||
public XBondSpread GetXBondSpread(IYLCache ylCache)
|
||||
{
|
||||
if (ylCache.CacheEnable())
|
||||
try
|
||||
{
|
||||
return ylCache.StringGet<XBondSpread>(RedisKey);
|
||||
return ylCache.StringGetWithNoPrefix<XBondSpread>(RedisKey);
|
||||
}
|
||||
else
|
||||
catch(Exception)
|
||||
{
|
||||
return Result;
|
||||
throw new Exception("偏移设置获取失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user