feat: 异常请求处理

This commit is contained in:
zheng.zhang
2025-12-18 10:57:17 +08:00
parent a10f42c41d
commit bbd5aabca3
3 changed files with 32 additions and 15 deletions
@@ -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("偏移设置获取失败");
}
}
}