diff --git a/PARR.AIHITLoaderWorker/Dockerfile b/PARR.AIHITLoaderWorker/Dockerfile
index 87ff4dd2..c110aa4e 100644
--- a/PARR.AIHITLoaderWorker/Dockerfile
+++ b/PARR.AIHITLoaderWorker/Dockerfile
@@ -9,10 +9,8 @@ WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.AIHITLoaderWorker/PARR.AIHITLoaderWorker.csproj", "PARR.AIHITLoaderWorker/"]
COPY ["PARR.AIHITMainLoader/PARR.AIHITMainLoader.csproj", "PARR.AIHITMainLoader/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
-COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
+COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
RUN dotnet restore "./PARR.AIHITLoaderWorker/./PARR.AIHITLoaderWorker.csproj"
COPY . .
diff --git a/PARR.AIHITMainLoader/AihitMainLoader.cs b/PARR.AIHITMainLoader/AihitMainLoader.cs
index 2721b2da..f4e23f27 100644
--- a/PARR.AIHITMainLoader/AihitMainLoader.cs
+++ b/PARR.AIHITMainLoader/AihitMainLoader.cs
@@ -3,9 +3,8 @@ using Microsoft.Extensions.Logging;
using PARR.AIHITMainLoader.Models;
using PARR.AIHITMainLoader.Services;
using PARR.AIHITMainLoader.Settings;
-using PARR.BLL.Services.Interfaces;
-using PARR.Core.Common;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces;
+using PARR.Core.Common.Interfaces.RabbitServices;
using System.Text.Encodings.Web;
using System.Text.Json;
diff --git a/PARR.AIHITMainLoader/AihitMainLoaderInstaller.cs b/PARR.AIHITMainLoader/AihitMainLoaderInstaller.cs
index 63c72e72..3b75090b 100644
--- a/PARR.AIHITMainLoader/AihitMainLoaderInstaller.cs
+++ b/PARR.AIHITMainLoader/AihitMainLoaderInstaller.cs
@@ -4,7 +4,6 @@ using Microsoft.Extensions.DependencyInjection;
using PARR.AIHITMainLoader.Context;
using PARR.AIHITMainLoader.Services;
using PARR.AIHITMainLoader.Settings;
-using PARR.BLL;
using PARR.Core;
using PARR.Infrastructure;
@@ -14,7 +13,6 @@ namespace PARR.AIHITMainLoader
{
public static void InstallAihitMainLoaderServices(this IServiceCollection services, IConfiguration configuration)
{
- services.InstallBllServices(configuration);
services.AddCoreServices(configuration);
services.AddInfrastructureServices(configuration);
diff --git a/PARR.AIHITMainLoader/PARR.AIHITMainLoader.csproj b/PARR.AIHITMainLoader/PARR.AIHITMainLoader.csproj
index de20737b..5e2c743e 100644
--- a/PARR.AIHITMainLoader/PARR.AIHITMainLoader.csproj
+++ b/PARR.AIHITMainLoader/PARR.AIHITMainLoader.csproj
@@ -11,7 +11,6 @@
-
diff --git a/PARR.AIHITMainSyncer/AihitMainSyncer.cs b/PARR.AIHITMainSyncer/AihitMainSyncer.cs
index 5b2f0078..db5c0ea0 100644
--- a/PARR.AIHITMainSyncer/AihitMainSyncer.cs
+++ b/PARR.AIHITMainSyncer/AihitMainSyncer.cs
@@ -2,7 +2,7 @@
using Microsoft.Extensions.Logging;
using PARR.AIHITMainSyncer.Services;
using PARR.AIHITMainSyncer.Settings;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces.RabbitServices;
namespace PARR.AIHITMainSyncer
{
diff --git a/PARR.AIHITMainSyncer/AihitMainSyncerInstaller.cs b/PARR.AIHITMainSyncer/AihitMainSyncerInstaller.cs
index c1628cc7..4bebc554 100644
--- a/PARR.AIHITMainSyncer/AihitMainSyncerInstaller.cs
+++ b/PARR.AIHITMainSyncer/AihitMainSyncerInstaller.cs
@@ -2,8 +2,9 @@
using Microsoft.Extensions.DependencyInjection;
using PARR.AIHITMainSyncer.Services;
using PARR.AIHITMainSyncer.Settings;
-using PARR.BLL;
+using PARR.Core;
using PARR.DAL;
+using PARR.Infrastructure;
namespace PARR.AIHITMainSyncer
{
@@ -11,8 +12,9 @@ namespace PARR.AIHITMainSyncer
{
public static void InstallAihitMainSyncerServices(this IServiceCollection services, IConfiguration configuration)
{
- services.InstallBllServices(configuration);
services.InstallDalServices(configuration);
+ services.AddCoreServices(configuration);
+ services.AddInfrastructureServices(configuration);
var settings = new WorkerSettings();
configuration.GetSection(nameof(WorkerSettings)).Bind(settings);
diff --git a/PARR.AIHITMainSyncer/PARR.AIHITMainSyncer.csproj b/PARR.AIHITMainSyncer/PARR.AIHITMainSyncer.csproj
index 21190861..e8ef522a 100644
--- a/PARR.AIHITMainSyncer/PARR.AIHITMainSyncer.csproj
+++ b/PARR.AIHITMainSyncer/PARR.AIHITMainSyncer.csproj
@@ -7,8 +7,9 @@
-
+
+
diff --git a/PARR.AIHITMainSyncer/Services/SyncerService.cs b/PARR.AIHITMainSyncer/Services/SyncerService.cs
index f1781d53..00c40c51 100644
--- a/PARR.AIHITMainSyncer/Services/SyncerService.cs
+++ b/PARR.AIHITMainSyncer/Services/SyncerService.cs
@@ -2,7 +2,7 @@
using Microsoft.Extensions.Logging;
using Newtonsoft.Json.Linq;
using PARR.AIHITMainSyncer.Settings;
-using PARR.BLL.Services.Interfaces;
+using PARR.Core.Common.Interfaces;
using PARR.DAL.Models.Unit;
using PARR.DAL.Services.Interfaces.Unit;
using PARR.Domain.Common.Rabbit.Messages;
diff --git a/PARR.AIHITRelationshipsSyncer/AihitRelationshpsSyncerInstaller.cs b/PARR.AIHITRelationshipsSyncer/AihitRelationshpsSyncerInstaller.cs
index bd1f48a1..5fe41ce6 100644
--- a/PARR.AIHITRelationshipsSyncer/AihitRelationshpsSyncerInstaller.cs
+++ b/PARR.AIHITRelationshipsSyncer/AihitRelationshpsSyncerInstaller.cs
@@ -5,9 +5,9 @@ using PARR.AIHITRelationshipsSyncer.Context;
using PARR.AIHITRelationshipsSyncer.Services.Implementations;
using PARR.AIHITRelationshipsSyncer.Services.Interfaces;
using PARR.AIHITRelationshipsSyncer.Settings;
-using PARR.BLL;
using PARR.Core;
using PARR.DAL;
+using PARR.Infrastructure;
namespace PARR.AIHITRelationshipsSyncer
{
@@ -15,10 +15,10 @@ namespace PARR.AIHITRelationshipsSyncer
{
public static void InstallAihitRelationshpsSyncerServices(this IServiceCollection services, IConfiguration configuration)
{
- services.InstallBllServices(configuration);
- services.AddCoreServices(configuration);
services.InstallDalServices(configuration);
-
+ services.AddCoreServices(configuration);
+ services.AddInfrastructureServices(configuration);
+
var settings = new WorkerSettings();
configuration.GetSection(nameof(WorkerSettings)).Bind(settings);
services.AddSingleton(settings);
diff --git a/PARR.AIHITRelationshipsSyncer/PARR.AIHITRelationshipsSyncer.csproj b/PARR.AIHITRelationshipsSyncer/PARR.AIHITRelationshipsSyncer.csproj
index 5471f1d2..39fa5489 100644
--- a/PARR.AIHITRelationshipsSyncer/PARR.AIHITRelationshipsSyncer.csproj
+++ b/PARR.AIHITRelationshipsSyncer/PARR.AIHITRelationshipsSyncer.csproj
@@ -11,8 +11,9 @@
-
+
+
diff --git a/PARR.AIHITRelationshipsSyncer/RelationshipsSyncer.cs b/PARR.AIHITRelationshipsSyncer/RelationshipsSyncer.cs
index ad283a88..f7f27c49 100644
--- a/PARR.AIHITRelationshipsSyncer/RelationshipsSyncer.cs
+++ b/PARR.AIHITRelationshipsSyncer/RelationshipsSyncer.cs
@@ -2,8 +2,7 @@
using PARR.AIHITRelationshipsSyncer.Models;
using PARR.AIHITRelationshipsSyncer.Services.Interfaces;
using PARR.AIHITRelationshipsSyncer.Settings;
-using PARR.BLL.Services.Interfaces;
-using PARR.Core.Common;
+using PARR.Core.Common.Interfaces;
using System.Text.Json;
namespace PARR.AIHITRelationshipsSyncer
diff --git a/PARR.AIHITRelationshipsSyncerWorker/Dockerfile b/PARR.AIHITRelationshipsSyncerWorker/Dockerfile
index 9930beb6..09638974 100644
--- a/PARR.AIHITRelationshipsSyncerWorker/Dockerfile
+++ b/PARR.AIHITRelationshipsSyncerWorker/Dockerfile
@@ -12,11 +12,10 @@ WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.AIHITRelationshipsSyncerWorker/PARR.AIHITRelationshipsSyncerWorker.csproj", "PARR.AIHITRelationshipsSyncerWorker/"]
COPY ["PARR.AIHITRelationshipsSyncer/PARR.AIHITRelationshipsSyncer.csproj", "PARR.AIHITRelationshipsSyncer/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
+COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
-COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
+COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
RUN dotnet restore "./PARR.AIHITRelationshipsSyncerWorker/PARR.AIHITRelationshipsSyncerWorker.csproj"
COPY . .
WORKDIR "/src/PARR.AIHITRelationshipsSyncerWorker"
diff --git a/PARR.AIHITSyncerWorker/Dockerfile b/PARR.AIHITSyncerWorker/Dockerfile
index a9847f80..c3a83ca3 100644
--- a/PARR.AIHITSyncerWorker/Dockerfile
+++ b/PARR.AIHITSyncerWorker/Dockerfile
@@ -9,11 +9,10 @@ WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.AIHITSyncerWorker/PARR.AIHITSyncerWorker.csproj", "PARR.AIHITSyncerWorker/"]
COPY ["PARR.AIHITMainSyncer/PARR.AIHITMainSyncer.csproj", "PARR.AIHITMainSyncer/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
+COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
-COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
+COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
RUN dotnet restore "./PARR.AIHITSyncerWorker/./PARR.AIHITSyncerWorker.csproj"
COPY . .
WORKDIR "/src/PARR.AIHITSyncerWorker"
diff --git a/PARR.API.sln b/PARR.API.sln
index 6c55f29e..0855d326 100644
--- a/PARR.API.sln
+++ b/PARR.API.sln
@@ -20,8 +20,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{AB278172-BFB4-4D54-9022-2D2A5B3338D7}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PARR.BLL", "PARR.BLL\PARR.BLL.csproj", "{7BAB9170-743D-4542-8881-9B161EE81BB6}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PARR.EsppTemplateSyncWorker", "PARR.EsppTemplateSyncWorker\PARR.EsppTemplateSyncWorker.csproj", "{7FBD65FE-26FE-4E60-AD1F-20AAC6F88C7A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PARR.EsppTemplateSync", "PARR.EsppTemplateSync\PARR.EsppTemplateSync.csproj", "{39FD9AAD-0792-46B2-A935-42486A993C32}"
@@ -70,8 +68,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PARR.JobAutoControlWorker",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PARR.JobAutoControl", "PARR.JobAutoControl\PARR.JobAutoControl.csproj", "{2C35CCD5-6DCD-4640-98DA-D2DC11CE3BA5}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PARR.Common", "PARR.Common\PARR.Common.csproj", "{5C89E990-6E49-4897-8344-1AC3ECFBD869}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PARR.AIHITMainLoader", "PARR.AIHITMainLoader\PARR.AIHITMainLoader.csproj", "{1BB7D841-4F6A-43B6-B89A-F0B09CDA40B1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PARR.AIHITMainSyncer", "PARR.AIHITMainSyncer\PARR.AIHITMainSyncer.csproj", "{173E33B2-A10B-4FE9-802C-B22940326DEB}"
@@ -120,10 +116,6 @@ Global
{228C8124-69E4-4AE0-8C33-0438E54FF1BA}.Release|Any CPU.Build.0 = Release|Any CPU
{AB278172-BFB4-4D54-9022-2D2A5B3338D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB278172-BFB4-4D54-9022-2D2A5B3338D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7BAB9170-743D-4542-8881-9B161EE81BB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7BAB9170-743D-4542-8881-9B161EE81BB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7BAB9170-743D-4542-8881-9B161EE81BB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7BAB9170-743D-4542-8881-9B161EE81BB6}.Release|Any CPU.Build.0 = Release|Any CPU
{7FBD65FE-26FE-4E60-AD1F-20AAC6F88C7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FBD65FE-26FE-4E60-AD1F-20AAC6F88C7A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7FBD65FE-26FE-4E60-AD1F-20AAC6F88C7A}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -220,10 +212,6 @@ Global
{2C35CCD5-6DCD-4640-98DA-D2DC11CE3BA5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2C35CCD5-6DCD-4640-98DA-D2DC11CE3BA5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2C35CCD5-6DCD-4640-98DA-D2DC11CE3BA5}.Release|Any CPU.Build.0 = Release|Any CPU
- {5C89E990-6E49-4897-8344-1AC3ECFBD869}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {5C89E990-6E49-4897-8344-1AC3ECFBD869}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {5C89E990-6E49-4897-8344-1AC3ECFBD869}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {5C89E990-6E49-4897-8344-1AC3ECFBD869}.Release|Any CPU.Build.0 = Release|Any CPU
{1BB7D841-4F6A-43B6-B89A-F0B09CDA40B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1BB7D841-4F6A-43B6-B89A-F0B09CDA40B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1BB7D841-4F6A-43B6-B89A-F0B09CDA40B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
diff --git a/PARR.API/Contracts/V1/Responses/MatchingStatusResponse.cs b/PARR.API/Contracts/V1/Responses/MatchingStatusResponse.cs
index 016bc5ff..44ad3ae0 100644
--- a/PARR.API/Contracts/V1/Responses/MatchingStatusResponse.cs
+++ b/PARR.API/Contracts/V1/Responses/MatchingStatusResponse.cs
@@ -1,4 +1,4 @@
-using PARR.DAL.Cache.Models;
+using PARR.Domain.Cache.Models;
namespace PARR.API.Contracts.V1.Responses
{
diff --git a/PARR.API/Controllers/V1/DistributorController.cs b/PARR.API/Controllers/V1/DistributorController.cs
index e6c2d35b..ecff455f 100644
--- a/PARR.API/Controllers/V1/DistributorController.cs
+++ b/PARR.API/Controllers/V1/DistributorController.cs
@@ -7,7 +7,7 @@ using PARR.API.Contracts.V1.Responses.Base;
using PARR.API.Controllers.V1.Base;
using PARR.API.Services.Interfaces;
using PARR.API.Settings;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.Domain.Common.Rabbit.Messages;
using PARR.Domain.Common.Roles;
using PARR.Domain.Entities.Base.History;
diff --git a/PARR.API/Controllers/V1/GeneratorTemplateController.cs b/PARR.API/Controllers/V1/GeneratorTemplateController.cs
index 61fdc7c1..9a832002 100644
--- a/PARR.API/Controllers/V1/GeneratorTemplateController.cs
+++ b/PARR.API/Controllers/V1/GeneratorTemplateController.cs
@@ -1,19 +1,4 @@
-using FluentValidation;
-using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Mvc;
-using PARR.API.Contracts.V1;
-using PARR.API.Contracts.V1.Requests;
-using PARR.API.Contracts.V1.Responses.Base;
-using PARR.API.Controllers.V1.Base;
-using PARR.API.Services.Interfaces;
-using PARR.API.Settings;
-using PARR.Core.Common.RabbitServices;
-using PARR.Domain.Common.Rabbit.Messages;
-using PARR.Domain.Common.Roles;
-using PARR.Domain.Entities.Base.History;
-using PARR.Domain.Enums;
-
-namespace PARR.API.Controllers.V1
+namespace PARR.API.Controllers.V1
{
//[Authorize(Roles = ParrRoles.Administrator.Role)]
//public class GeneratorTemplateController : BaseApiController
diff --git a/PARR.API/Controllers/V1/JobController.cs b/PARR.API/Controllers/V1/JobController.cs
index e26f3aa5..567c4ca7 100644
--- a/PARR.API/Controllers/V1/JobController.cs
+++ b/PARR.API/Controllers/V1/JobController.cs
@@ -13,7 +13,8 @@ using PARR.API.Extensions;
using PARR.API.Services.Interfaces;
using PARR.API.Settings;
using PARR.BLL.Helpers;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Helpers;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.DAL.DomainServices.Interfaces;
using PARR.DAL.DomainServices.UnitFilterService;
using PARR.DAL.Extensions;
diff --git a/PARR.API/Controllers/V1/JobGroupController.cs b/PARR.API/Controllers/V1/JobGroupController.cs
index 051bce22..2192c8c9 100644
--- a/PARR.API/Controllers/V1/JobGroupController.cs
+++ b/PARR.API/Controllers/V1/JobGroupController.cs
@@ -13,7 +13,8 @@ using PARR.API.Extensions;
using PARR.API.Services.Interfaces;
using PARR.API.Settings;
using PARR.BLL.Helpers;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Helpers;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.DAL.DomainServices.Interfaces;
using PARR.DAL.Models;
using PARR.DAL.Models.Job;
diff --git a/PARR.API/Controllers/V1/JobGroupUpdateNextRunController.cs b/PARR.API/Controllers/V1/JobGroupUpdateNextRunController.cs
index 38cc130a..9241fbc2 100644
--- a/PARR.API/Controllers/V1/JobGroupUpdateNextRunController.cs
+++ b/PARR.API/Controllers/V1/JobGroupUpdateNextRunController.cs
@@ -5,7 +5,7 @@ using PARR.API.Contracts.V1;
using PARR.API.Contracts.V1.Responses.Base;
using PARR.API.Controllers.V1.Base;
using PARR.API.Settings;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.DAL.Services.Interfaces.Job;
using PARR.Domain.Common.Rabbit.Messages;
using PARR.Domain.Common.Roles;
diff --git a/PARR.API/Controllers/V1/Statistics/StatAuthController.cs b/PARR.API/Controllers/V1/Statistics/StatAuthController.cs
index 7a16e14d..3c3ca48b 100644
--- a/PARR.API/Controllers/V1/Statistics/StatAuthController.cs
+++ b/PARR.API/Controllers/V1/Statistics/StatAuthController.cs
@@ -5,9 +5,9 @@ using PARR.API.Contracts.V1.Requests.Queries;
using PARR.API.Contracts.V1.Responses.Base;
using PARR.API.Contracts.V1.Responses.Statistics;
using PARR.API.Controllers.V1.Base;
-using PARR.DAL.InfluxDbServices;
-using PARR.DAL.Settings;
+using PARR.Core.Common.Interfaces;
using PARR.Domain.Common.Roles;
+using PARR.Domain.Settings;
namespace PARR.API.Controllers.V1.Statistics
{
diff --git a/PARR.API/Controllers/V1/Statistics/StatRabbitMqController.cs b/PARR.API/Controllers/V1/Statistics/StatRabbitMqController.cs
index aeddd328..e98e88de 100644
--- a/PARR.API/Controllers/V1/Statistics/StatRabbitMqController.cs
+++ b/PARR.API/Controllers/V1/Statistics/StatRabbitMqController.cs
@@ -5,7 +5,7 @@ using PARR.API.Contracts.V1.Responses.Base;
using PARR.API.Contracts.V1.Responses.Statistics;
using PARR.API.Controllers.V1.Base;
using PARR.API.Settings;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.Domain.Common.Roles;
namespace PARR.API.Controllers.V1.Statistics
diff --git a/PARR.API/Controllers/V1/Statistics/StatRobotStateController.cs b/PARR.API/Controllers/V1/Statistics/StatRobotStateController.cs
index 55c7e5a9..b6fc9dae 100644
--- a/PARR.API/Controllers/V1/Statistics/StatRobotStateController.cs
+++ b/PARR.API/Controllers/V1/Statistics/StatRobotStateController.cs
@@ -14,11 +14,11 @@ using PARR.API.Contracts.V1.Responses.Statistics;
using PARR.API.Controllers.V1.Base;
using PARR.API.Services.Interfaces;
using PARR.API.Settings;
-using PARR.DAL.InfluxDbServices;
+using PARR.Core.Common.Interfaces;
using PARR.DAL.Services.Interfaces;
-using PARR.DAL.Settings;
using PARR.Domain.Common.Roles;
using PARR.Domain.Enums;
+using PARR.Domain.Settings;
namespace PARR.API.Controllers.V1.Statistics
{
diff --git a/PARR.API/Controllers/V1/SyncTaskController.cs b/PARR.API/Controllers/V1/SyncTaskController.cs
index 63a3aec1..ec66348e 100644
--- a/PARR.API/Controllers/V1/SyncTaskController.cs
+++ b/PARR.API/Controllers/V1/SyncTaskController.cs
@@ -5,7 +5,7 @@ using PARR.API.Contracts.V1.Responses.Base;
using PARR.API.Controllers.V1.Base;
using PARR.API.Services.Interfaces;
using PARR.API.Settings;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.DAL.DomainServices.Interfaces;
using PARR.Domain.Common.Rabbit.Messages;
using PARR.Domain.Entities.Base.History;
diff --git a/PARR.API/Controllers/V1/TemplateActivatorController.cs b/PARR.API/Controllers/V1/TemplateActivatorController.cs
index 44f973d2..f6a89022 100644
--- a/PARR.API/Controllers/V1/TemplateActivatorController.cs
+++ b/PARR.API/Controllers/V1/TemplateActivatorController.cs
@@ -7,7 +7,7 @@ using PARR.API.Contracts.V1.Responses.Base;
using PARR.API.Controllers.V1.Base;
using PARR.API.Services.Interfaces;
using PARR.API.Settings;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.DAL.Services.Interfaces.Job;
using PARR.Domain.Common.Rabbit.Messages;
using PARR.Domain.Common.Roles;
diff --git a/PARR.API/Controllers/V1/TemplateController.cs b/PARR.API/Controllers/V1/TemplateController.cs
index e28dd643..dfdb8dbd 100644
--- a/PARR.API/Controllers/V1/TemplateController.cs
+++ b/PARR.API/Controllers/V1/TemplateController.cs
@@ -11,6 +11,7 @@ using PARR.API.Controllers.V1.Base;
using PARR.API.Extensions;
using PARR.API.Services.Interfaces;
using PARR.BLL.Helpers;
+using PARR.Core.Common.Helpers;
using PARR.DAL.Contracts;
using PARR.DAL.DomainServices.Shortcodes;
using PARR.DAL.Models;
diff --git a/PARR.API/Controllers/V1/TestController.cs b/PARR.API/Controllers/V1/TestController.cs
index 04515187..9aa20997 100644
--- a/PARR.API/Controllers/V1/TestController.cs
+++ b/PARR.API/Controllers/V1/TestController.cs
@@ -5,7 +5,7 @@ using PARR.API.Contracts.V1.Responses.Base;
using PARR.API.Controllers.V1.Base;
using PARR.API.Services.Interfaces;
using PARR.API.Settings;
-using PARR.DAL.Cache.Services.Base;
+using PARR.Core.Common.Interfaces;
using PARR.DAL.NextRunServices;
using PARR.DAL.Services.Interfaces;
diff --git a/PARR.API/Controllers/V1/UnitController.cs b/PARR.API/Controllers/V1/UnitController.cs
index 07d9f3ed..885b69a3 100644
--- a/PARR.API/Controllers/V1/UnitController.cs
+++ b/PARR.API/Controllers/V1/UnitController.cs
@@ -9,6 +9,7 @@ using PARR.API.Contracts.V1.Responses.Base;
using PARR.API.Controllers.V1.Base;
using PARR.API.Extensions;
using PARR.BLL.Helpers;
+using PARR.Core.Common.Helpers;
using PARR.DAL.Models.Unit;
using PARR.DAL.Services.Interfaces.Unit;
using PARR.Domain.Common.Pagination;
diff --git a/PARR.API/Controllers/V1/UnitFieldValueController.cs b/PARR.API/Controllers/V1/UnitFieldValueController.cs
index 849be477..dc3583c6 100644
--- a/PARR.API/Controllers/V1/UnitFieldValueController.cs
+++ b/PARR.API/Controllers/V1/UnitFieldValueController.cs
@@ -9,6 +9,7 @@ using PARR.API.Contracts.V1.Responses.Base;
using PARR.API.Controllers.V1.Base;
using PARR.API.Extensions;
using PARR.BLL.Helpers;
+using PARR.Core.Common.Helpers;
using PARR.DAL.Models.Unit;
using PARR.DAL.Services.Interfaces.Unit;
using PARR.Domain.Common.Pagination;
diff --git a/PARR.API/Dockerfile b/PARR.API/Dockerfile
index 1fcb2297..a1ad1cb9 100644
--- a/PARR.API/Dockerfile
+++ b/PARR.API/Dockerfile
@@ -15,10 +15,8 @@ FROM 10.99.253.167:8090/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.API/PARR.API.csproj", "PARR.API/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
-COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
+COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
RUN dotnet restore "PARR.API/PARR.API.csproj"
diff --git a/PARR.API/PARR.API.csproj b/PARR.API/PARR.API.csproj
index 69357422..5cdea6be 100644
--- a/PARR.API/PARR.API.csproj
+++ b/PARR.API/PARR.API.csproj
@@ -35,7 +35,6 @@
-
diff --git a/PARR.API/Program.cs b/PARR.API/Program.cs
index 25531d08..3c7e520e 100644
--- a/PARR.API/Program.cs
+++ b/PARR.API/Program.cs
@@ -3,7 +3,6 @@ using FluentValidation;
using Microsoft.AspNetCore.HttpOverrides;
using PARR.API.Authentication;
using PARR.API.Installers;
-using PARR.BLL;
using PARR.Core;
using PARR.DAL;
using PARR.Infrastructure;
@@ -28,7 +27,6 @@ builder.Services.InstallDalServices(builder.Configuration);
builder.Services.AddCoreServices(builder.Configuration);
builder.Services.AddInfrastructureServices(builder.Configuration);
//---- --- ----
-builder.Services.InstallBllServices(builder.Configuration);
builder.Services.InstallApiServices(builder.Configuration);
builder.Services.InstallSettings(builder.Configuration);
builder.Services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
diff --git a/PARR.API/Services/Implementations/AuthService.cs b/PARR.API/Services/Implementations/AuthService.cs
index 0dd412f0..e9fd1ebf 100644
--- a/PARR.API/Services/Implementations/AuthService.cs
+++ b/PARR.API/Services/Implementations/AuthService.cs
@@ -3,12 +3,11 @@ using PARR.API.Authentication.Models;
using PARR.API.Domain.InfluxDbModels;
using PARR.API.Services.Interfaces;
using PARR.API.Settings;
-using PARR.DAL.Cache.Services.Base;
-using PARR.DAL.InfluxDbServices;
+using PARR.Core.Common.Interfaces;
using PARR.DAL.Services.Interfaces;
using PARR.DAL.Services.Interfaces.Unit;
-using PARR.DAL.Settings;
using PARR.Domain.Common.Roles;
+using PARR.Domain.Settings;
namespace PARR.API.Services.Implementations
{
diff --git a/PARR.API/Services/Implementations/WorkLoadService.cs b/PARR.API/Services/Implementations/WorkLoadService.cs
index 9f04ffd0..cad7157b 100644
--- a/PARR.API/Services/Implementations/WorkLoadService.cs
+++ b/PARR.API/Services/Implementations/WorkLoadService.cs
@@ -1,83 +1,80 @@
-using PARR.API.Contracts.V1.Requests.Queries;
-using PARR.API.Services.Interfaces;
-using PARR.BLL.Services.Interfaces;
-using PARR.DAL.Models;
+using PARR.API.Services.Interfaces;
namespace PARR.API.Services.Implementations
{
internal class WorkLoadService : IWorkLoadService
{
- private readonly ICalendarService calendarService;
+ //private readonly ICalendarService calendarService;
- public WorkLoadService(ICalendarService calendarService)
- {
- this.calendarService = calendarService;
- }
+ //public WorkLoadService(ICalendarService calendarService)
+ //{
+ // this.calendarService = calendarService;
+ //}
- private DateTime GetStartDate(int timeZoneOffsetHours)
- {
- //(так уже не делаем) начинаем не с сегодняшнего дня, а с завтра, так как на сегодня уже некоторые работы были проведены и их дата изменилась
- //return DateTimeOffset.UtcNow.AddHours(timeZoneOffsetHours).Date.AddDays(1);
+ //private DateTime GetStartDate(int timeZoneOffsetHours)
+ //{
+ // //(так уже не делаем) начинаем не с сегодняшнего дня, а с завтра, так как на сегодня уже некоторые работы были проведены и их дата изменилась
+ // //return DateTimeOffset.UtcNow.AddHours(timeZoneOffsetHours).Date.AddDays(1);
- var dateWithTimeZoneOffset = calendarService.GetDateWithTimeZoneOffset(DateTimeOffset.UtcNow, timeZoneOffsetHours);
- //var dateWithAddDays = dateWithTimeZoneOffset.DateTime.AddDays(1);
- var dateWithAddDays = dateWithTimeZoneOffset.DateTime.AddDays(0);
+ // var dateWithTimeZoneOffset = calendarService.GetDateWithTimeZoneOffset(DateTimeOffset.UtcNow, timeZoneOffsetHours);
+ // //var dateWithAddDays = dateWithTimeZoneOffset.DateTime.AddDays(1);
+ // var dateWithAddDays = dateWithTimeZoneOffset.DateTime.AddDays(0);
- //var bbb = dateWithTimeZoneOffset.DateTime.AddDays(1);
+ // //var bbb = dateWithTimeZoneOffset.DateTime.AddDays(1);
- //return calendarService.GetDateWithTimeZoneOffset(DateTimeOffset.UtcNow, timeZoneOffsetHours).UtcDateTime.AddDays(1);
- return dateWithAddDays;
- }
+ // //return calendarService.GetDateWithTimeZoneOffset(DateTimeOffset.UtcNow, timeZoneOffsetHours).UtcDateTime.AddDays(1);
+ // return dateWithAddDays;
+ //}
- private DateTime GetEndDate(bool? isMonth, int timeZoneOffsetHours)
- {
- var startDate = GetStartDate(timeZoneOffsetHours);
+ //private DateTime GetEndDate(bool? isMonth, int timeZoneOffsetHours)
+ //{
+ // var startDate = GetStartDate(timeZoneOffsetHours);
- return isMonth == true ? startDate.AddDays(30) : startDate.AddDays(6);
- }
+ // return isMonth == true ? startDate.AddDays(30) : startDate.AddDays(6);
+ //}
- public List GetDatesForPeriod(WorkloadBaseQuery requestQuery)
- {
- var startDate = GetStartDate(requestQuery.TimeZoneOffsetHours);
- var endDate = GetEndDate(requestQuery.IsMonth, requestQuery.TimeZoneOffsetHours);
+ //public List GetDatesForPeriod(WorkloadBaseQuery requestQuery)
+ //{
+ // var startDate = GetStartDate(requestQuery.TimeZoneOffsetHours);
+ // var endDate = GetEndDate(requestQuery.IsMonth, requestQuery.TimeZoneOffsetHours);
- //var daysList = new List();
+ // //var daysList = new List();
- //daysList.Add(new DateTimeOffset(startDate, new TimeSpan(0)));
+ // //daysList.Add(new DateTimeOffset(startDate, new TimeSpan(0)));
- //while (daysList.Last() < endDate)
- // daysList.Add(daysList.Last().AddDays(1));
+ // //while (daysList.Last() < endDate)
+ // // daysList.Add(daysList.Last().AddDays(1));
- //return daysList.OrderBy(t => t).ToList();
+ // //return daysList.OrderBy(t => t).ToList();
- //var aaa = DateOnly.FromDateTime(startDate);
+ // //var aaa = DateOnly.FromDateTime(startDate);
- return calendarService.GetDatesForPeriod(DateOnly.FromDateTime(startDate), DateOnly.FromDateTime(endDate));
- }
+ // return calendarService.GetDatesForPeriod(DateOnly.FromDateTime(startDate), DateOnly.FromDateTime(endDate));
+ //}
- public IQueryable FilterTemplatesQuery(IQueryable query, WorkloadBaseQuery requestQuery)
- {
- var startDate = GetStartDate(requestQuery.TimeZoneOffsetHours);
- var endDate = GetEndDate(requestQuery.IsMonth, requestQuery.TimeZoneOffsetHours);
+ //public IQueryable FilterTemplatesQuery(IQueryable query, WorkloadBaseQuery requestQuery)
+ //{
+ // var startDate = GetStartDate(requestQuery.TimeZoneOffsetHours);
+ // var endDate = GetEndDate(requestQuery.IsMonth, requestQuery.TimeZoneOffsetHours);
- //query = query.Where(t =>
- // t.NextRun.DateTime.Date >= startDate.Date && t.NextRun.DateTime.Date <= endDate.Date
- // );
+ // //query = query.Where(t =>
+ // // t.NextRun.DateTime.Date >= startDate.Date && t.NextRun.DateTime.Date <= endDate.Date
+ // // );
- query = query.Where(t =>
- t.NextRun.DateTime.AddHours(requestQuery.TimeZoneOffsetHours).Date >= startDate.Date && t.NextRun.DateTime.AddHours(requestQuery.TimeZoneOffsetHours).Date <= endDate.Date
- );
+ // query = query.Where(t =>
+ // t.NextRun.DateTime.AddHours(requestQuery.TimeZoneOffsetHours).Date >= startDate.Date && t.NextRun.DateTime.AddHours(requestQuery.TimeZoneOffsetHours).Date <= endDate.Date
+ // );
- if (requestQuery.IsActiveTemplate.HasValue)
- query = query.Where(t => t.IsActiveTemplate == requestQuery.IsActiveTemplate.Value);
+ // if (requestQuery.IsActiveTemplate.HasValue)
+ // query = query.Where(t => t.IsActiveTemplate == requestQuery.IsActiveTemplate.Value);
- if (requestQuery.IsActiveSchedule.HasValue)
- query = query.Where(t => t.IsActiveSchedule == requestQuery.IsActiveSchedule.Value);
+ // if (requestQuery.IsActiveSchedule.HasValue)
+ // query = query.Where(t => t.IsActiveSchedule == requestQuery.IsActiveSchedule.Value);
- return query;
- }
+ // return query;
+ //}
}
}
diff --git a/PARR.API/Services/Interfaces/IWorkLoadService.cs b/PARR.API/Services/Interfaces/IWorkLoadService.cs
index c5be1fb7..36ae14e6 100644
--- a/PARR.API/Services/Interfaces/IWorkLoadService.cs
+++ b/PARR.API/Services/Interfaces/IWorkLoadService.cs
@@ -8,9 +8,9 @@ namespace PARR.API.Services.Interfaces
///
public interface IWorkLoadService
{
- IQueryable FilterTemplatesQuery(IQueryable query, WorkloadBaseQuery requestQuery);
+ //IQueryable FilterTemplatesQuery(IQueryable query, WorkloadBaseQuery requestQuery);
- List GetDatesForPeriod(WorkloadBaseQuery requestQuery);
+ //List GetDatesForPeriod(WorkloadBaseQuery requestQuery);
//DateTime GetEndDate(DateTime startDate, bool? isMonth);
//DateTime GetStartDate();
diff --git a/PARR.API/Validators/WorkRequestValidator.cs b/PARR.API/Validators/WorkRequestValidator.cs
index c3eeda91..b3d5683a 100644
--- a/PARR.API/Validators/WorkRequestValidator.cs
+++ b/PARR.API/Validators/WorkRequestValidator.cs
@@ -1,6 +1,5 @@
using FluentValidation;
using PARR.API.Contracts.V1.Requests;
-using PARR.BLL.Services.Interfaces;
using PARR.DAL.Services.Interfaces;
namespace PARR.API.Validators
@@ -12,8 +11,8 @@ namespace PARR.API.Validators
private bool? isValid = null;
public WorkRequestValidator(
- ITnkService tnkService,
- ITemplateMaskValidator templateMaskValidator
+ ITnkService tnkService
+ //ITemplateMaskValidator templateMaskValidator
)
{
this.tnkService = tnkService;
diff --git a/PARR.API/appsettings.Development.json b/PARR.API/appsettings.Development.json
index ecbe68f1..8a4c5f08 100644
--- a/PARR.API/appsettings.Development.json
+++ b/PARR.API/appsettings.Development.json
@@ -26,9 +26,6 @@
}
]
},
- "StorageSettings": {
- "StoragePath": "W:\\"
- },
"MqSettings": {
"GenerateTemplates": {
"HostName": "10.99.253.216"
diff --git a/PARR.API/appsettings.json b/PARR.API/appsettings.json
index 0d42f7d2..1ce93432 100644
--- a/PARR.API/appsettings.json
+++ b/PARR.API/appsettings.json
@@ -22,13 +22,6 @@
"CorsSettings": {
"AllowedHosts": "http://localhost:4200; http://10.99.253.221:8083; http://dvgd-web-09.dvgd.oao.rzd:8094"
},
- "StorageSettings": {
- "StoragePath": "Data",
- "EsppTemplates": {
- "AllowedExtensions": [ ".csv" ],
- "MaxFileSizeMb": 100
- }
- },
"MqSettings": {
"GenerateTemplates": {
"HostName": "parr-rabbitmq",
diff --git a/PARR.BLL/Domain/TemplateNameConstantPart.cs b/PARR.BLL/Domain/TemplateNameConstantPart.cs
deleted file mode 100644
index fe0523b0..00000000
--- a/PARR.BLL/Domain/TemplateNameConstantPart.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace PARR.BLL.Domain
-{
- public class TemplateNameConstantPart
- {
- public required string Name { get; set; }
- public required string Value { get; set; }
- }
-}
diff --git a/PARR.BLL/Domain/UploadResult.cs b/PARR.BLL/Domain/UploadResult.cs
deleted file mode 100644
index a0bb8f9d..00000000
--- a/PARR.BLL/Domain/UploadResult.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace PARR.BLL.Domain
-{
- public class UploadResult
- {
- public required string FileName { get; set; }
- public required string Path { get; set; }
- }
-}
diff --git a/PARR.BLL/Helpers/TemplateHelpers.cs b/PARR.BLL/Helpers/TemplateHelpers.cs
deleted file mode 100644
index 05318b01..00000000
--- a/PARR.BLL/Helpers/TemplateHelpers.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System.Text.RegularExpressions;
-
-namespace PARR.BLL.Helpers
-{
- public static class TemplateHelpers
- {
- ///
- /// Генерация имени шаблона
- ///
- /// %PREFIX% для замены в шаблоне настроек
- /// берется из настроек
- ///
- ///
- ///
- public static string GenerateTemplateName(string prefix, string settingsPrefix, string ek, string work)
- {
- if (string.IsNullOrEmpty(prefix))
- prefix = "ОБЩЕЕ";
-
- if (string.IsNullOrEmpty(settingsPrefix))
- settingsPrefix = "%PREFIX%-ЭИТИ-ПАРР";
-
- var joinedPrefix = settingsPrefix.Replace("%PREFIX%", prefix);
-
- var splitter = "__";
- return joinedPrefix + splitter + ek + splitter + work.Replace(" ", "-").ToUpper();
- }
-
-
- public static string GenerateTemplateNameWithResponseArea(string responseAreaCode, string settingsPrefix, string ek, string work)
- {
- var shortName = new Regex("[А-я]+$").Match(responseAreaCode).Value;
-
- return GenerateTemplateName(shortName, settingsPrefix, ek, work);
- }
-
-
- }
-}
diff --git a/PARR.BLL/PARR.BLL.csproj b/PARR.BLL/PARR.BLL.csproj
deleted file mode 100644
index c3766c2b..00000000
--- a/PARR.BLL/PARR.BLL.csproj
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- net7.0
- enable
- enable
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/PARR.BLL/ParrBllInstaller.cs b/PARR.BLL/ParrBllInstaller.cs
deleted file mode 100644
index 83f86460..00000000
--- a/PARR.BLL/ParrBllInstaller.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using PARR.BLL.Services.Implementations;
-using PARR.BLL.Services.Interfaces;
-using PARR.BLL.Settings;
-
-namespace PARR.BLL
-{
- public static class ParrBllInstaller
- {
- public static void InstallBllServices(this IServiceCollection services, IConfiguration configuration)
- {
-
- var storageSettings = new StorageSettings();
- configuration.GetSection(nameof(StorageSettings)).Bind(storageSettings);
- services.AddSingleton(storageSettings);
-
-
- //services.AddTransient();
-
- //services.AddTransient();
- //services.AddTransient();
-
- //services.AddHttpClient();
- services.AddTransient();
- services.AddTransient();
- services.AddTransient();
- }
- }
-}
diff --git a/PARR.BLL/Services/Implementations/CalendarService.cs b/PARR.BLL/Services/Implementations/CalendarService.cs
deleted file mode 100644
index cdffe1c8..00000000
--- a/PARR.BLL/Services/Implementations/CalendarService.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-using Microsoft.Extensions.Logging;
-using PARR.BLL.Services.Interfaces;
-using PARR.Common;
-using PARR.Domain.Enums;
-
-namespace PARR.BLL.Services.Implementations
-{
- internal class CalendarService : ICalendarService
- {
-
-
-
- // !!! Вообще не использовать этот класс!!! Удалить его!!! Есть же INextRunServiceV2, вот его и использовать!!!
-
-
-
- private readonly ILogger logger;
-
- public CalendarService(ILogger logger)
- {
- this.logger = logger;
- }
-
-
- public DateOnly GetEndPeriodDate(DateOnly startPeriod, DistributionPeriodTypeEnum periodType, string distributionPeriod)
- {
- switch (periodType)
- {
- case (DistributionPeriodTypeEnum.Day):
- return startPeriod.AddDays(ParseInt(distributionPeriod)).AddDays(-1);
-
- case (DistributionPeriodTypeEnum.Month):
- return startPeriod.AddMonths(ParseInt(distributionPeriod)).AddDays(-1);
-
- case (DistributionPeriodTypeEnum.Year):
- return startPeriod.AddYears(ParseInt(distributionPeriod)).AddDays(-1);
-
- }
-
- return startPeriod;
- }
-
-
- private int ParseInt(string value)
- {
- try
- {
- return int.Parse(value);
- }
- catch (Exception ex)
- {
- logger.LogError(ex, $"{nameof(CalendarService)}, получение конца периода. Не смог распарсить string в int для значения {value}.");
- return 0;
- }
- }
-
-
- ///
- /// Возвращает список рабочих дней с начала периода без выходных
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public List GetWorkDatesForPeriod(DateOnly startPeriod, TimeOnly refTime, DistributionPeriodTypeEnum periodType, string distributionPeriod, GetWeekendsDelegate getWeekends)
- {
- var endPeriod = GetEndPeriodDate(startPeriod, periodType, distributionPeriod);
-
- //не получилось сделать асинхронным
- var weekends = getWeekends.Invoke(startPeriod, endPeriod).ToList(); //.ToListAsync();
-
- //Берем список дат за период
- var workDays = GetDatesForPeriod(startPeriod, endPeriod);
-
- //Убираем праздники
- if (weekends.Any())
- workDays = workDays.Where(t => !weekends.Any(x => x == t)).ToList();
-
- //РАСКОММЕНТИРОВАТЬ НИЖЕ (28 дней), если не использовать календарь выходных дней
- ////Убираем числа старше 28, чтобы сравнять продолжительность с февралем
- //workDays.RemoveAll(t => t.Day > 28);
-
- //Так как в базе всё храним в UTC то время с 21 часа уже соответствует следующими суткам в календаре Москвы
- //просто сдвигаем на день весь список
- //if (refTime.Hour > 21)
- if (DateResolver.IsCurrentDayRelativeMskTime(refTime.Hour) == false)
- return workDays.Select(wd => wd.AddDays(-1)).ToList();
-
- //иначе просто отдаём как есть
- return workDays;
- }
-
-
-
-
- ///
- /// Возвращает список дней между датами
- ///
- ///
- ///
- ///
- public List GetDatesForPeriod(DateOnly startPeriod, DateOnly endPeriod)
- {
- var workDaysList = new List();
-
- var currentDay = startPeriod;
-
- while (currentDay <= endPeriod)
- {
- workDaysList.Add(currentDay);
- currentDay = currentDay.AddDays(1);
- }
-
- return workDaysList.OrderBy(t => t).ToList();
- }
-
- ///
- /// Возвращает список дней между датами
- ///
- ///
- ///
- ///
- public List GetDatesForPeriod(DateTimeOffset startPeriod, DateTimeOffset endPeriod)
- {
- return GetDatesForPeriod(DateOnly.FromDateTime(startPeriod.DateTime), DateOnly.FromDateTime(endPeriod.DateTime));
- }
-
-
- public DateTimeOffset GetDateWithTimeZoneOffset(DateTimeOffset date, int timeZoneOffsetHours)
- {
- return date.AddHours(timeZoneOffsetHours);
- }
-
- }
-}
diff --git a/PARR.BLL/Services/Implementations/TemplateMaskValidator.cs b/PARR.BLL/Services/Implementations/TemplateMaskValidator.cs
deleted file mode 100644
index 8c1882b1..00000000
--- a/PARR.BLL/Services/Implementations/TemplateMaskValidator.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using PARR.BLL.Services.Interfaces;
-using System.Text.RegularExpressions;
-
-namespace PARR.BLL.Services.Implementations
-{
- internal class TemplateMaskValidator : ITemplateMaskValidator
- {
- public bool IsValid(string mask)
- {
- if (!mask.Contains("ПАРР"))
- return false;
-
- var shortcodePattern = "%[^%\\s]+%";
- var shortcodesInMask = Regex.Matches(mask, shortcodePattern).ToList();
-
- if (shortcodesInMask.Count() == 0)
- return false;
-
- var validShortcodes = GetShortcodesNames();
-
- foreach (var shortcode in shortcodesInMask)
- {
- if (!validShortcodes.Contains(shortcode.ToString().ToUpper()))
- return false;
- }
-
- return true;
- }
-
- private List GetShortcodesNames()//TODO Ну ты опять этот метод дублируешь?!
- {
- var result = new List {
- "%ЭК%",
- "%ЗО%",
- "%РАБОТА%"
- };
-
- return result;
- }
- }
-}
diff --git a/PARR.BLL/Services/Interfaces/ICalendarService.cs b/PARR.BLL/Services/Interfaces/ICalendarService.cs
deleted file mode 100644
index 4d9e63a7..00000000
--- a/PARR.BLL/Services/Interfaces/ICalendarService.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using PARR.Domain.Enums;
-
-namespace PARR.BLL.Services.Interfaces
-{
- public delegate IQueryable GetWeekendsDelegate(DateOnly start, DateOnly end);
-
- public interface ICalendarService
- {
- ///
- /// Возвращает список дней между датами
- ///
- ///
- ///
- ///
- List GetDatesForPeriod(DateOnly startPeriod, DateOnly endPeriod);
-
- ///
- /// Возвращает список дней между датами
- ///
- ///
- ///
- ///
- List GetDatesForPeriod(DateTimeOffset startPeriod, DateTimeOffset endPeriod);
-
- ///
- /// Получить дату со смещенной часовой зоной
- ///
- ///
- ///
- ///
- DateTimeOffset GetDateWithTimeZoneOffset(DateTimeOffset date, int timeZoneOffsetHours);
- DateOnly GetEndPeriodDate(DateOnly startPeriod, DistributionPeriodTypeEnum periodType, string distributionPeriod);
-
- ///
- /// Получить только рабочие дни за период
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- List GetWorkDatesForPeriod(DateOnly startPeriod, TimeOnly refTime, DistributionPeriodTypeEnum periodType, string distributionPeriod, GetWeekendsDelegate getWeekends);
- }
-}
diff --git a/PARR.BLL/Services/Interfaces/ITemplateMaskValidator.cs b/PARR.BLL/Services/Interfaces/ITemplateMaskValidator.cs
deleted file mode 100644
index b61c5403..00000000
--- a/PARR.BLL/Services/Interfaces/ITemplateMaskValidator.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace PARR.BLL.Services.Interfaces
-{
- public interface ITemplateMaskValidator
- {
- bool IsValid(string mask);
- }
-}
diff --git a/PARR.BLL/Settings/StorageSettings.cs b/PARR.BLL/Settings/StorageSettings.cs
deleted file mode 100644
index c5c0ba24..00000000
--- a/PARR.BLL/Settings/StorageSettings.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-namespace PARR.BLL.Settings
-{
- public class StorageSettings
- {
- ///
- /// Путь к хранилищу
- ///
- public string StoragePath { get; set; } = string.Empty;
-
- ///
- /// Настройки хранилища загрузки шаблонов ЕСПП
- ///
- public StorageSettingsEsspTemplates? EsppTemplates { get; set; }
- }
-
- public class StorageSettingsEsspTemplates
- {
- public string[] TemplatePath => new string[] { "espp-templates" };
-
- public string[] AllowedExtensions { get; set; } = Array.Empty();
-
- public int MaxFileSizeMb { get; set; }
- }
-}
diff --git a/PARR.Common/DateResolver.cs b/PARR.Common/DateResolver.cs
deleted file mode 100644
index 5dd99b1c..00000000
--- a/PARR.Common/DateResolver.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-namespace PARR.Common
-{
- //TODO:!!! Удалить этот класс !!!
-
- ///
- /// Даты и часовые пояса
- ///
- public static class DateResolver
- {
- ///
- /// Это текущий день относительно часовой зоны МСК? Да - текущий, нет - следующий день.
- /// Так делаьб фуфуфу!!!
- /// смотри IsCurrentDayRelativeMskTime(int hour)
- ///
- /// Дата ЮТС
- ///
- public static bool IsCurrentDayRelativeMskTime(DateTimeOffset date)
- {
- // смотри IsCurrentDayRelativeMskTime(int hour)
- return IsCurrentDayRelativeMskTime(date.Hour);
- }
-
-
- ///
- /// Это текущий день относительно часовой зоны МСК? Да - текущий, нет - следующий день.
- ///
- /// Час
- ///
- public static bool IsCurrentDayRelativeMskTime(int hour)
- {
- //Так как в базе всё храним в UTC то время с 21 часа уже соответствует следующими суткам в календаре Москвы
-
- //TODO: Не надо так делать!!! НИКАДА!!!
- // нужно добавить к таймзоне ЮТС +3 часа, посчитать в МСК и потом обратно отнять 3 часа
-
- if (hour >= 21)
- return false;
-
- return true;
- }
- }
-}
diff --git a/PARR.Common/PARR.Common.csproj b/PARR.Common/PARR.Common.csproj
deleted file mode 100644
index cfadb03d..00000000
--- a/PARR.Common/PARR.Common.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- net7.0
- enable
- enable
-
-
-
diff --git a/PARR.Constants/PARR.Constants.csproj b/PARR.Constants/PARR.Constants.csproj
deleted file mode 100644
index cfadb03d..00000000
--- a/PARR.Constants/PARR.Constants.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- net7.0
- enable
- enable
-
-
-
diff --git a/PARR.BLL/Helpers/EsppScheduleHelpers.cs b/PARR.Core/Common/Helpers/EsppScheduleHelpers.cs
similarity index 100%
rename from PARR.BLL/Helpers/EsppScheduleHelpers.cs
rename to PARR.Core/Common/Helpers/EsppScheduleHelpers.cs
diff --git a/PARR.BLL/Helpers/SqlHelpers.cs b/PARR.Core/Common/Helpers/SqlHelpers.cs
similarity index 90%
rename from PARR.BLL/Helpers/SqlHelpers.cs
rename to PARR.Core/Common/Helpers/SqlHelpers.cs
index fc654e65..da7461ae 100644
--- a/PARR.BLL/Helpers/SqlHelpers.cs
+++ b/PARR.Core/Common/Helpers/SqlHelpers.cs
@@ -1,4 +1,4 @@
-namespace PARR.BLL.Helpers
+namespace PARR.Core.Common.Helpers
{
public static class SqlHelpers
{
diff --git a/PARR.BLL/Services/Implementations/TransformService.cs b/PARR.Core/Common/Implementations/TransformService.cs
similarity index 89%
rename from PARR.BLL/Services/Implementations/TransformService.cs
rename to PARR.Core/Common/Implementations/TransformService.cs
index 7d700b1c..df4bc947 100644
--- a/PARR.BLL/Services/Implementations/TransformService.cs
+++ b/PARR.Core/Common/Implementations/TransformService.cs
@@ -1,8 +1,8 @@
using Microsoft.Extensions.Logging;
-using PARR.BLL.Services.Interfaces;
+using PARR.Core.Common.Interfaces;
using System.Text.Json;
-namespace PARR.BLL.Services.Implementations
+namespace PARR.Core.Common.Implementations
{
internal class TransformService: ITransformService
{
diff --git a/PARR.DAL/InfluxDbServices/IInfluxDbService.cs b/PARR.Core/Common/Interfaces/IInfluxDbService.cs
similarity index 61%
rename from PARR.DAL/InfluxDbServices/IInfluxDbService.cs
rename to PARR.Core/Common/Interfaces/IInfluxDbService.cs
index 2a2611be..5a21fcdf 100644
--- a/PARR.DAL/InfluxDbServices/IInfluxDbService.cs
+++ b/PARR.Core/Common/Interfaces/IInfluxDbService.cs
@@ -1,10 +1,14 @@
using InfluxDB.Client;
-namespace PARR.DAL.InfluxDbServices
+namespace PARR.Core.Common.Interfaces
{
+ ///
+ /// Сервис взаимодействия с InfluxDb
+ ///
public interface IInfluxDbService
{
Task QueryAsync(Func> action, string token);
+
bool Write(Action action, string token);
}
}
diff --git a/PARR.Core/Common/IIntervalService.cs b/PARR.Core/Common/Interfaces/IIntervalService.cs
similarity index 93%
rename from PARR.Core/Common/IIntervalService.cs
rename to PARR.Core/Common/Interfaces/IIntervalService.cs
index 7feba9c4..a3eb1dde 100644
--- a/PARR.Core/Common/IIntervalService.cs
+++ b/PARR.Core/Common/Interfaces/IIntervalService.cs
@@ -1,4 +1,4 @@
-namespace PARR.Core.Common
+namespace PARR.Core.Common.Interfaces
{
//public delegate Task IntervalHandlerDelegate();
diff --git a/PARR.DAL/Cache/Services/Base/IRedisCacheService.cs b/PARR.Core/Common/Interfaces/IRedisCacheService.cs
similarity index 97%
rename from PARR.DAL/Cache/Services/Base/IRedisCacheService.cs
rename to PARR.Core/Common/Interfaces/IRedisCacheService.cs
index b1d06b6b..d8016821 100644
--- a/PARR.DAL/Cache/Services/Base/IRedisCacheService.cs
+++ b/PARR.Core/Common/Interfaces/IRedisCacheService.cs
@@ -1,5 +1,8 @@
-namespace PARR.DAL.Cache.Services.Base
+namespace PARR.Core.Common.Interfaces
{
+ ///
+ /// Сервис по управлению КЭШ
+ ///
public interface IRedisCacheService
{
///
diff --git a/PARR.BLL/Services/Interfaces/ITransformService.cs b/PARR.Core/Common/Interfaces/ITransformService.cs
similarity index 70%
rename from PARR.BLL/Services/Interfaces/ITransformService.cs
rename to PARR.Core/Common/Interfaces/ITransformService.cs
index d7fc45d0..c9a0a722 100644
--- a/PARR.BLL/Services/Interfaces/ITransformService.cs
+++ b/PARR.Core/Common/Interfaces/ITransformService.cs
@@ -1,4 +1,4 @@
-namespace PARR.BLL.Services.Interfaces
+namespace PARR.Core.Common.Interfaces
{
public interface ITransformService
{
diff --git a/PARR.Core/Common/RabbitServices/IRabbitAdminService.cs b/PARR.Core/Common/Interfaces/RabbitServices/IRabbitAdminService.cs
similarity index 92%
rename from PARR.Core/Common/RabbitServices/IRabbitAdminService.cs
rename to PARR.Core/Common/Interfaces/RabbitServices/IRabbitAdminService.cs
index 53cca091..c266e102 100644
--- a/PARR.Core/Common/RabbitServices/IRabbitAdminService.cs
+++ b/PARR.Core/Common/Interfaces/RabbitServices/IRabbitAdminService.cs
@@ -1,7 +1,7 @@
using PARR.Domain.DTOs.RabbitApi;
using PARR.Domain.Settings;
-namespace PARR.Core.Common.RabbitServices
+namespace PARR.Core.Common.Interfaces.RabbitServices
{
public interface IRabbitAdminService
{
diff --git a/PARR.Core/Common/RabbitServices/IRabbitService.cs b/PARR.Core/Common/Interfaces/RabbitServices/IRabbitService.cs
similarity index 95%
rename from PARR.Core/Common/RabbitServices/IRabbitService.cs
rename to PARR.Core/Common/Interfaces/RabbitServices/IRabbitService.cs
index bfda5a6b..05ef85d1 100644
--- a/PARR.Core/Common/RabbitServices/IRabbitService.cs
+++ b/PARR.Core/Common/Interfaces/RabbitServices/IRabbitService.cs
@@ -1,7 +1,7 @@
using PARR.Domain.Common.Rabbit;
using PARR.Domain.Settings;
-namespace PARR.Core.Common.RabbitServices
+namespace PARR.Core.Common.Interfaces.RabbitServices
{
public delegate Task MqMessageHandlerDelegate(string msg);
diff --git a/PARR.Core/DependencyInjection.cs b/PARR.Core/DependencyInjection.cs
index dcb197e5..db31ed37 100644
--- a/PARR.Core/DependencyInjection.cs
+++ b/PARR.Core/DependencyInjection.cs
@@ -1,6 +1,8 @@
using FluentValidation;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
+using PARR.Core.Common.Implementations;
+using PARR.Core.Common.Interfaces;
namespace PARR.Core
{
@@ -22,8 +24,19 @@ namespace PARR.Core
services.AddValidatorsFromAssembly(typeof(DependencyInjection).Assembly, includeInternalTypes: true);
// Регистрируем сревисы Core
+
+ #region Common
+
+ services.AddTransient();
+
+ #endregion
+
+ #region Services
+
//services.AddScoped();
+ #endregion
+
return services;
}
diff --git a/PARR.Core/PARR.Core.csproj b/PARR.Core/PARR.Core.csproj
index b742a2b0..aef64738 100644
--- a/PARR.Core/PARR.Core.csproj
+++ b/PARR.Core/PARR.Core.csproj
@@ -14,6 +14,7 @@
+
diff --git a/PARR.DAL/Context/DataContext.cs b/PARR.DAL/Context/DataContext.cs
index 5d6a4ae9..bf2b5b6b 100644
--- a/PARR.DAL/Context/DataContext.cs
+++ b/PARR.DAL/Context/DataContext.cs
@@ -1,5 +1,4 @@
using Microsoft.EntityFrameworkCore;
-using PARR.BLL.Domain;
using PARR.DAL.Contracts;
using PARR.DAL.Extensions;
using PARR.DAL.Models;
@@ -7,6 +6,7 @@ using PARR.DAL.Models.Job;
using PARR.DAL.Models.Schedule;
using PARR.DAL.Models.Unit;
using PARR.Domain.Common.Roles;
+using PARR.Domain.Common.Template;
using PARR.Domain.Entities.TaskEntities;
using PARR.Domain.Enums;
diff --git a/PARR.DAL/Contracts/SettingsFromDb.cs b/PARR.DAL/Contracts/SettingsFromDb.cs
index 178b0502..2177bc94 100644
--- a/PARR.DAL/Contracts/SettingsFromDb.cs
+++ b/PARR.DAL/Contracts/SettingsFromDb.cs
@@ -1,5 +1,5 @@
-using PARR.BLL.Domain;
-using PARR.DAL.Extensions;
+using PARR.DAL.Extensions;
+using PARR.Domain.Common.Template;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json;
diff --git a/PARR.DAL/DomainModels/MatchingStatus.cs b/PARR.DAL/DomainModels/MatchingStatus.cs
index 8e79e466..42732ab1 100644
--- a/PARR.DAL/DomainModels/MatchingStatus.cs
+++ b/PARR.DAL/DomainModels/MatchingStatus.cs
@@ -1,4 +1,4 @@
-using PARR.DAL.Cache.Models;
+using PARR.Domain.Cache.Models;
namespace PARR.DAL.DomainModels
{
diff --git a/PARR.DAL/DomainServices/Implementations/MatchingStatusService.cs b/PARR.DAL/DomainServices/Implementations/MatchingStatusService.cs
index 87aced32..60f8e9b7 100644
--- a/PARR.DAL/DomainServices/Implementations/MatchingStatusService.cs
+++ b/PARR.DAL/DomainServices/Implementations/MatchingStatusService.cs
@@ -1,9 +1,9 @@
using Microsoft.EntityFrameworkCore;
-using PARR.DAL.Cache.Models;
-using PARR.DAL.Cache.Services.Base;
+using PARR.Core.Common.Interfaces;
using PARR.DAL.DomainModels;
using PARR.DAL.DomainServices.Interfaces;
using PARR.DAL.Services.Interfaces.Job;
+using PARR.Domain.Cache.Models;
using PARR.Domain.Enums;
namespace PARR.DAL.DomainServices.Implementations
diff --git a/PARR.DAL/DomainServices/Interfaces/IMatchingStatusService.cs b/PARR.DAL/DomainServices/Interfaces/IMatchingStatusService.cs
index 4158e783..b2f11758 100644
--- a/PARR.DAL/DomainServices/Interfaces/IMatchingStatusService.cs
+++ b/PARR.DAL/DomainServices/Interfaces/IMatchingStatusService.cs
@@ -1,5 +1,5 @@
-using PARR.DAL.Cache.Models;
-using PARR.DAL.DomainModels;
+using PARR.DAL.DomainModels;
+using PARR.Domain.Cache.Models;
using PARR.Domain.Enums;
namespace PARR.DAL.DomainServices.Interfaces
diff --git a/PARR.DAL/DomainServices/Shortcodes/ShortcodesService.cs b/PARR.DAL/DomainServices/Shortcodes/ShortcodesService.cs
index 32305dbc..ffe9101c 100644
--- a/PARR.DAL/DomainServices/Shortcodes/ShortcodesService.cs
+++ b/PARR.DAL/DomainServices/Shortcodes/ShortcodesService.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
-using PARR.DAL.Cache.Services.Base;
+using PARR.Core.Common.Interfaces;
using PARR.DAL.Contracts;
using PARR.DAL.DomainModels;
using PARR.DAL.DomainServices.Shortcodes.Models;
@@ -10,6 +10,7 @@ using PARR.DAL.Models.Job;
using PARR.DAL.Services.Interfaces;
using PARR.DAL.Services.Interfaces.Job;
using PARR.DAL.Services.Interfaces.Unit;
+using PARR.Domain.Common.Template;
using PARR.Domain.Enums;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;
@@ -667,7 +668,7 @@ namespace PARR.DAL.DomainServices.Shortcodes
return input.Replace(shortcode, replacement, StringComparison.OrdinalIgnoreCase);
}
- private static string ReplaceConstants(List nameConstants, string resultName)
+ private static string ReplaceConstants(List nameConstants, string resultName)
{
foreach (var item in nameConstants)
resultName = resultName.Replace($"%{item.Name}%", item.Value);
diff --git a/PARR.DAL/DomainServices/UnitFilterService/UnitFilterService.cs b/PARR.DAL/DomainServices/UnitFilterService/UnitFilterService.cs
index 51eb2fce..2fccfc9b 100644
--- a/PARR.DAL/DomainServices/UnitFilterService/UnitFilterService.cs
+++ b/PARR.DAL/DomainServices/UnitFilterService/UnitFilterService.cs
@@ -1,14 +1,13 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
-using PARR.DAL.Cache.Models;
-using PARR.DAL.Cache.Services.Base;
-using PARR.DAL.Contracts;
+using PARR.Core.Common.Interfaces;
using PARR.DAL.DomainServices.UnitFilterService.Models;
using PARR.DAL.Models.Job;
using PARR.DAL.Models.Unit;
using PARR.DAL.Services.Interfaces.Job;
using PARR.DAL.Services.Interfaces.Unit;
+using PARR.Domain.Cache.Models;
using PARR.Domain.Enums;
using System.Diagnostics;
diff --git a/PARR.DAL/PARR.DAL.csproj b/PARR.DAL/PARR.DAL.csproj
index 95436011..0c9d0180 100644
--- a/PARR.DAL/PARR.DAL.csproj
+++ b/PARR.DAL/PARR.DAL.csproj
@@ -7,12 +7,10 @@
-
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
diff --git a/PARR.DAL/ParrDalInstaller.cs b/PARR.DAL/ParrDalInstaller.cs
index 967fcedf..afa66353 100644
--- a/PARR.DAL/ParrDalInstaller.cs
+++ b/PARR.DAL/ParrDalInstaller.cs
@@ -3,7 +3,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using PARR.Core.Repositories.Interfaces.TaskRepositories;
-using PARR.DAL.Cache.Services.Base;
using PARR.DAL.Configurations.DbSettings;
using PARR.DAL.Context;
using PARR.DAL.Contracts;
@@ -12,7 +11,6 @@ using PARR.DAL.DomainServices.Interfaces;
using PARR.DAL.DomainServices.Shortcodes;
using PARR.DAL.DomainServices.UnitFilterService;
using PARR.DAL.DomainServices.UnitFilterService.Models;
-using PARR.DAL.InfluxDbServices;
using PARR.DAL.NextRunServices;
using PARR.DAL.NextRunServices.Subservices;
using PARR.DAL.Repositories.TaskRepositories;
@@ -27,7 +25,6 @@ using PARR.DAL.Services.Interfaces.Schedule;
using PARR.DAL.Services.Interfaces.Unit;
using PARR.DAL.Settings;
using PARR.DAL.TaskServices;
-using StackExchange.Redis;
namespace PARR.DAL
{
@@ -54,36 +51,36 @@ namespace PARR.DAL
#region Redis + cache services
- services.AddSingleton(sp =>
- {
- // IConnectionMultiplexer - для нативных операций Redis
- var connectionString = configuration.GetConnectionString("RedisConnection");
- return ConnectionMultiplexer.Connect(connectionString);
- });
+ //services.AddSingleton(sp =>
+ //{
+ // // IConnectionMultiplexer - для нативных операций Redis
+ // var connectionString = configuration.GetConnectionString("RedisConnection");
+ // return ConnectionMultiplexer.Connect(connectionString);
+ //});
- services.AddStackExchangeRedisCache(opt =>
- {
- opt.Configuration = configuration.GetConnectionString("RedisConnection");
- });
+ //services.AddStackExchangeRedisCache(opt =>
+ //{
+ // opt.Configuration = configuration.GetConnectionString("RedisConnection");
+ //});
var groupedShortcodesCacheSettings = new GroupedShortcodesCacheSettings();
configuration.GetSection(nameof(GroupedShortcodesCacheSettings)).Bind(groupedShortcodesCacheSettings);
services.AddSingleton(groupedShortcodesCacheSettings);
- services.AddSingleton();
+ //services.AddSingleton();
#endregion
- #region InfluxDb
+ //#region InfluxDb
- var influxDbSettings = new InfluxDbSettings();
- configuration.GetSection(nameof(InfluxDbSettings)).Bind(influxDbSettings);
- services.AddSingleton(influxDbSettings);
+ //var influxDbSettings = new InfluxDbSettings();
+ //configuration.GetSection(nameof(InfluxDbSettings)).Bind(influxDbSettings);
+ //services.AddSingleton(influxDbSettings);
- services.AddTransient();
+ //services.AddTransient();
- #endregion
+ //#endregion
// Entity services
diff --git a/PARR.DAL/Services/Implementations/WeekendDayService.cs b/PARR.DAL/Services/Implementations/WeekendDayService.cs
index 88b4b02f..d02092aa 100644
--- a/PARR.DAL/Services/Implementations/WeekendDayService.cs
+++ b/PARR.DAL/Services/Implementations/WeekendDayService.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
-using PARR.DAL.Cache.Services.Base;
+using PARR.Core.Common.Interfaces;
using PARR.DAL.Context;
using PARR.DAL.Contracts;
using PARR.DAL.Models;
diff --git a/PARR.DAL/Cache/Models/Base/IBaseCache.cs b/PARR.Domain/Cache/Models/Base/IBaseCache.cs
similarity index 87%
rename from PARR.DAL/Cache/Models/Base/IBaseCache.cs
rename to PARR.Domain/Cache/Models/Base/IBaseCache.cs
index 1e9c1cbb..ea268a3b 100644
--- a/PARR.DAL/Cache/Models/Base/IBaseCache.cs
+++ b/PARR.Domain/Cache/Models/Base/IBaseCache.cs
@@ -1,4 +1,4 @@
-namespace PARR.DAL.Cache.Models.Base
+namespace PARR.Domain.Cache.Models.Base
{
///
/// Базовый интерфейс для КЭШ моделей
diff --git a/PARR.DAL/Cache/Models/MatchingStatusItem.cs b/PARR.Domain/Cache/Models/MatchingStatusItem.cs
similarity index 89%
rename from PARR.DAL/Cache/Models/MatchingStatusItem.cs
rename to PARR.Domain/Cache/Models/MatchingStatusItem.cs
index bae33a03..f430ad51 100644
--- a/PARR.DAL/Cache/Models/MatchingStatusItem.cs
+++ b/PARR.Domain/Cache/Models/MatchingStatusItem.cs
@@ -1,7 +1,7 @@
-using PARR.DAL.Cache.Models.Base;
+using PARR.Domain.Cache.Models.Base;
using PARR.Domain.Enums;
-namespace PARR.DAL.Cache.Models
+namespace PARR.Domain.Cache.Models
{
///
/// КЭШ модель, состояние matching`a
diff --git a/PARR.DAL/Cache/Models/UnitFilterIds.cs b/PARR.Domain/Cache/Models/UnitFilterIds.cs
similarity index 82%
rename from PARR.DAL/Cache/Models/UnitFilterIds.cs
rename to PARR.Domain/Cache/Models/UnitFilterIds.cs
index e37a010e..fbc06f5f 100644
--- a/PARR.DAL/Cache/Models/UnitFilterIds.cs
+++ b/PARR.Domain/Cache/Models/UnitFilterIds.cs
@@ -1,6 +1,6 @@
-using PARR.DAL.Cache.Models.Base;
+using PARR.Domain.Cache.Models.Base;
-namespace PARR.DAL.Cache.Models
+namespace PARR.Domain.Cache.Models
{
public class UnitFilterIds : IBaseCache
{
diff --git a/PARR.Domain/Common/Template/TemplateNameConstantPart.cs b/PARR.Domain/Common/Template/TemplateNameConstantPart.cs
new file mode 100644
index 00000000..aae9e39a
--- /dev/null
+++ b/PARR.Domain/Common/Template/TemplateNameConstantPart.cs
@@ -0,0 +1,11 @@
+namespace PARR.Domain.Common.Template
+{
+ ///
+ /// Модель хранения частей имени шаблона в настройках
+ ///
+ public class TemplateNameConstantPart
+ {
+ public required string Name { get; set; }
+ public required string Value { get; set; }
+ }
+}
diff --git a/PARR.DAL/Settings/InfluxDbSettings.cs b/PARR.Domain/Settings/InfluxDbSettings.cs
similarity index 86%
rename from PARR.DAL/Settings/InfluxDbSettings.cs
rename to PARR.Domain/Settings/InfluxDbSettings.cs
index fad300d6..5fec9ae3 100644
--- a/PARR.DAL/Settings/InfluxDbSettings.cs
+++ b/PARR.Domain/Settings/InfluxDbSettings.cs
@@ -1,5 +1,8 @@
-namespace PARR.DAL.Settings
+namespace PARR.Domain.Settings
{
+ ///
+ /// Настройки подключения к InfluxDb
+ ///
public class InfluxDbSettings
{
public string Url { get; set; } = string.Empty;
diff --git a/PARR.EsppOrderLoader/EsppOrderLoader.cs b/PARR.EsppOrderLoader/EsppOrderLoader.cs
index 571540f0..c496d96c 100644
--- a/PARR.EsppOrderLoader/EsppOrderLoader.cs
+++ b/PARR.EsppOrderLoader/EsppOrderLoader.cs
@@ -1,7 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
-using PARR.BLL.Services.Interfaces;
-using PARR.Core.Common;
+using PARR.Core.Common.Interfaces;
using PARR.DAL.Contracts;
using PARR.EsppApi;
using PARR.EsppApi.Models;
diff --git a/PARR.EsppOrderLoader/PARR.EsppOrderLoader.csproj b/PARR.EsppOrderLoader/PARR.EsppOrderLoader.csproj
index 74361878..effd3667 100644
--- a/PARR.EsppOrderLoader/PARR.EsppOrderLoader.csproj
+++ b/PARR.EsppOrderLoader/PARR.EsppOrderLoader.csproj
@@ -7,9 +7,9 @@
-
+
diff --git a/PARR.EsppOrderLoader/ParrEsppOrderLoaderInstaller.cs b/PARR.EsppOrderLoader/ParrEsppOrderLoaderInstaller.cs
index 9d4a82d5..4cbaddd1 100644
--- a/PARR.EsppOrderLoader/ParrEsppOrderLoaderInstaller.cs
+++ b/PARR.EsppOrderLoader/ParrEsppOrderLoaderInstaller.cs
@@ -1,10 +1,10 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using PARR.BLL;
using PARR.DAL;
using PARR.EsppApi;
using PARR.EsppOrderLoader.Services;
using PARR.EsppOrderLoader.Settings;
+using PARR.Infrastructure;
namespace PARR.EsppOrderLoader
{
@@ -12,9 +12,9 @@ namespace PARR.EsppOrderLoader
{
public static void InstallEsppOrderLoaderServices(this IServiceCollection services, IConfiguration configuration)
{
- services.InstallBllServices(configuration);
services.InstallDalServices(configuration);
services.InstallEsppApiServices(configuration);
+ services.AddInfrastructureServices(configuration);
var settings = new WorkerSettings();
configuration.GetSection(nameof(WorkerSettings)).Bind(settings);
diff --git a/PARR.EsppOrderLoaderWorker/Dockerfile b/PARR.EsppOrderLoaderWorker/Dockerfile
index 1602f060..90b21c80 100644
--- a/PARR.EsppOrderLoaderWorker/Dockerfile
+++ b/PARR.EsppOrderLoaderWorker/Dockerfile
@@ -8,12 +8,11 @@ WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.EsppOrderLoaderWorker/PARR.EsppOrderLoaderWorker.csproj", "PARR.EsppOrderLoaderWorker/"]
COPY ["PARR.EsppOrderLoader/PARR.EsppOrderLoader.csproj", "PARR.EsppOrderLoader/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
-COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
+COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.EsppApi/PARR.EsppApi.csproj", "PARR.EsppApi/"]
+COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
RUN dotnet restore "PARR.EsppOrderLoaderWorker/PARR.EsppOrderLoaderWorker.csproj"
COPY . .
WORKDIR "/src/PARR.EsppOrderLoaderWorker"
diff --git a/PARR.EsppOrderManager/EsppOrderManager.cs b/PARR.EsppOrderManager/EsppOrderManager.cs
index 667dc168..8575a297 100644
--- a/PARR.EsppOrderManager/EsppOrderManager.cs
+++ b/PARR.EsppOrderManager/EsppOrderManager.cs
@@ -1,8 +1,8 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
-using PARR.BLL.Services.Interfaces;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.DAL.Models;
using PARR.DAL.Services.Interfaces;
using PARR.Domain.Common.Rabbit.Messages;
diff --git a/PARR.EsppOrderManager/PARR.EsppOrderManager.csproj b/PARR.EsppOrderManager/PARR.EsppOrderManager.csproj
index 74361878..effd3667 100644
--- a/PARR.EsppOrderManager/PARR.EsppOrderManager.csproj
+++ b/PARR.EsppOrderManager/PARR.EsppOrderManager.csproj
@@ -7,9 +7,9 @@
-
+
diff --git a/PARR.EsppOrderManager/ParrEsppOrderManagerInstaller.cs b/PARR.EsppOrderManager/ParrEsppOrderManagerInstaller.cs
index 3da7a910..4211a028 100644
--- a/PARR.EsppOrderManager/ParrEsppOrderManagerInstaller.cs
+++ b/PARR.EsppOrderManager/ParrEsppOrderManagerInstaller.cs
@@ -1,10 +1,11 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using PARR.BLL;
+using PARR.Core;
using PARR.DAL;
using PARR.EsppApi;
using PARR.EsppOrderManager.Services;
using PARR.EsppOrderManager.Settings;
+using PARR.Infrastructure;
namespace PARR.EsppOrderManager
{
@@ -12,9 +13,10 @@ namespace PARR.EsppOrderManager
{
public static void InstallEsppOrderManagerServices(this IServiceCollection services, IConfiguration configuration)
{
- services.InstallBllServices(configuration);
services.InstallDalServices(configuration);
services.InstallEsppApiServices(configuration);
+ services.AddCoreServices(configuration);
+ services.AddInfrastructureServices(configuration);
var mqSettings = new MqSettings();
configuration.GetSection(nameof(MqSettings)).Bind(mqSettings);
diff --git a/PARR.EsppOrderManagerWorker/Dockerfile b/PARR.EsppOrderManagerWorker/Dockerfile
index 1913d3e7..1cc76fc7 100644
--- a/PARR.EsppOrderManagerWorker/Dockerfile
+++ b/PARR.EsppOrderManagerWorker/Dockerfile
@@ -8,12 +8,11 @@ WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.EsppOrderManagerWorker/PARR.EsppOrderManagerWorker.csproj", "PARR.EsppOrderManagerWorker/"]
COPY ["PARR.EsppOrderManager/PARR.EsppOrderManager.csproj", "PARR.EsppOrderManager/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
-COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
+COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.EsppApi/PARR.EsppApi.csproj", "PARR.EsppApi/"]
+COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
RUN dotnet restore "PARR.EsppOrderManagerWorker/PARR.EsppOrderManagerWorker.csproj"
COPY . .
WORKDIR "/src/PARR.EsppOrderManagerWorker"
diff --git a/PARR.EsppScheduleSync/EsppScheduleSyncInstaller.cs b/PARR.EsppScheduleSync/EsppScheduleSyncInstaller.cs
index 4a0e01a9..f02cab35 100644
--- a/PARR.EsppScheduleSync/EsppScheduleSyncInstaller.cs
+++ b/PARR.EsppScheduleSync/EsppScheduleSyncInstaller.cs
@@ -1,10 +1,11 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using PARR.BLL;
+using PARR.Core;
using PARR.DAL;
using PARR.EsppScheduleSync.Domain;
using PARR.EsppScheduleSync.Settings;
using PARR.EsppSync;
+using PARR.Infrastructure;
namespace PARR.EsppScheduleSync
{
@@ -12,8 +13,9 @@ namespace PARR.EsppScheduleSync
{
public static void InstallEsppScheduleSyncServices(this IServiceCollection services, IConfiguration configuration)
{
- services.InstallBllServices(configuration);
services.InstallEsppSyncServices(configuration);
+ services.AddCoreServices(configuration);
+ services.AddInfrastructureServices(configuration);
var globalSettings = new GlobalSettings();
configuration.GetSection(nameof(GlobalSettings)).Bind(globalSettings);
diff --git a/PARR.EsppScheduleSync/PARR.EsppScheduleSync.csproj b/PARR.EsppScheduleSync/PARR.EsppScheduleSync.csproj
index 81c8506a..6fe72632 100644
--- a/PARR.EsppScheduleSync/PARR.EsppScheduleSync.csproj
+++ b/PARR.EsppScheduleSync/PARR.EsppScheduleSync.csproj
@@ -7,9 +7,9 @@
-
+
diff --git a/PARR.EsppScheduleSync/ScheduleSyncher.cs b/PARR.EsppScheduleSync/ScheduleSyncher.cs
index 668bfb3c..faa1124b 100644
--- a/PARR.EsppScheduleSync/ScheduleSyncher.cs
+++ b/PARR.EsppScheduleSync/ScheduleSyncher.cs
@@ -2,7 +2,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using PARR.BLL.Helpers;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.DAL.Contracts;
using PARR.DAL.Models;
using PARR.DAL.NextRunServices;
diff --git a/PARR.EsppScheduleSyncWorker/Dockerfile b/PARR.EsppScheduleSyncWorker/Dockerfile
index b2712905..9c20332e 100644
--- a/PARR.EsppScheduleSyncWorker/Dockerfile
+++ b/PARR.EsppScheduleSyncWorker/Dockerfile
@@ -8,12 +8,11 @@ WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.EsppScheduleSyncWorker/PARR.EsppScheduleSyncWorker.csproj", "PARR.EsppScheduleSyncWorker/"]
COPY ["PARR.EsppScheduleSync/PARR.EsppScheduleSync.csproj", "PARR.EsppScheduleSync/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
-COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
+COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.EsppSync/PARR.EsppSync.csproj", "PARR.EsppSync/"]
+COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
RUN dotnet restore "PARR.EsppScheduleSyncWorker/PARR.EsppScheduleSyncWorker.csproj"
COPY . .
WORKDIR "/src/PARR.EsppScheduleSyncWorker"
diff --git a/PARR.EsppTemplateSync/EsppTemplateSyncInstaller.cs b/PARR.EsppTemplateSync/EsppTemplateSyncInstaller.cs
index e0dbdd9f..9c0a8142 100644
--- a/PARR.EsppTemplateSync/EsppTemplateSyncInstaller.cs
+++ b/PARR.EsppTemplateSync/EsppTemplateSyncInstaller.cs
@@ -1,10 +1,11 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using PARR.BLL;
+using PARR.Core;
using PARR.DAL;
using PARR.EsppSync;
using PARR.EsppTemplateSync.Domain;
using PARR.EsppTemplateSync.Settings;
+using PARR.Infrastructure;
namespace PARR.EsppTemplateSync
{
@@ -13,8 +14,9 @@ namespace PARR.EsppTemplateSync
public static void InstallEsppTemplateSyncServices(this IServiceCollection services, IConfiguration configuration)
{
services.InstallDalServices(configuration);
- services.InstallBllServices(configuration);
services.InstallEsppSyncServices(configuration);
+ services.AddCoreServices(configuration);
+ services.AddInfrastructureServices(configuration);
var globalSettings = new GlobalSettings();
configuration.GetSection(nameof(GlobalSettings)).Bind(globalSettings);
diff --git a/PARR.EsppTemplateSync/PARR.EsppTemplateSync.csproj b/PARR.EsppTemplateSync/PARR.EsppTemplateSync.csproj
index 56c2b3ea..279a46e0 100644
--- a/PARR.EsppTemplateSync/PARR.EsppTemplateSync.csproj
+++ b/PARR.EsppTemplateSync/PARR.EsppTemplateSync.csproj
@@ -11,9 +11,10 @@
-
+
+
diff --git a/PARR.EsppTemplateSync/TemplateFileSyncer.cs b/PARR.EsppTemplateSync/TemplateFileSyncer.cs
deleted file mode 100644
index 05e056a8..00000000
--- a/PARR.EsppTemplateSync/TemplateFileSyncer.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-using Microsoft.Extensions.Logging;
-using PARR.BLL.Services.Interfaces;
-using PARR.EsppTemplateSync.Settings;
-
-namespace PARR.EsppTemplateSync
-{
- internal class TemplateFileSyncer : ITemplateSyncer
- {
- private readonly ILogger logger;
- //private readonly IFileService fileService;
- private readonly GlobalSettings globalSettings;
- //private readonly IManager manager;
- private readonly string dirPath;
- private readonly string filterExtensions;
-
- //private FileSystemWatcher? watcher;
-
- public TemplateFileSyncer(
- BLL.Settings.StorageSettings storageSettings,
- ILogger logger,
- //IFileService fileService,
- GlobalSettings globalSettings//,
- // IManager manager
- )
- {
- this.logger = logger;
- //this.fileService = fileService;
- this.globalSettings = globalSettings;
- //this.manager = manager;
- if (storageSettings.EsppTemplates == null)
- {
- logger.LogError("Нет секции настроек хранилища. StorageSettings, EsppTemplates");
- throw new Exception("Нет секции настроек хранилища. StorageSettings, EsppTemplates");
- }
-
- string dirPath = Path.Combine(storageSettings.EsppTemplates.TemplatePath);
- this.dirPath = Path.Combine(storageSettings.StoragePath, dirPath);
-
- filterExtensions = string.Join(",", storageSettings.EsppTemplates!.AllowedExtensions).Replace(".", "*.");
- }
-
- public void StartAsync()
- {
- //смотрим, доступна ли папка
- if (!Directory.Exists(dirPath))
- {
- logger.LogError($"Не найдена папка: {dirPath}.");
- throw new Exception($"Не найдена папка: {dirPath}.");
- }
-
- logger.LogInformation($"Запущена проверка директории. Интервал: {globalSettings.StorageSettings!.CheckIntervalSeconds} секунд. Фильтр: {filterExtensions}");
-
- while (true)
- {
- //todo: new Task() ->
- //await GetFilesAsync();
- //await Task.Delay(globalSettings.StorageSettings!.CheckIntervalSeconds * 1000);
- }
-
-
- // сначала обрабатываем существующие файлы, до тех пор пока все не обработаем
- // после обработки всех файлов, запускаем вотчер
- //await GetFilesAsync();
-
- // код ниже, это то что надо использовать, но в доккере не работает watcher
- ////--- watcher
- //watcher = new FileSystemWatcher(dirPath);
- //watcher.NotifyFilter = NotifyFilters.FileName;
- ////watcher.Changed += OnChanged;
- ////todo: тут await???
- //watcher.Created += OnChanged;
-
- //watcher.Filter = filterExtensions;
- //watcher.EnableRaisingEvents = true;
- //watcher.IncludeSubdirectories = false;
-
- ////=== watcher
-
- //logger.LogInformation($"--- --- --- FileWatcher запущен --- --- ---");
- }
-
-
- public void StopAsync()
- {
- //watcher?.Dispose();
- logger.LogInformation($"=== === === FileWatcher остановлен === === ===");
- }
-
- //private async void OnChanged(object sender, FileSystemEventArgs e)
- //{
- // var path = e.FullPath;
- // await ParseFileAsync(path);
- //}
-
- private async Task GetFilesAsync()
- {
- // обрабатываем существующие файлы
- var files = Directory.GetFiles(this.dirPath, filterExtensions);
-
- //logger.LogInformation($"Запуск первоначальной загрузки файлов после старта сервиса. (До старта вотчера). Найдено файлов: {files.Length} шт.");
- logger.LogInformation($"Найдено файлов: {files.Length} шт.");
-
- foreach (var file in files)
- {
- if (File.Exists(file))
- await ParseFileAsync(file);
- else
- logger.LogInformation($"Файл не найден: {file}");
- }
-
-
- //если были файлы, запустим еще раз ручную обработку, вдруг за это время еще загрузили, а вотчер еще не был запущен
- //запускаем до тех пор, пока не останется необработанных файлов
- //if (files.Any())
- // await GetFilesAsync();
- }
-
-
- private async Task ParseFileAsync(string path)
- {
- logger.LogInformation($"--- --- Найден файл. Готов для парсинга {path} --- ---");
- //var parseResult = await manager.ManageFileAsync(path);//parserService.ParseFileAsync(path);
-
- //if (parseResult)
- //{
- // logger.LogInformation($"Парсинг успешно завершен. Удаляю файл {path}");
- // var removeResult = fileService.DeleteFile(path);
- //}
- //else
- //{
- // logger.LogError($"Парсинг завершен c ошибкой. Файл не удален {path}");
- //}
- }
-
- Task ITemplateSyncer.StartAsync()
- {
- throw new NotImplementedException();
- }
-
- Task ITemplateSyncer.StopAsync()
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/PARR.EsppTemplateSync/TemplateMQSyncer.cs b/PARR.EsppTemplateSync/TemplateMQSyncer.cs
index 30446b5f..987eec3b 100644
--- a/PARR.EsppTemplateSync/TemplateMQSyncer.cs
+++ b/PARR.EsppTemplateSync/TemplateMQSyncer.cs
@@ -1,5 +1,5 @@
using Microsoft.Extensions.Logging;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.DAL.Contracts;
using PARR.DAL.Models;
using PARR.EsppSync;
diff --git a/PARR.EsppTemplateSyncWorker/Dockerfile b/PARR.EsppTemplateSyncWorker/Dockerfile
index 76e62728..5a379576 100644
--- a/PARR.EsppTemplateSyncWorker/Dockerfile
+++ b/PARR.EsppTemplateSyncWorker/Dockerfile
@@ -8,12 +8,11 @@ WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.EsppTemplateSyncWorker/PARR.EsppTemplateSyncWorker.csproj", "PARR.EsppTemplateSyncWorker/"]
COPY ["PARR.EsppTemplateSync/PARR.EsppTemplateSync.csproj", "PARR.EsppTemplateSync/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
+COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
-COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
COPY ["PARR.EsppSync/PARR.EsppSync.csproj", "PARR.EsppSync/"]
+COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
RUN dotnet restore "PARR.EsppTemplateSyncWorker/PARR.EsppTemplateSyncWorker.csproj"
COPY . .
WORKDIR "/src/PARR.EsppTemplateSyncWorker"
diff --git a/PARR.Infrastructure/DependencyInjection.cs b/PARR.Infrastructure/DependencyInjection.cs
index cd8ae3d7..088db4e3 100644
--- a/PARR.Infrastructure/DependencyInjection.cs
+++ b/PARR.Infrastructure/DependencyInjection.cs
@@ -1,9 +1,13 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using PARR.Core.Common;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces;
+using PARR.Core.Common.Interfaces.RabbitServices;
+using PARR.DAL.InfluxDbServices;
+using PARR.Domain.Settings;
using PARR.Infrastructure.Interval;
using PARR.Infrastructure.Rabbit;
+using PARR.Infrastructure.Redis;
+using StackExchange.Redis;
namespace PARR.Infrastructure
{
@@ -19,11 +23,49 @@ namespace PARR.Infrastructure
{
// тут регистрируем все внешние сервисы, Rabbit, Redis, Email...
+ #region Rabbit
+
services.AddHttpClient();
services.AddTransient();
+ #endregion
+
+ #region Interval
+
services.AddTransient();
+ #endregion
+
+ #region Redis
+
+ services.AddSingleton(sp =>
+ {
+ // IConnectionMultiplexer - для нативных операций Redis
+ var connectionString = configuration.GetConnectionString("RedisConnection");
+ return ConnectionMultiplexer.Connect(connectionString);
+ });
+
+ services.AddStackExchangeRedisCache(opt =>
+ {
+ opt.Configuration = configuration.GetConnectionString("RedisConnection");
+ });
+
+ services.AddSingleton();
+
+ #endregion
+
+
+ #region InfluxDb
+
+ var influxDbSettings = new InfluxDbSettings();
+ configuration.GetSection(nameof(InfluxDbSettings)).Bind(influxDbSettings);
+ services.AddSingleton(influxDbSettings);
+
+ services.AddTransient();
+
+ #endregion
+
+
//services.AddTransient();
//services.AddTransient();
////Redis (singleton)
diff --git a/PARR.DAL/InfluxDbServices/InfluxDbService.cs b/PARR.Infrastructure/InfluxDb/InfluxDbService.cs
similarity index 96%
rename from PARR.DAL/InfluxDbServices/InfluxDbService.cs
rename to PARR.Infrastructure/InfluxDb/InfluxDbService.cs
index 901c4123..b319cfeb 100644
--- a/PARR.DAL/InfluxDbServices/InfluxDbService.cs
+++ b/PARR.Infrastructure/InfluxDb/InfluxDbService.cs
@@ -1,6 +1,7 @@
using InfluxDB.Client;
using Microsoft.Extensions.Logging;
-using PARR.DAL.Settings;
+using PARR.Core.Common.Interfaces;
+using PARR.Domain.Settings;
namespace PARR.DAL.InfluxDbServices
{
diff --git a/PARR.Infrastructure/Interval/IntervalService.cs b/PARR.Infrastructure/Interval/IntervalService.cs
index 2493b198..0e8d5aea 100644
--- a/PARR.Infrastructure/Interval/IntervalService.cs
+++ b/PARR.Infrastructure/Interval/IntervalService.cs
@@ -1,5 +1,5 @@
using Microsoft.Extensions.Logging;
-using PARR.Core.Common;
+using PARR.Core.Common.Interfaces;
namespace PARR.Infrastructure.Interval
{
diff --git a/PARR.Infrastructure/PARR.Infrastructure.csproj b/PARR.Infrastructure/PARR.Infrastructure.csproj
index 8d9de693..303ef51b 100644
--- a/PARR.Infrastructure/PARR.Infrastructure.csproj
+++ b/PARR.Infrastructure/PARR.Infrastructure.csproj
@@ -7,7 +7,9 @@
+
+
diff --git a/PARR.Infrastructure/Rabbit/RabbitAdminService.cs b/PARR.Infrastructure/Rabbit/RabbitAdminService.cs
index 960ae084..4ecd9604 100644
--- a/PARR.Infrastructure/Rabbit/RabbitAdminService.cs
+++ b/PARR.Infrastructure/Rabbit/RabbitAdminService.cs
@@ -1,5 +1,5 @@
using Microsoft.Extensions.Logging;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.Domain.DTOs.RabbitApi;
using PARR.Domain.Settings;
using System.Net;
diff --git a/PARR.Infrastructure/Rabbit/RabbitService.cs b/PARR.Infrastructure/Rabbit/RabbitService.cs
index ec9d7c35..7c3ed030 100644
--- a/PARR.Infrastructure/Rabbit/RabbitService.cs
+++ b/PARR.Infrastructure/Rabbit/RabbitService.cs
@@ -1,5 +1,5 @@
using Microsoft.Extensions.Logging;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.Domain.Common.Rabbit;
using PARR.Domain.Settings;
using RabbitMQ.Client;
diff --git a/PARR.DAL/Cache/Services/Base/RedisCacheService.cs b/PARR.Infrastructure/Redis/RedisCacheService.cs
similarity index 98%
rename from PARR.DAL/Cache/Services/Base/RedisCacheService.cs
rename to PARR.Infrastructure/Redis/RedisCacheService.cs
index 42f89183..451eb0d9 100644
--- a/PARR.DAL/Cache/Services/Base/RedisCacheService.cs
+++ b/PARR.Infrastructure/Redis/RedisCacheService.cs
@@ -1,8 +1,9 @@
using Microsoft.Extensions.Caching.Distributed;
+using PARR.Core.Common.Interfaces;
using StackExchange.Redis;
using System.Text.Json;
-namespace PARR.DAL.Cache.Services.Base
+namespace PARR.Infrastructure.Redis
{
internal class RedisCacheService : IRedisCacheService
{
diff --git a/PARR.JobAutoControl/JobAutoControlInstaller.cs b/PARR.JobAutoControl/JobAutoControlInstaller.cs
index 44599664..d0fb0a27 100644
--- a/PARR.JobAutoControl/JobAutoControlInstaller.cs
+++ b/PARR.JobAutoControl/JobAutoControlInstaller.cs
@@ -1,7 +1,8 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using PARR.BLL;
+using PARR.Core;
using PARR.DAL;
+using PARR.Infrastructure;
using PARR.JobAutoControl.Settings;
namespace PARR.JobAutoControl
@@ -12,7 +13,8 @@ namespace PARR.JobAutoControl
public static void InstallJobAutoControlServices(this IServiceCollection services, IConfiguration configuration)
{
services.InstallDalServices(configuration);
- services.InstallBllServices(configuration);
+ services.AddCoreServices(configuration);
+ services.AddInfrastructureServices(configuration);
var settings = new WorkerSettings();
configuration.GetSection(nameof(WorkerSettings)).Bind(settings);
diff --git a/PARR.JobAutoControl/JobAutoControlManager.cs b/PARR.JobAutoControl/JobAutoControlManager.cs
index 0aa6b280..40d60602 100644
--- a/PARR.JobAutoControl/JobAutoControlManager.cs
+++ b/PARR.JobAutoControl/JobAutoControlManager.cs
@@ -1,9 +1,8 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
-using PARR.BLL.Services.Interfaces;
-using PARR.Core.Common;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.DAL.Services.Interfaces.Job;
using PARR.Domain.Common.Rabbit.Messages;
using PARR.Domain.Entities.Base.History;
diff --git a/PARR.JobAutoControl/PARR.JobAutoControl.csproj b/PARR.JobAutoControl/PARR.JobAutoControl.csproj
index 21190861..e8ef522a 100644
--- a/PARR.JobAutoControl/PARR.JobAutoControl.csproj
+++ b/PARR.JobAutoControl/PARR.JobAutoControl.csproj
@@ -7,8 +7,9 @@
-
+
+
diff --git a/PARR.JobAutoControlWorker/Dockerfile b/PARR.JobAutoControlWorker/Dockerfile
index 9d5057e3..814557a4 100644
--- a/PARR.JobAutoControlWorker/Dockerfile
+++ b/PARR.JobAutoControlWorker/Dockerfile
@@ -12,11 +12,10 @@ WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.JobAutoControlWorker/PARR.JobAutoControlWorker.csproj", "PARR.JobAutoControlWorker/"]
COPY ["PARR.JobAutoControl/PARR.JobAutoControl.csproj", "PARR.JobAutoControl/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
+COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
-COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
+COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
RUN dotnet restore "./PARR.JobAutoControlWorker/PARR.JobAutoControlWorker.csproj"
COPY . .
WORKDIR "/src/PARR.JobAutoControlWorker"
diff --git a/PARR.Master/Master.cs b/PARR.Master/Master.cs
index d0f6cd92..a1051b95 100644
--- a/PARR.Master/Master.cs
+++ b/PARR.Master/Master.cs
@@ -1,7 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
-using PARR.BLL.Services.Interfaces;
-using PARR.Core.Common;
+using PARR.Core.Common.Interfaces;
using PARR.Master.Services;
using PARR.Master.Settings;
diff --git a/PARR.Master/PARR.Master.csproj b/PARR.Master/PARR.Master.csproj
index 21190861..e8ef522a 100644
--- a/PARR.Master/PARR.Master.csproj
+++ b/PARR.Master/PARR.Master.csproj
@@ -7,8 +7,9 @@
-
+
+
diff --git a/PARR.Master/ParrMasterInstaller.cs b/PARR.Master/ParrMasterInstaller.cs
index a6c150c1..6356087c 100644
--- a/PARR.Master/ParrMasterInstaller.cs
+++ b/PARR.Master/ParrMasterInstaller.cs
@@ -1,7 +1,8 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using PARR.BLL;
+using PARR.Core;
using PARR.DAL;
+using PARR.Infrastructure;
using PARR.Master.Services;
using PARR.Master.Settings;
@@ -11,8 +12,9 @@ namespace PARR.Master
{
public static void InstallMasterServices(this IServiceCollection services, IConfiguration configuration)
{
- services.InstallBllServices(configuration);
services.InstallDalServices(configuration);
+ services.AddCoreServices(configuration);
+ services.AddInfrastructureServices(configuration);
var settings = new WorkerSettings();
configuration.GetSection(nameof(WorkerSettings)).Bind(settings);
diff --git a/PARR.Master/Services/OrderMasterService.cs b/PARR.Master/Services/OrderMasterService.cs
index 9d62e2a1..1f2c81a4 100644
--- a/PARR.Master/Services/OrderMasterService.cs
+++ b/PARR.Master/Services/OrderMasterService.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.DAL.Models;
using PARR.DAL.Services.Interfaces;
using PARR.Domain.Common.Rabbit.Messages;
diff --git a/PARR.MasterWorker/Dockerfile b/PARR.MasterWorker/Dockerfile
index 1b83a507..a7f545fc 100644
--- a/PARR.MasterWorker/Dockerfile
+++ b/PARR.MasterWorker/Dockerfile
@@ -8,11 +8,10 @@ WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.MasterWorker/PARR.MasterWorker.csproj", "PARR.MasterWorker/"]
COPY ["PARR.Master/PARR.Master.csproj", "PARR.Master/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
+COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
-COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
+COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
RUN dotnet restore "PARR.MasterWorker/PARR.MasterWorker.csproj"
COPY . .
WORKDIR "/src/PARR.MasterWorker"
diff --git a/PARR.NextRun/NextRunInstaller.cs b/PARR.NextRun/NextRunInstaller.cs
index fd3f04d5..5ea0c396 100644
--- a/PARR.NextRun/NextRunInstaller.cs
+++ b/PARR.NextRun/NextRunInstaller.cs
@@ -1,6 +1,5 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using PARR.BLL;
using PARR.Core;
using PARR.DAL;
using PARR.Infrastructure;
@@ -13,9 +12,7 @@ namespace PARR.NextRun
{
public static void InstallNextRunServices(this IServiceCollection services, IConfiguration configuration)
{
- services.InstallBllServices(configuration);
services.InstallDalServices(configuration);
-
services.AddCoreServices(configuration);
services.AddInfrastructureServices(configuration);
diff --git a/PARR.NextRun/NextRunIntervalService.cs b/PARR.NextRun/NextRunIntervalService.cs
index 557b6289..9c5582df 100644
--- a/PARR.NextRun/NextRunIntervalService.cs
+++ b/PARR.NextRun/NextRunIntervalService.cs
@@ -1,7 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
-using PARR.BLL.Services.Interfaces;
-using PARR.Core.Common;
+using PARR.Core.Common.Interfaces;
using PARR.Domain.Entities.Base.History;
using PARR.Domain.Enums;
using PARR.NextRun.Services;
diff --git a/PARR.NextRun/NextRunRabbitService.cs b/PARR.NextRun/NextRunRabbitService.cs
index 7de0d813..f2e454b7 100644
--- a/PARR.NextRun/NextRunRabbitService.cs
+++ b/PARR.NextRun/NextRunRabbitService.cs
@@ -1,8 +1,8 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
-using PARR.BLL.Services.Interfaces;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.DAL.Services.Interfaces.Job;
using PARR.Domain.Common.Rabbit.Messages;
using PARR.NextRun.Services;
diff --git a/PARR.NextRun/PARR.NextRun.csproj b/PARR.NextRun/PARR.NextRun.csproj
index 21a28b32..fe01bb25 100644
--- a/PARR.NextRun/PARR.NextRun.csproj
+++ b/PARR.NextRun/PARR.NextRun.csproj
@@ -7,8 +7,6 @@
-
-
diff --git a/PARR.NextRunWorker/Dockerfile b/PARR.NextRunWorker/Dockerfile
index 64b231ef..707492f8 100644
--- a/PARR.NextRunWorker/Dockerfile
+++ b/PARR.NextRunWorker/Dockerfile
@@ -9,11 +9,10 @@ WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.NextRunWorker/PARR.NextRunWorker.csproj", "PARR.NextRunWorker/"]
COPY ["PARR.NextRun/PARR.NextRun.csproj", "PARR.NextRun/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
-COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
+COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
+COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
RUN dotnet restore "./PARR.NextRunWorker/./PARR.NextRunWorker.csproj"
COPY . .
WORKDIR "/src/PARR.NextRunWorker"
diff --git a/PARR.TemplateActivator/MqTemplateActivator.cs b/PARR.TemplateActivator/MqTemplateActivator.cs
index d515a131..1e5b3fee 100644
--- a/PARR.TemplateActivator/MqTemplateActivator.cs
+++ b/PARR.TemplateActivator/MqTemplateActivator.cs
@@ -1,7 +1,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
-using PARR.BLL.Services.Interfaces;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.Domain.Common.Rabbit.Messages;
namespace PARR.TemplateActivator;
diff --git a/PARR.TemplateActivator/PARR.TemplateActivator.csproj b/PARR.TemplateActivator/PARR.TemplateActivator.csproj
index 21190861..e8ef522a 100644
--- a/PARR.TemplateActivator/PARR.TemplateActivator.csproj
+++ b/PARR.TemplateActivator/PARR.TemplateActivator.csproj
@@ -7,8 +7,9 @@
-
+
+
diff --git a/PARR.TemplateActivator/TemplateActivatorInstaller.cs b/PARR.TemplateActivator/TemplateActivatorInstaller.cs
index 2186222f..4f8b745f 100644
--- a/PARR.TemplateActivator/TemplateActivatorInstaller.cs
+++ b/PARR.TemplateActivator/TemplateActivatorInstaller.cs
@@ -1,7 +1,8 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using PARR.BLL;
+using PARR.Core;
using PARR.DAL;
+using PARR.Infrastructure;
namespace PARR.TemplateActivator;
@@ -10,8 +11,9 @@ public static class TemplateActivatorInstaller
public static void InstallTemplateActivatorSerivces(this IServiceCollection services, IConfiguration configuration)
{
- services.InstallBllServices(configuration);
services.InstallDalServices(configuration);
+ services.AddCoreServices(configuration);
+ services.AddInfrastructureServices(configuration);
var mqSettings = new MqSettings();
configuration.GetSection(nameof(MqSettings)).Bind(mqSettings);
diff --git a/PARR.TemplateActivatorWorker/Dockerfile b/PARR.TemplateActivatorWorker/Dockerfile
index 3e3324a5..4cb3f451 100644
--- a/PARR.TemplateActivatorWorker/Dockerfile
+++ b/PARR.TemplateActivatorWorker/Dockerfile
@@ -9,11 +9,10 @@ WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.TemplateActivatorWorker/PARR.TemplateActivatorWorker.csproj", "PARR.TemplateActivatorWorker/"]
COPY ["PARR.TemplateActivator/PARR.TemplateActivator.csproj", "PARR.TemplateActivator/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
+COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
-COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
+COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
RUN dotnet restore "./PARR.TemplateActivatorWorker/PARR.TemplateActivatorWorker.csproj"
COPY . .
WORKDIR "/src/PARR.TemplateActivatorWorker"
diff --git a/PARR.TemplateDistributor/MqTemplateDistributor.cs b/PARR.TemplateDistributor/MqTemplateDistributor.cs
index ed7242ce..9ee9a475 100644
--- a/PARR.TemplateDistributor/MqTemplateDistributor.cs
+++ b/PARR.TemplateDistributor/MqTemplateDistributor.cs
@@ -1,7 +1,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
-using PARR.BLL.Services.Interfaces;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.Domain.Common.Rabbit.Messages;
using PARR.TemplateDistributor.Services;
using PARR.TemplateDistributor.Settings;
diff --git a/PARR.TemplateDistributor/PARR.TemplateDistributor.csproj b/PARR.TemplateDistributor/PARR.TemplateDistributor.csproj
index 21190861..e8ef522a 100644
--- a/PARR.TemplateDistributor/PARR.TemplateDistributor.csproj
+++ b/PARR.TemplateDistributor/PARR.TemplateDistributor.csproj
@@ -7,8 +7,9 @@
-
+
+
diff --git a/PARR.TemplateDistributor/TemplateDistributorInstaller.cs b/PARR.TemplateDistributor/TemplateDistributorInstaller.cs
index 1e506db1..7e2aec2b 100644
--- a/PARR.TemplateDistributor/TemplateDistributorInstaller.cs
+++ b/PARR.TemplateDistributor/TemplateDistributorInstaller.cs
@@ -1,7 +1,8 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using PARR.BLL;
+using PARR.Core;
using PARR.DAL;
+using PARR.Infrastructure;
using PARR.TemplateDistributor.Services;
using PARR.TemplateDistributor.Settings;
@@ -11,8 +12,9 @@ namespace PARR.TemplateDistributor
{
public static void InstallTemplateDistributorSerivces(this IServiceCollection services, IConfiguration configuration)
{
- services.InstallBllServices(configuration);
services.InstallDalServices(configuration);
+ services.AddCoreServices(configuration);
+ services.AddInfrastructureServices(configuration);
var mqSettings = new MqSettings();
configuration.GetSection(nameof(MqSettings)).Bind(mqSettings);
@@ -20,7 +22,7 @@ namespace PARR.TemplateDistributor
services.AddTransient();
services.AddTransient();
- services.AddTransient();
+ services.AddTransient();
}
public static IConfigurationBuilder AddTemplateDistributorConfigurations(this IConfigurationBuilder builder, IServiceCollection services)
diff --git a/PARR.TemplateDistributorWorker/Dockerfile b/PARR.TemplateDistributorWorker/Dockerfile
index 57c23d39..cb65aa2b 100644
--- a/PARR.TemplateDistributorWorker/Dockerfile
+++ b/PARR.TemplateDistributorWorker/Dockerfile
@@ -9,11 +9,10 @@ WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.TemplateDistributorWorker/PARR.TemplateDistributorWorker.csproj", "PARR.TemplateDistributorWorker/"]
COPY ["PARR.TemplateDistributor/PARR.TemplateDistributor.csproj", "PARR.TemplateDistributor/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
+COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
-COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
+COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
RUN dotnet restore "./PARR.TemplateDistributorWorker/PARR.TemplateDistributorWorker.csproj"
COPY . .
WORKDIR "/src/PARR.TemplateDistributorWorker"
diff --git a/PARR.TemplateGeneratorWorker/Dockerfile b/PARR.TemplateGeneratorWorker/Dockerfile
index f080229a..2c69f096 100644
--- a/PARR.TemplateGeneratorWorker/Dockerfile
+++ b/PARR.TemplateGeneratorWorker/Dockerfile
@@ -11,11 +11,10 @@ ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.TemplateGeneratorWorker/PARR.TemplateGeneratorWorker.csproj", "PARR.TemplateGeneratorWorker/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
+COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
-COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
+COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
RUN dotnet restore "./PARR.TemplateGeneratorWorker/PARR.TemplateGeneratorWorker.csproj"
COPY . .
WORKDIR "/src/PARR.TemplateGeneratorWorker"
diff --git a/PARR.TemplateGeneratorWorker/PARR.TemplateGeneratorWorker.csproj b/PARR.TemplateGeneratorWorker/PARR.TemplateGeneratorWorker.csproj
index 3d16e5a9..ba188d68 100644
--- a/PARR.TemplateGeneratorWorker/PARR.TemplateGeneratorWorker.csproj
+++ b/PARR.TemplateGeneratorWorker/PARR.TemplateGeneratorWorker.csproj
@@ -19,7 +19,8 @@
-
+
+
diff --git a/PARR.TemplateGeneratorWorker/TemplateGenerator.cs b/PARR.TemplateGeneratorWorker/TemplateGenerator.cs
index b582d05d..a0aea662 100644
--- a/PARR.TemplateGeneratorWorker/TemplateGenerator.cs
+++ b/PARR.TemplateGeneratorWorker/TemplateGenerator.cs
@@ -1,5 +1,5 @@
using Microsoft.EntityFrameworkCore;
-using PARR.BLL.Services.Interfaces;
+using PARR.Core.Common.Interfaces;
using PARR.DAL.DomainServices.Shortcodes;
using PARR.DAL.Models;
using PARR.DAL.NextRunServices;
diff --git a/PARR.TemplateGeneratorWorker/TemplateGeneratorWorkerInstaller.cs b/PARR.TemplateGeneratorWorker/TemplateGeneratorWorkerInstaller.cs
index d6c769c5..c0e1c632 100644
--- a/PARR.TemplateGeneratorWorker/TemplateGeneratorWorkerInstaller.cs
+++ b/PARR.TemplateGeneratorWorker/TemplateGeneratorWorkerInstaller.cs
@@ -1,5 +1,6 @@
-using PARR.BLL;
+using PARR.Core;
using PARR.DAL;
+using PARR.Infrastructure;
using PARR.TemplateGeneratorWorker.Services;
using PARR.TemplateGeneratorWorker.Settings;
@@ -9,8 +10,9 @@ namespace PARR.TemplateGeneratorWorker
{
public static void InstallTemplateGeneratorWorkerSerivces(this IServiceCollection services, IConfiguration configuration)
{
- services.InstallBllServices(configuration);
services.InstallDalServices(configuration);
+ services.AddCoreServices(configuration);
+ services.AddInfrastructureServices(configuration);
var mqSettings = new MqSettings();
configuration.GetSection(nameof(MqSettings)).Bind(mqSettings);
diff --git a/PARR.TemplateGeneratorWorker/Worker.cs b/PARR.TemplateGeneratorWorker/Worker.cs
index 06106b21..f0e23a86 100644
--- a/PARR.TemplateGeneratorWorker/Worker.cs
+++ b/PARR.TemplateGeneratorWorker/Worker.cs
@@ -1,4 +1,4 @@
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.TemplateGeneratorWorker.Settings;
namespace PARR.TemplateGeneratorWorker
diff --git a/PARR.TemplateMatcher/MqTemplateMatcher.cs b/PARR.TemplateMatcher/MqTemplateMatcher.cs
index 52333ccb..2f8930e5 100644
--- a/PARR.TemplateMatcher/MqTemplateMatcher.cs
+++ b/PARR.TemplateMatcher/MqTemplateMatcher.cs
@@ -1,7 +1,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
-using PARR.BLL.Services.Interfaces;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.Domain.Common.Rabbit.Messages;
using PARR.Domain.Enums;
using PARR.TemplateMatcher.Services.Interfaces;
diff --git a/PARR.TemplateMatcher/PARR.TemplateMatcher.csproj b/PARR.TemplateMatcher/PARR.TemplateMatcher.csproj
index 21190861..e8ef522a 100644
--- a/PARR.TemplateMatcher/PARR.TemplateMatcher.csproj
+++ b/PARR.TemplateMatcher/PARR.TemplateMatcher.csproj
@@ -7,8 +7,9 @@
-
+
+
diff --git a/PARR.TemplateMatcher/Services/Implemetaions/GroupedTemplateSynchronizer.cs b/PARR.TemplateMatcher/Services/Implemetaions/GroupedTemplateSynchronizer.cs
index d387762d..79e81c58 100644
--- a/PARR.TemplateMatcher/Services/Implemetaions/GroupedTemplateSynchronizer.cs
+++ b/PARR.TemplateMatcher/Services/Implemetaions/GroupedTemplateSynchronizer.cs
@@ -1,7 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
-using PARR.Core.Common.RabbitServices;
-using PARR.DAL.Cache.Models;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.DAL.DomainServices.Interfaces;
using PARR.DAL.DomainServices.Shortcodes;
using PARR.DAL.DomainServices.UnitFilterService;
@@ -10,6 +9,7 @@ using PARR.DAL.Models.Job;
using PARR.DAL.Services.Interfaces;
using PARR.DAL.Services.Interfaces.Job;
using PARR.DAL.Services.Interfaces.Unit;
+using PARR.Domain.Cache.Models;
using PARR.Domain.Common.Rabbit.Messages;
using PARR.Domain.Entities.Base.History;
using PARR.Domain.Enums;
diff --git a/PARR.TemplateMatcher/Services/Implemetaions/SimpleTemplateSynchronizer.cs b/PARR.TemplateMatcher/Services/Implemetaions/SimpleTemplateSynchronizer.cs
index c37fe5d6..0a34f0d8 100644
--- a/PARR.TemplateMatcher/Services/Implemetaions/SimpleTemplateSynchronizer.cs
+++ b/PARR.TemplateMatcher/Services/Implemetaions/SimpleTemplateSynchronizer.cs
@@ -1,8 +1,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
-using PARR.Core.Common.RabbitServices;
-using PARR.DAL.Cache.Models;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.DAL.Contracts;
using PARR.DAL.DomainServices.Interfaces;
using PARR.DAL.DomainServices.Shortcodes;
@@ -12,6 +11,7 @@ using PARR.DAL.Models.Job;
using PARR.DAL.Services.Interfaces;
using PARR.DAL.Services.Interfaces.Job;
using PARR.DAL.Services.Interfaces.Unit;
+using PARR.Domain.Cache.Models;
using PARR.Domain.Common.Rabbit.Messages;
using PARR.Domain.Entities.Base.History;
using PARR.Domain.Enums;
diff --git a/PARR.TemplateMatcher/Services/Implemetaions/TemplateUpdaterMqSender.cs b/PARR.TemplateMatcher/Services/Implemetaions/TemplateUpdaterMqSender.cs
index 54132f12..bc53ee19 100644
--- a/PARR.TemplateMatcher/Services/Implemetaions/TemplateUpdaterMqSender.cs
+++ b/PARR.TemplateMatcher/Services/Implemetaions/TemplateUpdaterMqSender.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.DAL.Services.Interfaces;
using PARR.Domain.Common.Rabbit.Messages;
using PARR.TemplateMatcher.Services.Interfaces;
diff --git a/PARR.TemplateMatcher/TemplateMatcherInstaller.cs b/PARR.TemplateMatcher/TemplateMatcherInstaller.cs
index 741844cd..d276ef38 100644
--- a/PARR.TemplateMatcher/TemplateMatcherInstaller.cs
+++ b/PARR.TemplateMatcher/TemplateMatcherInstaller.cs
@@ -1,7 +1,8 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using PARR.BLL;
+using PARR.Core;
using PARR.DAL;
+using PARR.Infrastructure;
using PARR.TemplateMatcher.Services.Implementations;
using PARR.TemplateMatcher.Services.Implemetaions;
using PARR.TemplateMatcher.Services.Interfaces;
@@ -13,8 +14,9 @@ namespace PARR.TemplateMatcher
{
public static void InstallTemplateMatcherSerivces(this IServiceCollection services, IConfiguration configuration)
{
- services.InstallBllServices(configuration);
services.InstallDalServices(configuration);
+ services.AddCoreServices(configuration);
+ services.AddInfrastructureServices(configuration);
var mqSettings = new MqSettings();
configuration.GetSection(nameof(MqSettings)).Bind(mqSettings);
diff --git a/PARR.TemplateMatcherWorker/Dockerfile b/PARR.TemplateMatcherWorker/Dockerfile
index 004b8e2e..b77284db 100644
--- a/PARR.TemplateMatcherWorker/Dockerfile
+++ b/PARR.TemplateMatcherWorker/Dockerfile
@@ -12,11 +12,10 @@ WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.TemplateMatcherWorker/PARR.TemplateMatcherWorker.csproj", "PARR.TemplateMatcherWorker/"]
COPY ["PARR.TemplateMatcher/PARR.TemplateMatcher.csproj", "PARR.TemplateMatcher/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
+COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
-COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
+COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
RUN dotnet restore "./PARR.TemplateMatcherWorker/PARR.TemplateMatcherWorker.csproj"
COPY . .
WORKDIR "/src/PARR.TemplateMatcherWorker"
diff --git a/PARR.TemplateTaskGenerator/IMqTemplateTaskGenerator.cs b/PARR.TemplateTaskGenerator/IMqTemplateTaskGenerator.cs
deleted file mode 100644
index 88e14433..00000000
--- a/PARR.TemplateTaskGenerator/IMqTemplateTaskGenerator.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace PARR.TemplateTaskGenerator
-{
- public interface IMqTemplateTaskGenerator
- {
- Task StartAsync();
- Task StopAsync();
- }
-}
diff --git a/PARR.TemplateTaskGenerator/ITemplateTaskGenerator.cs b/PARR.TemplateTaskGenerator/ITemplateTaskGenerator.cs
deleted file mode 100644
index 36f08b50..00000000
--- a/PARR.TemplateTaskGenerator/ITemplateTaskGenerator.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace PARR.TemplateTaskGenerator
-{
- internal interface ITemplateTaskGenerator
- {
- Task GenerateTemplateTaskAsync(Guid jobId);
- }
-}
diff --git a/PARR.TemplateTaskGenerator/MqTemplateTaskGenerator.cs b/PARR.TemplateTaskGenerator/MqTemplateTaskGenerator.cs
deleted file mode 100644
index 1c519f11..00000000
--- a/PARR.TemplateTaskGenerator/MqTemplateTaskGenerator.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
-using PARR.BLL.Domain.Mq;
-using PARR.BLL.Services.Interfaces;
-using PARR.TemplateTaskGenerator.Services;
-using PARR.TemplateTaskGenerator.Settings;
-
-namespace PARR.TemplateTaskGenerator
-{
- internal class MqTemplateTaskGenerator : IMqTemplateTaskGenerator
- {
- private readonly ILogger logger;
- private readonly MqSettings mqSettings;
- private readonly IMqService mqService;
- private readonly ITransformService transformService;
- private readonly IServiceProvider serviceProvider;
-
- public MqTemplateTaskGenerator(
- ILogger logger,
- MqSettings mqSettings,
- IMqService mqService,
- ITransformService transformService,
- IServiceProvider serviceProvider
- )
- {
- this.logger = logger;
- this.mqSettings = mqSettings;
- this.mqService = mqService;
- this.transformService = transformService;
- this.serviceProvider = serviceProvider;
- }
-
-
- public async Task StartAsync()
- {
- var isConnected = await mqService.InitConsumerAsync(mqSettings.TemplateTaskGenerator, GenerateTemplateTaskAsync);
-
- if (!isConnected)
- throw new Exception("Ошибка при подключении к RabbitMq");
- }
-
-
- public async Task StopAsync()
- {
- await mqService.DisposeAsync();
- }
-
-
- private async Task GenerateTemplateTaskAsync(string msg)
- {
- logger.LogInformation($"Получили запрос: {msg}");
-
- var query = transformService.GetModelFromJson(msg);
- if (query == null)
- return;
-
- await using (var scope = serviceProvider.CreateAsyncScope())
- {
- var validatorService = GetServiceInScope(scope);
- if (!await validatorService.IsValidAsync(query.JobId))
- return;
-
- var templateTaskGenerator = GetServiceInScope(scope);
- await templateTaskGenerator.GenerateTemplateTaskAsync(query.JobId);
-
- }
- }
-
-
- private Service GetServiceInScope(IServiceScope scope)
- {
- var service = scope.ServiceProvider.GetService();
- if (service == null)
- throw new Exception($"Не найден сервис: {nameof(Service)}");
-
- return service;
- }
- }
-}
diff --git a/PARR.TemplateTaskGenerator/PARR.TemplateTaskGenerator.csproj b/PARR.TemplateTaskGenerator/PARR.TemplateTaskGenerator.csproj
deleted file mode 100644
index 21190861..00000000
--- a/PARR.TemplateTaskGenerator/PARR.TemplateTaskGenerator.csproj
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
- net7.0
- enable
- enable
-
-
-
-
-
-
-
-
diff --git a/PARR.TemplateTaskGenerator/Services/IValidatorService.cs b/PARR.TemplateTaskGenerator/Services/IValidatorService.cs
deleted file mode 100644
index 0bce2004..00000000
--- a/PARR.TemplateTaskGenerator/Services/IValidatorService.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-namespace PARR.TemplateTaskGenerator.Services
-{
- internal interface IValidatorService
- {
- ///
- /// Проверяет существование регламентной работы
- ///
- ///
- ///
- Task IsValidAsync(Guid jobId);
- }
-}
diff --git a/PARR.TemplateTaskGenerator/Services/ValidatorService.cs b/PARR.TemplateTaskGenerator/Services/ValidatorService.cs
deleted file mode 100644
index d8b7f331..00000000
--- a/PARR.TemplateTaskGenerator/Services/ValidatorService.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using Microsoft.Extensions.Logging;
-using PARR.DAL.Services.Interfaces.Job;
-
-namespace PARR.TemplateTaskGenerator.Services
-{
- internal class ValidatorService : IValidatorService
- {
- private readonly ILogger logger;
- private readonly IJobService jobService;
-
-
- public ValidatorService(
- ILogger logger,
- IJobService jobService
- )
- {
- this.logger = logger;
- this.jobService = jobService;
- }
-
-
- public async Task IsValidAsync(Guid jobId)
- {
- var isExist = await jobService.GetAsync(jobId);
-
- if (isExist == null)
- {
- logger.LogError($"Не найдена регалментная работа {nameof(jobId)}: {jobId}");
- return false;
- }
-
- return true;
- }
-
- }
-}
diff --git a/PARR.TemplateTaskGenerator/Settings/MqSettings.cs b/PARR.TemplateTaskGenerator/Settings/MqSettings.cs
deleted file mode 100644
index a3488c2b..00000000
--- a/PARR.TemplateTaskGenerator/Settings/MqSettings.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using PARR.BLL.Contracts.Interfaces;
-
-namespace PARR.TemplateTaskGenerator.Settings
-{
- internal class MqSettings
- {
- public TemplateTaskGenerator TemplateTaskGenerator { get; set; } = new TemplateTaskGenerator();
- public TemplateGeneratorWorker TemplateGeneratorWorker { get; set; } = new TemplateGeneratorWorker();
- }
-
-
- internal class TemplateTaskGenerator : IMqSettings
- {
- public string HostName { get; set; } = string.Empty;
- public string QueueName { get; set; } = string.Empty;
- public string User { get; set; } = string.Empty;
- public string Password { get; set; } = string.Empty;
- public ushort? PrefetchCount { get; set; } = 0;
- }
-
-
- internal class TemplateGeneratorWorker : IMqSettings
- {
- public string HostName { get; set; } = string.Empty;
- public string QueueName { get; set; } = string.Empty;
- public string User { get; set; } = string.Empty;
- public string Password { get; set; } = string.Empty;
- public ushort? PrefetchCount { get; set; } = 0;
- }
-}
diff --git a/PARR.TemplateTaskGenerator/TemplateTaskGenerator.cs b/PARR.TemplateTaskGenerator/TemplateTaskGenerator.cs
deleted file mode 100644
index 2775212c..00000000
--- a/PARR.TemplateTaskGenerator/TemplateTaskGenerator.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using Microsoft.Extensions.Logging;
-using PARR.BLL.Domain.Mq;
-using PARR.BLL.Services.Interfaces;
-using PARR.Common.Domain;
-using PARR.Constants;
-using PARR.DAL.DomainServices.Interfaces;
-using PARR.TemplateTaskGenerator.Settings;
-using System.Text.Json;
-
-namespace PARR.TemplateTaskGenerator
-{
- internal class TemplateTaskGenerator : ITemplateTaskGenerator
- {
- private readonly ILogger logger;
- private readonly IUnitFilterService unitFilterService;
- private readonly MqSettings mqSettings;
- private readonly IMqService mqService;
-
- public TemplateTaskGenerator(
- ILogger logger,
- IUnitFilterService unitFilterService,
- MqSettings mqSettings,
- IMqService mqService
- )
- {
- this.logger = logger;
- this.unitFilterService = unitFilterService;
- this.mqSettings = mqSettings;
- this.mqService = mqService;
- }
-
-
- public async Task GenerateTemplateTaskAsync(Guid jobId)
- {
- //var unitIdsToCreateTemplate = await unitFilterService.GetUnitsIdByJobFilterWithTemplateStatusAsync(jobId, false);
- //todo: !!!!!!!! исправить в этом месте !!!!!!!!
- IEnumerable? unitIdsToCreateTemplate = null;
-
- if (unitIdsToCreateTemplate == null || !unitIdsToCreateTemplate.Any())
- return;
-
- foreach (var unitId in unitIdsToCreateTemplate)
- {
- var mqRequest = new TemplateGeneratorMq
- {
- UnitsInTemplate=new List(),
- JobId = jobId,
- UnitId = unitId,
- HistoryInitiator = new HistoryInitiator { InitiatorComment = "Запрос на создание шаблона", InitiatorParrComponentId = ParrComponentsEnum.TemplateTaskGenerator },
- UnitsInTemplate = new List()
-
- };
-
- var msg = JsonSerializer.Serialize(mqRequest);
-
- var result = await mqService.SendAsync(mqSettings.TemplateGeneratorWorker, new[] { msg });
-
- if (result.IsSuccess)
- logger.LogInformation($"Отправлен запрос на создание шаблона: {msg}");
- else
- logger.LogError($"Ошибка при отправке запроса на создание шаблона: {msg}");
- }
- }
- }
-}
diff --git a/PARR.TemplateTaskGenerator/TemplateTaskGeneratorInstaller.cs b/PARR.TemplateTaskGenerator/TemplateTaskGeneratorInstaller.cs
deleted file mode 100644
index 7463656e..00000000
--- a/PARR.TemplateTaskGenerator/TemplateTaskGeneratorInstaller.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using PARR.BLL;
-using PARR.DAL;
-using PARR.TemplateTaskGenerator.Services;
-using PARR.TemplateTaskGenerator.Settings;
-
-namespace PARR.TemplateTaskGenerator
-{
- public static class TemplateTaskGeneratorInstaller
- {
- public static void InstallTemplateTaskGeneratorSerivces(this IServiceCollection services, IConfiguration configuration)
- {
- services.InstallBllServices(configuration);
- services.InstallDalServices(configuration);
-
- var mqSettings = new MqSettings();
- configuration.GetSection(nameof(MqSettings)).Bind(mqSettings);
- services.AddSingleton(mqSettings);
-
- services.AddTransient();
- services.AddTransient();
- services.AddTransient();
- }
-
- public static IConfigurationBuilder AddTemplateTaskGeneratorConfigurations(this IConfigurationBuilder builder, IServiceCollection services)
- {
- builder.AddDalConfigurations(services);
-
- return builder;
- }
-
- public static void AddTemplateTaskGeneratorSettings(this IServiceCollection services, IConfiguration configuration)
- {
- services.AddDallSettings(configuration);
- }
- }
-}
diff --git a/PARR.TemplateTaskGeneratorWorker/Dockerfile b/PARR.TemplateTaskGeneratorWorker/Dockerfile
deleted file mode 100644
index 7c54a6c4..00000000
--- a/PARR.TemplateTaskGeneratorWorker/Dockerfile
+++ /dev/null
@@ -1,34 +0,0 @@
-# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
-
-# This stage is used when running from VS in fast mode (Default for Debug configuration)
-FROM 10.99.253.167:8090/dotnet/runtime:7.0 AS base
-WORKDIR /app
-
-
-# This stage is used to build the service project
-FROM 10.99.253.167:8090/dotnet/sdk:7.0 AS build
-ARG BUILD_CONFIGURATION=Release
-WORKDIR /src
-COPY ["NuGet.config", "."]
-COPY ["PARR.TemplateTaskGeneratorWorker/PARR.TemplateTaskGeneratorWorker.csproj", "PARR.TemplateTaskGeneratorWorker/"]
-COPY ["PARR.TemplateTaskGenerator/PARR.TemplateTaskGenerator.csproj", "PARR.TemplateTaskGenerator/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
-COPY ["PARR.Constants/PARR.Constants.csproj", "PARR.Constants/"]
-COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
-RUN dotnet restore "./PARR.TemplateTaskGeneratorWorker/PARR.TemplateTaskGeneratorWorker.csproj"
-COPY . .
-WORKDIR "/src/PARR.TemplateTaskGeneratorWorker"
-RUN dotnet build "./PARR.TemplateTaskGeneratorWorker.csproj" -c $BUILD_CONFIGURATION -o /app/build
-
-# This stage is used to publish the service project to be copied to the final stage
-FROM build AS publish
-ARG BUILD_CONFIGURATION=Release
-ARG app_version=0.0.0-default
-RUN dotnet publish "./PARR.TemplateTaskGeneratorWorker.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false /p:Version=$app_version
-
-# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
-FROM base AS final
-WORKDIR /app
-COPY --from=publish /app/publish .
-ENTRYPOINT ["dotnet", "PARR.TemplateTaskGeneratorWorker.dll"]
\ No newline at end of file
diff --git a/PARR.TemplateTaskGeneratorWorker/PARR.TemplateTaskGeneratorWorker.csproj b/PARR.TemplateTaskGeneratorWorker/PARR.TemplateTaskGeneratorWorker.csproj
deleted file mode 100644
index 79225a7c..00000000
--- a/PARR.TemplateTaskGeneratorWorker/PARR.TemplateTaskGeneratorWorker.csproj
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- net7.0
- enable
- enable
- dotnet-TemplateTaskGeneratorWorker-31809d29-599f-4a6d-8700-45ea8d9e7649
- Linux
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/PARR.TemplateTaskGeneratorWorker/Program.cs b/PARR.TemplateTaskGeneratorWorker/Program.cs
deleted file mode 100644
index 01af1c88..00000000
--- a/PARR.TemplateTaskGeneratorWorker/Program.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using Elastic.CommonSchema.Serilog;
-using PARR.TemplateTaskGenerator;
-using PARR.TemplateTaskGeneratorWorker;
-using Serilog;
-
-var builder = Host.CreateApplicationBuilder();
-
-builder.Services.AddLogging(config =>
-{
- config.ClearProviders();
-
- var logger = new LoggerConfiguration();
-
- if (builder.Environment.IsProduction())
- logger.WriteTo.Console(new EcsTextFormatter());
- else
- logger.WriteTo.Console();
-
- logger.ReadFrom.Configuration(builder.Configuration);
-
- config.AddSerilog(logger.CreateLogger());
-});
-
-builder.Services.InstallTemplateTaskGeneratorSerivces(builder.Configuration);
-builder.Configuration.AddTemplateTaskGeneratorConfigurations(builder.Services);
-builder.Services.AddTemplateTaskGeneratorSettings(builder.Configuration);
-
-builder.Services.AddHostedService();
-
-var host = builder.Build();
-host.Run();
\ No newline at end of file
diff --git a/PARR.TemplateTaskGeneratorWorker/Properties/launchSettings.json b/PARR.TemplateTaskGeneratorWorker/Properties/launchSettings.json
deleted file mode 100644
index e7d4f62a..00000000
--- a/PARR.TemplateTaskGeneratorWorker/Properties/launchSettings.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "profiles": {
- "TemplateTaskGeneratorWorker": {
- "commandName": "Project",
- "environmentVariables": {
- "DOTNET_ENVIRONMENT": "Development"
- },
- "dotnetRunMessages": true
- },
- "Container (Dockerfile)": {
- "commandName": "Docker"
- }
- }
-}
\ No newline at end of file
diff --git a/PARR.TemplateTaskGeneratorWorker/Worker.cs b/PARR.TemplateTaskGeneratorWorker/Worker.cs
deleted file mode 100644
index 369ab7b7..00000000
--- a/PARR.TemplateTaskGeneratorWorker/Worker.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using PARR.TemplateTaskGenerator;
-
-namespace PARR.TemplateTaskGeneratorWorker
-{
- public class Worker : BackgroundService
- {
- private readonly ILogger _logger;
- private readonly IMqTemplateTaskGenerator mqTemplateTaskGenerator;
-
- public Worker(
- ILogger logger,
- IMqTemplateTaskGenerator mqTemplateTaskGenerator
- )
- {
- _logger = logger;
- this.mqTemplateTaskGenerator = mqTemplateTaskGenerator;
- }
-
- protected override async Task ExecuteAsync(CancellationToken stoppingToken)
- {
- await mqTemplateTaskGenerator.StartAsync();
- }
-
-
- public override Task StopAsync(CancellationToken cancellationToken)
- {
- mqTemplateTaskGenerator.StopAsync().Wait();
-
- return base.StopAsync(cancellationToken);
- }
- }
-}
diff --git a/PARR.TemplateTaskGeneratorWorker/appsettings.Development.json b/PARR.TemplateTaskGeneratorWorker/appsettings.Development.json
deleted file mode 100644
index 9a9bacbb..00000000
--- a/PARR.TemplateTaskGeneratorWorker/appsettings.Development.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "Logging": {
- "LogLevel": {
- "Default": "Information",
- "Microsoft.Hosting.Lifetime": "Information"
- }
- },
- "Serilog": {
- "MinimumLevel": {
- "Default": "Information",
- "Override": {
- "Microsoft": "Warning",
- "Microsoft.Hosting.Lifetime": "Information"
- }
- },
- "WriteTo": [
- {
- "Name": "File",
- "Args": {
- "path": "log/log-.txt",
- "rollingInterval": "Day"
- }
- }
- ]
- },
- "MqSettings": {
- "TemplateTaskGenerator": { "HostName": "10.99.253.216" },
- "TemplateGeneratorWorker": { "HostName": "10.99.253.216" }
- }
-}
\ No newline at end of file
diff --git a/PARR.TemplateTaskGeneratorWorker/appsettings.json b/PARR.TemplateTaskGeneratorWorker/appsettings.json
deleted file mode 100644
index afa05c72..00000000
--- a/PARR.TemplateTaskGeneratorWorker/appsettings.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "ConnectionStrings": {
- "DefaultConnection": "Server=10.99.253.184;Database=parr;User Id=app_parr; Password=PosdfkhT&)%sdfligL&%5546;",
- "RedisConnection": "parr-redis:6379,password=ParrP@ssPtk202MMdevDvs"
- },
- "Logging": {
- "LogLevel": {
- "Default": "Information",
- "Microsoft.EntityFrameworkCore": "Error",
- "Microsoft.EntityFrameworkCore.Database.Command": "Warning",
- "Microsoft.AspNetCore": "Warning"
- }
- },
- "Serilog": {
- "MinimumLevel": {
- "Default": "Information",
- "Override": {
- "Microsoft": "Warning",
- "Microsoft.EntityFrameworkCore": "Error",
- "Microsoft.EntityFrameworkCore.Database.Command": "Warning",
- "Microsoft.Hosting.Lifetime": "Information"
- }
- }
- },
- "MqSettings": {
- "TemplateTaskGenerator": {
- "HostName": "parr-rabbitmq",
- "QueueName": "parr-template-task-generator",
- "User": "template_task_generator_reader",
- "Password": "wzqj$Z@3:poz@oot"
- },
- "TemplateGeneratorWorker": {
- "HostName": "parr-rabbitmq",
- "QueueName": "parr-template-generator",
- "User": "template_generator_writer",
- "Password": "B;6h+yF$zQ0OSkLX"
- }
-
- }
-}
\ No newline at end of file
diff --git a/PARR.TemplateUpdater/PARR.TemplateUpdater.csproj b/PARR.TemplateUpdater/PARR.TemplateUpdater.csproj
index 2b338f52..6f3fde69 100644
--- a/PARR.TemplateUpdater/PARR.TemplateUpdater.csproj
+++ b/PARR.TemplateUpdater/PARR.TemplateUpdater.csproj
@@ -7,9 +7,10 @@
-
+
+
diff --git a/PARR.TemplateUpdater/TemplateUpdater.cs b/PARR.TemplateUpdater/TemplateUpdater.cs
index 08cf7a1e..2b77afc4 100644
--- a/PARR.TemplateUpdater/TemplateUpdater.cs
+++ b/PARR.TemplateUpdater/TemplateUpdater.cs
@@ -1,7 +1,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
-using PARR.BLL.Services.Interfaces;
-using PARR.Core.Common.RabbitServices;
+using PARR.Core.Common.Interfaces;
+using PARR.Core.Common.Interfaces.RabbitServices;
using PARR.Domain.Common.Rabbit.Messages;
using PARR.TemplateUpdater.Services;
using PARR.TemplateUpdater.Settings;
diff --git a/PARR.TemplateUpdater/TemplateUpdaterInstaller.cs b/PARR.TemplateUpdater/TemplateUpdaterInstaller.cs
index 8704d7a6..1b98d916 100644
--- a/PARR.TemplateUpdater/TemplateUpdaterInstaller.cs
+++ b/PARR.TemplateUpdater/TemplateUpdaterInstaller.cs
@@ -1,7 +1,8 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using PARR.BLL;
+using PARR.Core;
using PARR.DAL;
+using PARR.Infrastructure;
using PARR.TemplateUpdater.Services;
using PARR.TemplateUpdater.Settings;
@@ -11,8 +12,9 @@ namespace PARR.TemplateUpdater
{
public static void InstallTemplateUpdaterServices(this IServiceCollection services, IConfiguration configuration)
{
- services.InstallBllServices(configuration);
services.InstallDalServices(configuration);
+ services.AddCoreServices(configuration);
+ services.AddInfrastructureServices(configuration);
var mqSettings = new MqSettings();
configuration.GetSection(nameof(MqSettings)).Bind(mqSettings);
diff --git a/PARR.TemplateUpdaterWorker/Dockerfile b/PARR.TemplateUpdaterWorker/Dockerfile
index c896e43a..385379e5 100644
--- a/PARR.TemplateUpdaterWorker/Dockerfile
+++ b/PARR.TemplateUpdaterWorker/Dockerfile
@@ -12,11 +12,10 @@ WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.TemplateUpdaterWorker/PARR.TemplateUpdaterWorker.csproj", "PARR.TemplateUpdaterWorker/"]
COPY ["PARR.TemplateUpdater/PARR.TemplateUpdater.csproj", "PARR.TemplateUpdater/"]
-COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
-COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
+COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
-COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
+COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
RUN dotnet restore "./PARR.TemplateUpdaterWorker/PARR.TemplateUpdaterWorker.csproj"
COPY . .
WORKDIR "/src/PARR.TemplateUpdaterWorker"
diff --git a/PARR.Test/NextRun/NextRunTest.cs b/PARR.Test/NextRun/NextRunTest.cs
index 29f25322..ef91f335 100644
--- a/PARR.Test/NextRun/NextRunTest.cs
+++ b/PARR.Test/NextRun/NextRunTest.cs
@@ -1,8 +1,6 @@
-using PARR.Constants;
-using PARR.DAL.DomainServices.Shortcodes;
+using PARR.DAL.DomainServices.Shortcodes;
using PARR.DAL.NextRunServices;
using PARR.DAL.NextRunServices.Models;
-using PARR.DAL.NextRunServices.Subservices;
using PARR.DAL.Services.Interfaces;
namespace PARR.Test.NextRun
diff --git a/PARR.Test/PARR.Test.csproj b/PARR.Test/PARR.Test.csproj
index 54a95a47..52c3c37f 100644
--- a/PARR.Test/PARR.Test.csproj
+++ b/PARR.Test/PARR.Test.csproj
@@ -17,9 +17,11 @@
-
+
+
+
diff --git a/PARR.Test/Program.cs b/PARR.Test/Program.cs
index 58eb52d2..d453413e 100644
--- a/PARR.Test/Program.cs
+++ b/PARR.Test/Program.cs
@@ -1,8 +1,8 @@
using Elastic.CommonSchema.Serilog;
-using PARR.BLL;
+using PARR.Core;
using PARR.DAL;
using PARR.EsppApi;
-using PARR.TemplateDistributor;
+using PARR.Infrastructure;
using PARR.Test;
using PARR.Test.NextRun;
using Serilog;
@@ -43,8 +43,9 @@ builder.Services.AddLogging(config =>
});
builder.Services.InstallDalServices(builder.Configuration);
+builder.Services.AddCoreServices(builder.Configuration);
+builder.Services.AddInfrastructureServices(builder.Configuration);
builder.Services.InstallEsppApiServices(builder.Configuration);
-builder.Services.InstallBllServices(builder.Configuration);
builder.Configuration.AddDalConfigurations(builder.Services);
builder.Services.AddDallSettings(builder.Configuration);
diff --git a/PARR.Test/Worker.cs b/PARR.Test/Worker.cs
index 47e71b7b..b0aadfde 100644
--- a/PARR.Test/Worker.cs
+++ b/PARR.Test/Worker.cs
@@ -1,8 +1,4 @@
-using Microsoft.EntityFrameworkCore;
-using PARR.BLL.Services.Interfaces;
-using PARR.Core.Common;
-using PARR.DAL.DomainServices.Interfaces;
-using PARR.DAL.Services.Interfaces;
+using PARR.Core.Common.Interfaces;
using PARR.Domain.Enums;
using PARR.EsppApi;
using PARR.EsppApi.Constants;