|
@@ -1,9 +1,12 @@
|
|
|
using Hotline.Caching.Interfaces;
|
|
|
+using Hotline.Configurations;
|
|
|
using Hotline.Settings;
|
|
|
using Hotline.Share.Tools;
|
|
|
using Hotline.ThirdAccountDomainServices.Interfaces;
|
|
|
+using Microsoft.Extensions.Configuration;
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
+using Microsoft.Extensions.Options;
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
using System.Reflection.Metadata.Ecma335;
|
|
|
using XF.Domain.Cache;
|
|
@@ -19,14 +22,14 @@ namespace Hotline.Caching.Services
|
|
|
private readonly ILogger<SystemSettingCacheManager> _logger;
|
|
|
private readonly ITypedCache<SystemSetting> _cacheSystemSetting;
|
|
|
private readonly IRepository<SystemSetting> _systemSettingRepository;
|
|
|
- private readonly IServiceProvider _serviceProvider;
|
|
|
+ private readonly IOptionsSnapshot<SenparcWeixinSetting> _senparcWeixin;
|
|
|
|
|
|
- public SystemSettingCacheManager(ITypedCache<SystemSetting> cacheSystemSetting, IRepository<SystemSetting> systemSettingRepository, ILogger<SystemSettingCacheManager> logger, IServiceProvider serviceProvider)
|
|
|
+ public SystemSettingCacheManager(ITypedCache<SystemSetting> cacheSystemSetting, IRepository<SystemSetting> systemSettingRepository, ILogger<SystemSettingCacheManager> logger, IOptionsSnapshot<SenparcWeixinSetting> senparcWeixin)
|
|
|
{
|
|
|
_cacheSystemSetting = cacheSystemSetting;
|
|
|
_systemSettingRepository = systemSettingRepository;
|
|
|
_logger = logger;
|
|
|
- _serviceProvider = serviceProvider;
|
|
|
+ _senparcWeixin = senparcWeixin;
|
|
|
}
|
|
|
|
|
|
public SystemSetting? GetSetting(string code)
|
|
@@ -213,7 +216,7 @@ namespace Hotline.Caching.Services
|
|
|
get
|
|
|
{
|
|
|
var switchBtn = GetOrDefault("08dd0eca-66b8-4c98-8dec-0c76c29d77e3", SettingConstants.Snapshot, "随手拍功能开关", false, "随手拍功能开关");
|
|
|
- if (_serviceProvider.GetService<IThirdIdentiyService>() == null) return false;
|
|
|
+ if (_senparcWeixin.Value.WxOpenAppId == null) return false;
|
|
|
return switchBtn;
|
|
|
}
|
|
|
}
|