From ffb329a0d9e84cda2c05180b3443e90161580757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Thu, 26 Dec 2024 21:57:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=94=AF=E6=8C=81=E5=8F=8C=E5=BC=80?= =?UTF-8?q?=E5=85=B3=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/CollectiblesService.cs | 5 +++++ .../SqlSugarAndConfigurationTenantStore.cs | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Yi.Abp.Net8/module/digital-collectibles/Yi.Framework.DigitalCollectibles.Application/Services/CollectiblesService.cs b/Yi.Abp.Net8/module/digital-collectibles/Yi.Framework.DigitalCollectibles.Application/Services/CollectiblesService.cs index 3b1d9054..3be19b6a 100644 --- a/Yi.Abp.Net8/module/digital-collectibles/Yi.Framework.DigitalCollectibles.Application/Services/CollectiblesService.cs +++ b/Yi.Abp.Net8/module/digital-collectibles/Yi.Framework.DigitalCollectibles.Application/Services/CollectiblesService.cs @@ -34,6 +34,11 @@ public class CollectiblesService : ApplicationService { return LazyServiceProvider.LazyGetRequiredService().GetValue("IsEnableCollectibles"); } + + public bool GetEnable2() + { + return LazyServiceProvider.LazyGetRequiredService().GetValue("IsEnableCollectibles2"); + } /// /// 获取该用户的信息 diff --git a/Yi.Abp.Net8/module/tenant-management/Yi.Framework.TenantManagement.Domain/SqlSugarAndConfigurationTenantStore.cs b/Yi.Abp.Net8/module/tenant-management/Yi.Framework.TenantManagement.Domain/SqlSugarAndConfigurationTenantStore.cs index f5bfaa52..8ada0992 100644 --- a/Yi.Abp.Net8/module/tenant-management/Yi.Framework.TenantManagement.Domain/SqlSugarAndConfigurationTenantStore.cs +++ b/Yi.Abp.Net8/module/tenant-management/Yi.Framework.TenantManagement.Domain/SqlSugarAndConfigurationTenantStore.cs @@ -6,6 +6,7 @@ using Volo.Abp.Caching; using Volo.Abp.Data; using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy.ConfigurationStore; +using Volo.Abp.Uow; namespace Yi.Framework.TenantManagement.Domain { @@ -14,14 +15,16 @@ namespace Yi.Framework.TenantManagement.Domain private ISqlSugarTenantRepository TenantRepository { get; } protected ICurrentTenant CurrentTenant { get; } protected IDistributedCache Cache { get; } + private IUnitOfWorkManager _unitOfWorkManager; public SqlSugarAndConfigurationTenantStore(ISqlSugarTenantRepository repository, IDistributedCache cache, ICurrentTenant currentTenant, - IOptionsMonitor options) : base(options) + IOptionsMonitor options, IUnitOfWorkManager unitOfWorkManager) : base(options) { TenantRepository = repository; Cache = cache; CurrentTenant = currentTenant; + _unitOfWorkManager = unitOfWorkManager; } public new TenantConfiguration? Find(string name) @@ -79,7 +82,13 @@ namespace Yi.Framework.TenantManagement.Domain { using (CurrentTenant.Change(null)) //TODO: No need this if we can implement to define host side (or tenant-independent) entities! { - var tenant = await TenantRepository.FindAsync(id.Value); + TenantAggregateRoot tenant = null; + using (var uow=_unitOfWorkManager.Begin(isTransactional:false)) + { + tenant = await TenantRepository.FindAsync(id.Value); + await uow.CompleteAsync(); + } + return await SetCacheAsync(cacheKey, tenant); } }