From c7789c0b2198e6ebb16f943126aca0e02b5ed1b6 Mon Sep 17 00:00:00 2001 From: stepan Date: Sun, 13 Sep 2026 03:59:30 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D1=82=D1=8C=20?= =?UTF-8?q?=D1=80=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8E=20?= =?UTF-8?q?=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D1=84=D0=B5=D0=B9=D1=81=D0=BE?= =?UTF-8?q?=D0=B2=20=D1=84=D0=B0=D0=B1=D1=80=D0=B8=D0=BA=20=D1=8F=D0=B2?= =?UTF-8?q?=D0=BD=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit По код-стайлу §11 метод Create реализуется явно (ISecretCipher ISecretCipherFactory.Create()), интерфейс вызывается только по порту; тест фабрики типизирован интерфейсом. --- .../Integrations/Services/AiClassifierFactory.cs | 2 +- .../Integrations/Services/AiToolsFactory.cs | 2 +- .../Integrations/Storage/Services/FileStorageFactory.cs | 2 +- .../Persistence/Services/TenantLimitStoreFactory.cs | 2 +- .../Security/Services/SecretCipherFactory.cs | 2 +- .../tests/Deal.Tests.Unit/Support/FileStorageFactoryTests.cs | 5 +++-- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/core/Deal.Infrastructure/Integrations/Services/AiClassifierFactory.cs b/src/core/Deal.Infrastructure/Integrations/Services/AiClassifierFactory.cs index fc0f698..6f8dce4 100644 --- a/src/core/Deal.Infrastructure/Integrations/Services/AiClassifierFactory.cs +++ b/src/core/Deal.Infrastructure/Integrations/Services/AiClassifierFactory.cs @@ -45,6 +45,6 @@ public sealed class AiClassifierFactory : IAiClassifierFactory } /// - public IAiClassifier Create() => + IAiClassifier IAiClassifierFactory.Create() => new BudgetedAiClassifier(_paidClassifier, _localClassifier, _tenantLimits, _tenantContext, _logger); } diff --git a/src/core/Deal.Infrastructure/Integrations/Services/AiToolsFactory.cs b/src/core/Deal.Infrastructure/Integrations/Services/AiToolsFactory.cs index 3815c42..538c5e9 100644 --- a/src/core/Deal.Infrastructure/Integrations/Services/AiToolsFactory.cs +++ b/src/core/Deal.Infrastructure/Integrations/Services/AiToolsFactory.cs @@ -40,5 +40,5 @@ public sealed class AiToolsFactory : IAiToolsFactory } /// - public IAiTools Create() => new BudgetedAiTools(_paidTools, _tenantLimits, _tenantContext, _logger); + IAiTools IAiToolsFactory.Create() => new BudgetedAiTools(_paidTools, _tenantLimits, _tenantContext, _logger); } diff --git a/src/core/Deal.Infrastructure/Integrations/Storage/Services/FileStorageFactory.cs b/src/core/Deal.Infrastructure/Integrations/Storage/Services/FileStorageFactory.cs index 42f73cd..14d4617 100644 --- a/src/core/Deal.Infrastructure/Integrations/Storage/Services/FileStorageFactory.cs +++ b/src/core/Deal.Infrastructure/Integrations/Storage/Services/FileStorageFactory.cs @@ -35,7 +35,7 @@ public sealed class FileStorageFactory : IFileStorageFactory } /// - public IFileStorage Create() => + IFileStorage IFileStorageFactory.Create() => _options.Minio.IsConfigured() ? new MinioFileStorage(_options.Minio, _minioLogger) : new LocalFileStorage(_localRoot.Path); diff --git a/src/core/Deal.Infrastructure/Persistence/Services/TenantLimitStoreFactory.cs b/src/core/Deal.Infrastructure/Persistence/Services/TenantLimitStoreFactory.cs index f6a9cd3..f8f2e79 100644 --- a/src/core/Deal.Infrastructure/Persistence/Services/TenantLimitStoreFactory.cs +++ b/src/core/Deal.Infrastructure/Persistence/Services/TenantLimitStoreFactory.cs @@ -27,5 +27,5 @@ public sealed class TenantLimitStoreFactory : ITenantLimitStoreFactory } /// - public ITenantLimitStore Create() => new TenantLimitStore(_dbContext, _defaults); + ITenantLimitStore ITenantLimitStoreFactory.Create() => new TenantLimitStore(_dbContext, _defaults); } diff --git a/src/core/Deal.Infrastructure/Security/Services/SecretCipherFactory.cs b/src/core/Deal.Infrastructure/Security/Services/SecretCipherFactory.cs index b6aeaad..8e92292 100644 --- a/src/core/Deal.Infrastructure/Security/Services/SecretCipherFactory.cs +++ b/src/core/Deal.Infrastructure/Security/Services/SecretCipherFactory.cs @@ -21,5 +21,5 @@ public sealed class SecretCipherFactory : ISecretCipherFactory } /// - public ISecretCipher Create() => new AesGcmSecretCipher(_keyProvider.GetKey()); + ISecretCipher ISecretCipherFactory.Create() => new AesGcmSecretCipher(_keyProvider.GetKey()); } diff --git a/src/core/tests/Deal.Tests.Unit/Support/FileStorageFactoryTests.cs b/src/core/tests/Deal.Tests.Unit/Support/FileStorageFactoryTests.cs index 094310b..3f7068a 100644 --- a/src/core/tests/Deal.Tests.Unit/Support/FileStorageFactoryTests.cs +++ b/src/core/tests/Deal.Tests.Unit/Support/FileStorageFactoryTests.cs @@ -1,4 +1,5 @@ using Deal.Contracts.Integrations.Abstractions; +using Deal.Infrastructure.Integrations.Storage.Abstractions; using Deal.Infrastructure.Integrations.Storage.Options; using Deal.Infrastructure.Integrations.Storage.Services; using Microsoft.Extensions.Logging.Abstractions; @@ -14,7 +15,7 @@ public sealed class FileStorageFactoryTests [Fact] public void Create_MinioNotConfigured_ReturnsLocalFileStorage() { - var factory = new FileStorageFactory( + IFileStorageFactory factory = new FileStorageFactory( new StorageOptions(), new LocalStorageRoot("/tmp/deal-attachments"), NullLogger.Instance); @@ -37,7 +38,7 @@ public sealed class FileStorageFactoryTests SecretKey = "deal-secret", }, }; - var factory = new FileStorageFactory( + IFileStorageFactory factory = new FileStorageFactory( options, new LocalStorageRoot("/tmp/deal-attachments"), NullLogger.Instance);