|
@@ -1,4 +1,5 @@
|
|
|
-using Hotline.Permissions;
|
|
|
+using Hotline.Caching.Interfaces;
|
|
|
+using Hotline.Permissions;
|
|
|
using Hotline.Repository.SqlSugar.Extensions;
|
|
|
using Hotline.Repository.SqlSugar.System;
|
|
|
using Hotline.Settings;
|
|
@@ -36,6 +37,7 @@ namespace Hotline.Api.Controllers
|
|
|
private readonly ISystemCommonOpinionDomainService _commonOpinionDomainService;
|
|
|
private readonly IRepository<SystemCommonOpinion> _commonOpinionRepository;
|
|
|
private readonly ISessionContext _sessionContext;
|
|
|
+ private readonly ISystemDicDataCacheManager _systemDicDataCacheManager;
|
|
|
|
|
|
/// <summary>
|
|
|
/// 系统管理相关接口
|
|
@@ -60,7 +62,8 @@ namespace Hotline.Api.Controllers
|
|
|
IRepository<SystemArea> systemAreaRepository,
|
|
|
ISystemCommonOpinionDomainService commonOpinionDomainService,
|
|
|
IRepository<SystemCommonOpinion> commonOpinionRepository,
|
|
|
- ISessionContext sessionContext
|
|
|
+ ISessionContext sessionContext,
|
|
|
+ ISystemDicDataCacheManager systemDicDataCacheManager
|
|
|
)
|
|
|
{
|
|
|
_mapper = mapper;
|
|
@@ -73,6 +76,7 @@ namespace Hotline.Api.Controllers
|
|
|
_commonOpinionDomainService = commonOpinionDomainService;
|
|
|
_commonOpinionRepository = commonOpinionRepository;
|
|
|
_sessionContext = sessionContext;
|
|
|
+ _systemDicDataCacheManager = systemDicDataCacheManager;
|
|
|
}
|
|
|
|
|
|
#region 菜单管理
|
|
@@ -301,6 +305,7 @@ namespace Hotline.Api.Controllers
|
|
|
throw UserFriendlyException.SameMessage("无效字典类型");
|
|
|
var dicData = _mapper.Map<SystemDicData>(dto);
|
|
|
dicData.DicTypeCode = dicType.DicTypeCode;
|
|
|
+ _systemDicDataCacheManager.RemoveSysDicDataCache(dicType.DicTypeCode);
|
|
|
await _sysDicDataRepository.AddAsync(dicData);
|
|
|
}
|
|
|
|
|
@@ -321,6 +326,7 @@ namespace Hotline.Api.Controllers
|
|
|
throw UserFriendlyException.SameMessage("无效字典类型");
|
|
|
_mapper.Map(dto, dicData);
|
|
|
dicData.DicTypeCode = dicType.DicTypeCode;
|
|
|
+ _systemDicDataCacheManager.RemoveSysDicDataCache(dicType.DicTypeCode);
|
|
|
await _sysDicDataRepository.UpdateAsync(dicData,HttpContext.RequestAborted);
|
|
|
}
|
|
|
|