From d90b72b14ec371103f2ef1df59042fcfde944731 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 16 Dec 2024 15:38:46 +0500 Subject: [PATCH 1/5] =?UTF-8?q?1.=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D1=8B=20namespaces.=202.=20=D0=94=D0=BE?= =?UTF-8?q?=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20=D0=BF=D1=80=D0=BE=D0=B5?= =?UTF-8?q?=D0=BA=D1=82=20DD.Persistence.App=20=D1=81=D0=BE=20=D0=B2=D1=81?= =?UTF-8?q?=D0=B5=D0=BC=D0=B8=20=D0=BD=D0=B5=D0=BE=D0=B1=D1=85=D0=BE=D0=B4?= =?UTF-8?q?=D0=B8=D0=BC=D1=8B=D0=BC=D0=B8=20=D0=BD=D0=B0=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=B9=D0=BA=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ChangeLogController.cs | 8 +-- .../Controllers/DataSaubController.cs | 6 +- .../Controllers/DataSourceSystemController.cs | 6 +- .../Controllers/SetpointController.cs | 6 +- .../Controllers/TechMessagesController.cs | 8 +-- .../Controllers/TimeSeriesController.cs | 6 +- .../Controllers/TimestampedSetController.cs | 6 +- .../Controllers/WitsDataController.cs | 6 +- .../DD.Persistence.API.csproj | 14 +++-- .../DependencyInjection.cs | 12 ++-- .../Extensions.cs | 2 +- .../Properties/launchSettings.json | 0 .../Startup.cs | 8 +-- DD.Persistence.App/.config/dotnet-tools.json | 5 ++ DD.Persistence.App/DD.Persistence.App.csproj | 26 ++++++++ .../Dockerfile | 13 ++-- .../Program.cs | 5 +- .../PublishProfiles/LinuxRelease.pubxml | 22 +++++++ .../PublishProfiles/WindowsRelease.pubxml | 22 +++++++ .../Properties/launchSettings.json | 52 +++++++++++++++ DD.Persistence.App/Readme.md | 30 +++++++++ .../appsettings.Development.json | 0 .../appsettings.Tests.json | 0 .../appsettings.json | 0 .../defaultsettings.Development.json | 9 +++ DD.Persistence.App/defaultsettings.Tests.json | 16 +++++ DD.Persistence.App/defaultsettings.json | 26 ++++++++ .../Clients/Base/BaseClient.cs | 6 +- .../Clients/ChangeLogClient.cs | 10 +-- .../Clients/DataSourceSystemClient.cs | 10 +-- .../Clients/Interfaces/IChangeLogClient.cs | 6 +- .../Interfaces/IDataSourceSystemClient.cs | 4 +- .../Clients/Interfaces/ISetpointClient.cs | 4 +- .../Clients/Interfaces/ITechMessagesClient.cs | 6 +- .../Clients/Interfaces/ITimeSeriesClient.cs | 4 +- .../Interfaces/ITimestampedSetClient.cs | 4 +- .../Clients/Interfaces/IWitsDataClient.cs | 4 +- .../Interfaces/Refit/IRefitChangeLogClient.cs | 6 +- .../Refit/IRefitDataSourceSystemClient.cs | 4 +- .../Interfaces/Refit/IRefitSetpointClient.cs | 4 +- .../Refit/IRefitTechMessagesClient.cs | 6 +- .../Refit/IRefitTimeSeriesClient.cs | 4 +- .../Refit/IRefitTimestampedSetClient.cs | 4 +- .../Interfaces/Refit/IRefitWitsDataClient.cs | 4 +- .../Clients/SetpointClient.cs | 10 +-- .../Clients/TechMessagesClient.cs | 12 ++-- .../Clients/TimeSeriesClient.cs | 10 +-- .../Clients/TimestampedSetClient.cs | 10 +-- .../Clients/WitsDataClient.cs | 10 +-- .../CustomExceptions/AcceptableException.cs | 2 +- .../CustomExceptions/BadGatewayException.cs | 2 +- .../CustomExceptions/ForbiddenException.cs | 2 +- .../InternalServerException.cs | 2 +- .../CustomExceptions/LockedException.cs | 2 +- .../ServiceUnavailableException.cs | 2 +- .../TooManyRequestsException.cs | 2 +- .../DD.Persistence.Client.csproj | 63 +++++++++++++++++++ .../Helpers/ApiTokenHelper.cs | 4 +- .../Helpers/ExceptionsHelper.cs | 8 +-- .../PersistenceClientFactory.cs | 12 ++-- .../Readme.md | 4 +- .../DD.Persistence.Database.Postgres.csproj | 8 +-- .../DependencyInjection.cs | 2 +- .../DesignTimeDbContextFactory.cs | 4 +- .../EFExtensionsInitialization.cs | 2 +- .../20241118052225_SetpointMigration.cs | 2 +- .../20241126071115_Add_ChangeLog.Designer.cs | 8 +-- .../20241126071115_Add_ChangeLog.cs | 2 +- .../20241126100631_Init.Designer.cs | 10 +-- .../Migrations/20241126100631_Init.cs | 2 +- ...3120141_ParameterDataMigration.Designer.cs | 20 +++--- .../20241203120141_ParameterDataMigration.cs | 2 +- ...212041758_TechMessageMigration.Designer.cs | 22 +++---- .../20241212041758_TechMessageMigration.cs | 2 +- ...PersistencePostgresContextModelSnapshot.cs | 22 +++---- .../PersistencePostgresContext.cs | 2 +- DD.Persistence.Database.Postgres/Readme.md | 11 ++++ .../DD.Persistence.Database.csproj | 2 +- .../EFExtensions.cs | 2 +- .../Entity/ChangeLog.cs | 4 +- .../Entity/DataSaub.cs | 2 +- .../Entity/DataSourceSystem.cs | 2 +- .../Entity/IChangeLog.cs | 2 +- .../Entity/ITimestampedData.cs | 2 +- .../Entity/ParameterData.cs | 2 +- .../Entity/Setpoint.cs | 2 +- .../Entity/TechMessage.cs | 2 +- .../Entity/TimestampedSet.cs | 2 +- .../PersistenceDbContext.cs | 6 +- .../BaseIntegrationTest.cs | 6 +- .../Controllers/ChangeLogControllerTest.cs | 13 ++-- .../Controllers/DataSaubControllerTest.cs | 6 +- .../DataSourceSystemControllerTest.cs | 12 ++-- .../Controllers/SetpointControllerTest.cs | 8 +-- .../Controllers/TechMessagesControllerTest.cs | 14 ++--- .../TimeSeriesBaseControllerTest.cs | 8 +-- .../TimestampedSetControllerTest.cs | 8 +-- .../Controllers/WitsDataControllerTest.cs | 11 ++-- .../DD.Persistence.IntegrationTests.csproj | 7 ++- .../DbConnection.cs | 2 +- .../EFCoreExtensions.cs | 2 +- .../TestHttpClientFactory.cs | 2 +- .../WebAppFactoryFixture.cs | 10 +-- .../CyclicArray.cs | 2 +- .../DD.Persistence.Repository.csproj | 4 +- .../DependencyInjection.cs | 10 +-- .../Extensions/EFExtensionsSortBy.cs | 2 +- .../QueryBuilders.cs | 8 +-- .../Repositories/ChangeLogRepository.cs | 10 +-- .../DataSourceSystemCachedRepository.cs | 4 +- .../DataSourceSystemRepository.cs | 33 ++++++++++ .../Repositories/ParameterRepository.cs | 8 +-- .../Repositories/SetpointRepository.cs | 8 +-- .../Repositories/TechMessagesRepository.cs | 10 +-- .../TimeSeriesDataCachedRepository.cs | 6 +- .../Repositories/TimeSeriesDataRepository.cs | 8 +-- .../Repositories/TimestampedSetRepository.cs | 8 +-- .../API/IChangeLogApi.cs | 6 +- .../API/ISetpointApi.cs | 4 +- .../API/ISyncApi.cs | 4 +- .../API/ISyncWithDiscriminatorApi.cs | 4 +- .../API/ITimeSeriesBaseDataApi.cs | 2 +- .../API/ITimeSeriesDataApi.cs | 4 +- .../API/IWitsDataApi.cs | 4 +- .../DD.Persistence.csproj | 1 + .../EFExtensions.cs | 2 +- .../Factories/IAuthTokenFactory.cs | 2 +- .../Models/ChangeLogDto.cs | 2 +- .../Models/Configurations/AuthUser.cs | 2 +- .../Models/Configurations/JwtParams.cs | 2 +- .../Models/Configurations/JwtToken.cs | 2 +- .../Models/Configurations/WitsInfo.cs | 4 +- .../Models/DataSaubDto.cs | 2 +- .../Models/DataSourceSystemDto.cs | 2 +- .../Models/DataWithWellDepthAndSectionDto.cs | 2 +- .../Models/DatesRangeDto.cs | 2 +- .../Models/Enumerations/EventState.cs | 2 +- .../Models/Enumerations/WitsType.cs | 2 +- .../Models/ITimeSeriesAbstractDto.cs | 2 +- .../Models/IWithSectionPart.cs | 2 +- .../Models/MessagesStatisticDto.cs | 2 +- .../Models/PaginationContainer.cs | 2 +- .../Models/ParameterDto.cs | 2 +- .../Models/Requests/PaginationRequest.cs | 2 +- .../Models/Requests/SectionPartRequest.cs | 2 +- .../Models/SetpointLogDto.cs | 2 +- .../Models/SetpointValueDto.cs | 2 +- .../Models/TechMessageDto.cs | 4 +- .../Models/TimestampedSetDto.cs | 2 +- .../Models/WitsDataDto.cs | 2 +- .../Models/WitsValueDto.cs | 2 +- .../Repositories/IChangeLogRepository.cs | 6 +- .../IDataSourceSystemRepository.cs | 4 +- .../Repositories/IParameterRepository.cs | 4 +- .../Repositories/ISetpointRepository.cs | 4 +- .../Repositories/ISyncRepository.cs | 4 +- .../ISyncWithDiscriminatorRepository.cs | 4 +- .../Repositories/ITechMessagesRepository.cs | 6 +- .../Repositories/ITimeSeriesBaseRepository.cs | 2 +- .../Repositories/ITimeSeriesDataRepository.cs | 4 +- .../Repositories/ITimestampedSetRepository.cs | 4 +- .../Services/Config/WitsConfig.json | 0 .../Services/Interfaces/IArchiveService.cs | 2 +- .../Services/Interfaces/IWitsDataService.cs | 4 +- .../Services/WitsDataService.cs | 12 ++-- Persistence.sln | 20 +++--- 166 files changed, 717 insertions(+), 390 deletions(-) rename {Persistence.API => DD.Persistence.API}/Controllers/ChangeLogController.cs (97%) rename {Persistence.API => DD.Persistence.API}/Controllers/DataSaubController.cs (80%) rename {Persistence.API => DD.Persistence.API}/Controllers/DataSourceSystemController.cs (92%) rename {Persistence.API => DD.Persistence.API}/Controllers/SetpointController.cs (97%) rename {Persistence.API => DD.Persistence.API}/Controllers/TechMessagesController.cs (96%) rename {Persistence.API => DD.Persistence.API}/Controllers/TimeSeriesController.cs (96%) rename {Persistence.API => DD.Persistence.API}/Controllers/TimestampedSetController.cs (97%) rename {Persistence.API => DD.Persistence.API}/Controllers/WitsDataController.cs (96%) rename Persistence.API/Persistence.API.csproj => DD.Persistence.API/DD.Persistence.API.csproj (61%) rename {Persistence.API => DD.Persistence.API}/DependencyInjection.cs (97%) rename {Persistence.API => DD.Persistence.API}/Extensions.cs (95%) rename {Persistence.API => DD.Persistence.API}/Properties/launchSettings.json (100%) rename {Persistence.API => DD.Persistence.API}/Startup.cs (91%) create mode 100644 DD.Persistence.App/.config/dotnet-tools.json create mode 100644 DD.Persistence.App/DD.Persistence.App.csproj rename {Persistence.API => DD.Persistence.App}/Dockerfile (52%) rename {Persistence.API => DD.Persistence.App}/Program.cs (88%) create mode 100644 DD.Persistence.App/Properties/PublishProfiles/LinuxRelease.pubxml create mode 100644 DD.Persistence.App/Properties/PublishProfiles/WindowsRelease.pubxml create mode 100644 DD.Persistence.App/Properties/launchSettings.json create mode 100644 DD.Persistence.App/Readme.md rename {Persistence.API => DD.Persistence.App}/appsettings.Development.json (100%) rename {Persistence.API => DD.Persistence.App}/appsettings.Tests.json (100%) rename {Persistence.API => DD.Persistence.App}/appsettings.json (100%) create mode 100644 DD.Persistence.App/defaultsettings.Development.json create mode 100644 DD.Persistence.App/defaultsettings.Tests.json create mode 100644 DD.Persistence.App/defaultsettings.json rename {Persistence.Client => DD.Persistence.Client}/Clients/Base/BaseClient.cs (91%) rename {Persistence.Client => DD.Persistence.Client}/Clients/ChangeLogClient.cs (94%) rename {Persistence.Client => DD.Persistence.Client}/Clients/DataSourceSystemClient.cs (81%) rename {Persistence.Client => DD.Persistence.Client}/Clients/Interfaces/IChangeLogClient.cs (96%) rename {Persistence.Client => DD.Persistence.Client}/Clients/Interfaces/IDataSourceSystemClient.cs (87%) rename {Persistence.Client => DD.Persistence.Client}/Clients/Interfaces/ISetpointClient.cs (96%) rename {Persistence.Client => DD.Persistence.Client}/Clients/Interfaces/ITechMessagesClient.cs (94%) rename {Persistence.Client => DD.Persistence.Client}/Clients/Interfaces/ITimeSeriesClient.cs (95%) rename {Persistence.Client => DD.Persistence.Client}/Clients/Interfaces/ITimestampedSetClient.cs (96%) rename {Persistence.Client => DD.Persistence.Client}/Clients/Interfaces/IWitsDataClient.cs (95%) rename {Persistence.Client => DD.Persistence.Client}/Clients/Interfaces/Refit/IRefitChangeLogClient.cs (93%) rename {Persistence.Client => DD.Persistence.Client}/Clients/Interfaces/Refit/IRefitDataSourceSystemClient.cs (80%) rename {Persistence.Client => DD.Persistence.Client}/Clients/Interfaces/Refit/IRefitSetpointClient.cs (92%) rename {Persistence.Client => DD.Persistence.Client}/Clients/Interfaces/Refit/IRefitTechMessagesClient.cs (90%) rename {Persistence.Client => DD.Persistence.Client}/Clients/Interfaces/Refit/IRefitTimeSeriesClient.cs (89%) rename {Persistence.Client => DD.Persistence.Client}/Clients/Interfaces/Refit/IRefitTimestampedSetClient.cs (91%) rename {Persistence.Client => DD.Persistence.Client}/Clients/Interfaces/Refit/IRefitWitsDataClient.cs (91%) rename {Persistence.Client => DD.Persistence.Client}/Clients/SetpointClient.cs (90%) rename {Persistence.Client => DD.Persistence.Client}/Clients/TechMessagesClient.cs (89%) rename {Persistence.Client => DD.Persistence.Client}/Clients/TimeSeriesClient.cs (87%) rename {Persistence.Client => DD.Persistence.Client}/Clients/TimestampedSetClient.cs (90%) rename {Persistence.Client => DD.Persistence.Client}/Clients/WitsDataClient.cs (88%) rename {Persistence.Client => DD.Persistence.Client}/CustomExceptions/AcceptableException.cs (77%) rename {Persistence.Client => DD.Persistence.Client}/CustomExceptions/BadGatewayException.cs (76%) rename {Persistence.Client => DD.Persistence.Client}/CustomExceptions/ForbiddenException.cs (76%) rename {Persistence.Client => DD.Persistence.Client}/CustomExceptions/InternalServerException.cs (78%) rename {Persistence.Client => DD.Persistence.Client}/CustomExceptions/LockedException.cs (75%) rename {Persistence.Client => DD.Persistence.Client}/CustomExceptions/ServiceUnavailableException.cs (79%) rename {Persistence.Client => DD.Persistence.Client}/CustomExceptions/TooManyRequestsException.cs (78%) create mode 100644 DD.Persistence.Client/DD.Persistence.Client.csproj rename {Persistence.Client => DD.Persistence.Client}/Helpers/ApiTokenHelper.cs (97%) rename {Persistence.Client => DD.Persistence.Client}/Helpers/ExceptionsHelper.cs (95%) rename {Persistence.Client => DD.Persistence.Client}/PersistenceClientFactory.cs (95%) rename {Persistence.Client => DD.Persistence.Client}/Readme.md (94%) rename Persistence.Database.Postgres/Persistence.Database.Postgres.csproj => DD.Persistence.Database.Postgres/DD.Persistence.Database.Postgres.csproj (87%) rename {Persistence.Database.Postgres => DD.Persistence.Database.Postgres}/DependencyInjection.cs (94%) rename {Persistence.Database.Postgres => DD.Persistence.Database.Postgres}/DesignTimeDbContextFactory.cs (92%) rename {Persistence.Database.Postgres => DD.Persistence.Database.Postgres}/EFExtensionsInitialization.cs (97%) rename {Persistence.Database.Postgres => DD.Persistence.Database.Postgres}/Migrations/20241118052225_SetpointMigration.cs (96%) rename {Persistence.Database.Postgres => DD.Persistence.Database.Postgres}/Migrations/20241126071115_Add_ChangeLog.Designer.cs (96%) rename {Persistence.Database.Postgres => DD.Persistence.Database.Postgres}/Migrations/20241126071115_Add_ChangeLog.cs (97%) rename {Persistence.Database.Postgres => DD.Persistence.Database.Postgres}/Migrations/20241126100631_Init.Designer.cs (94%) rename {Persistence.Database.Postgres => DD.Persistence.Database.Postgres}/Migrations/20241126100631_Init.cs (98%) rename {Persistence.Database.Postgres => DD.Persistence.Database.Postgres}/Migrations/20241203120141_ParameterDataMigration.Designer.cs (92%) rename {Persistence.Database.Postgres => DD.Persistence.Database.Postgres}/Migrations/20241203120141_ParameterDataMigration.cs (96%) rename {Persistence.Database.Postgres => DD.Persistence.Database.Postgres}/Migrations/20241212041758_TechMessageMigration.Designer.cs (93%) rename {Persistence.Database.Postgres => DD.Persistence.Database.Postgres}/Migrations/20241212041758_TechMessageMigration.cs (97%) rename {Persistence.Database.Postgres => DD.Persistence.Database.Postgres}/Migrations/PersistencePostgresContextModelSnapshot.cs (93%) rename {Persistence.Database.Postgres => DD.Persistence.Database.Postgres}/PersistencePostgresContext.cs (92%) create mode 100644 DD.Persistence.Database.Postgres/Readme.md rename Persistence.Database/Persistence.Database.csproj => DD.Persistence.Database/DD.Persistence.Database.csproj (88%) rename {Persistence.Database => DD.Persistence.Database}/EFExtensions.cs (97%) rename {Persistence.Database => DD.Persistence.Database}/Entity/ChangeLog.cs (95%) rename {Persistence.Database => DD.Persistence.Database}/Entity/DataSaub.cs (97%) rename {Persistence.Database => DD.Persistence.Database}/Entity/DataSourceSystem.cs (93%) rename {Persistence.Database => DD.Persistence.Database}/Entity/IChangeLog.cs (96%) rename {Persistence.Database => DD.Persistence.Database}/Entity/ITimestampedData.cs (80%) rename {Persistence.Database => DD.Persistence.Database}/Entity/ParameterData.cs (94%) rename {Persistence.Database => DD.Persistence.Database}/Entity/Setpoint.cs (93%) rename {Persistence.Database => DD.Persistence.Database}/Entity/TechMessage.cs (96%) rename {Persistence.Database => DD.Persistence.Database}/Entity/TimestampedSet.cs (93%) rename {Persistence.Database => DD.Persistence.Database}/PersistenceDbContext.cs (90%) rename {Persistence.IntegrationTests => DD.Persistence.IntegrationTests}/BaseIntegrationTest.cs (84%) rename {Persistence.IntegrationTests => DD.Persistence.IntegrationTests}/Controllers/ChangeLogControllerTest.cs (97%) rename {Persistence.IntegrationTests => DD.Persistence.IntegrationTests}/Controllers/DataSaubControllerTest.cs (93%) rename {Persistence.IntegrationTests => DD.Persistence.IntegrationTests}/Controllers/DataSourceSystemControllerTest.cs (89%) rename {Persistence.IntegrationTests => DD.Persistence.IntegrationTests}/Controllers/SetpointControllerTest.cs (97%) rename {Persistence.IntegrationTests => DD.Persistence.IntegrationTests}/Controllers/TechMessagesControllerTest.cs (96%) rename {Persistence.IntegrationTests => DD.Persistence.IntegrationTests}/Controllers/TimeSeriesBaseControllerTest.cs (95%) rename {Persistence.IntegrationTests => DD.Persistence.IntegrationTests}/Controllers/TimestampedSetControllerTest.cs (97%) rename {Persistence.IntegrationTests => DD.Persistence.IntegrationTests}/Controllers/WitsDataControllerTest.cs (96%) rename Persistence.IntegrationTests/Persistence.IntegrationTests.csproj => DD.Persistence.IntegrationTests/DD.Persistence.IntegrationTests.csproj (76%) rename {Persistence.IntegrationTests => DD.Persistence.IntegrationTests}/DbConnection.cs (89%) rename {Persistence.IntegrationTests => DD.Persistence.IntegrationTests}/EFCoreExtensions.cs (87%) rename {Persistence.IntegrationTests => DD.Persistence.IntegrationTests}/TestHttpClientFactory.cs (91%) rename {Persistence.IntegrationTests => DD.Persistence.IntegrationTests}/WebAppFactoryFixture.cs (92%) rename {Persistence.Repository => DD.Persistence.Repository}/CyclicArray.cs (99%) rename Persistence.Repository/Persistence.Repository.csproj => DD.Persistence.Repository/DD.Persistence.Repository.csproj (70%) rename {Persistence.Repository => DD.Persistence.Repository}/DependencyInjection.cs (88%) rename {Persistence.Repository => DD.Persistence.Repository}/Extensions/EFExtensionsSortBy.cs (99%) rename {Persistence.Repository => DD.Persistence.Repository}/QueryBuilders.cs (94%) rename {Persistence.Repository => DD.Persistence.Repository}/Repositories/ChangeLogRepository.cs (97%) rename {Persistence.Repository => DD.Persistence.Repository}/Repositories/DataSourceSystemCachedRepository.cs (94%) create mode 100644 DD.Persistence.Repository/Repositories/DataSourceSystemRepository.cs rename {Persistence.Repository => DD.Persistence.Repository}/Repositories/ParameterRepository.cs (94%) rename {Persistence.Repository => DD.Persistence.Repository}/Repositories/SetpointRepository.cs (95%) rename {Persistence.Repository => DD.Persistence.Repository}/Repositories/TechMessagesRepository.cs (96%) rename {Persistence.Repository => DD.Persistence.Repository}/Repositories/TimeSeriesDataCachedRepository.cs (96%) rename {Persistence.Repository => DD.Persistence.Repository}/Repositories/TimeSeriesDataRepository.cs (94%) rename {Persistence.Repository => DD.Persistence.Repository}/Repositories/TimestampedSetRepository.cs (96%) rename {Persistence => DD.Persistence}/API/IChangeLogApi.cs (97%) rename {Persistence => DD.Persistence}/API/ISetpointApi.cs (97%) rename {Persistence => DD.Persistence}/API/ISyncApi.cs (94%) rename {Persistence => DD.Persistence}/API/ISyncWithDiscriminatorApi.cs (95%) rename {Persistence => DD.Persistence}/API/ITimeSeriesBaseDataApi.cs (97%) rename {Persistence => DD.Persistence}/API/ITimeSeriesDataApi.cs (93%) rename {Persistence => DD.Persistence}/API/IWitsDataApi.cs (94%) rename Persistence/Persistence.csproj => DD.Persistence/DD.Persistence.csproj (91%) rename {Persistence => DD.Persistence}/EFExtensions.cs (99%) rename {Persistence => DD.Persistence}/Factories/IAuthTokenFactory.cs (86%) rename {Persistence => DD.Persistence}/Models/ChangeLogDto.cs (96%) rename {Persistence => DD.Persistence}/Models/Configurations/AuthUser.cs (86%) rename {Persistence => DD.Persistence}/Models/Configurations/JwtParams.cs (91%) rename {Persistence => DD.Persistence}/Models/Configurations/JwtToken.cs (79%) rename {Persistence => DD.Persistence}/Models/Configurations/WitsInfo.cs (68%) rename {Persistence => DD.Persistence}/Models/DataSaubDto.cs (96%) rename {Persistence => DD.Persistence}/Models/DataSourceSystemDto.cs (93%) rename {Persistence => DD.Persistence}/Models/DataWithWellDepthAndSectionDto.cs (96%) rename {Persistence => DD.Persistence}/Models/DatesRangeDto.cs (90%) rename {Persistence => DD.Persistence}/Models/Enumerations/EventState.cs (55%) rename {Persistence => DD.Persistence}/Models/Enumerations/WitsType.cs (90%) rename {Persistence => DD.Persistence}/Models/ITimeSeriesAbstractDto.cs (88%) rename {Persistence => DD.Persistence}/Models/IWithSectionPart.cs (82%) rename {Persistence => DD.Persistence}/Models/MessagesStatisticDto.cs (93%) rename {Persistence => DD.Persistence}/Models/PaginationContainer.cs (96%) rename {Persistence => DD.Persistence}/Models/ParameterDto.cs (96%) rename {Persistence => DD.Persistence}/Models/Requests/PaginationRequest.cs (95%) rename {Persistence => DD.Persistence}/Models/Requests/SectionPartRequest.cs (92%) rename {Persistence => DD.Persistence}/Models/SetpointLogDto.cs (92%) rename {Persistence => DD.Persistence}/Models/SetpointValueDto.cs (92%) rename {Persistence => DD.Persistence}/Models/TechMessageDto.cs (93%) rename {Persistence => DD.Persistence}/Models/TimestampedSetDto.cs (89%) rename {Persistence => DD.Persistence}/Models/WitsDataDto.cs (93%) rename {Persistence => DD.Persistence}/Models/WitsValueDto.cs (95%) rename {Persistence => DD.Persistence}/Repositories/IChangeLogRepository.cs (97%) rename {Persistence => DD.Persistence}/Repositories/IDataSourceSystemRepository.cs (89%) rename {Persistence => DD.Persistence}/Repositories/IParameterRepository.cs (95%) rename {Persistence => DD.Persistence}/Repositories/ISetpointRepository.cs (97%) rename {Persistence => DD.Persistence}/Repositories/ISyncRepository.cs (91%) rename {Persistence => DD.Persistence}/Repositories/ISyncWithDiscriminatorRepository.cs (93%) rename {Persistence => DD.Persistence}/Repositories/ITechMessagesRepository.cs (95%) rename {Persistence => DD.Persistence}/Repositories/ITimeSeriesBaseRepository.cs (93%) rename {Persistence => DD.Persistence}/Repositories/ITimeSeriesDataRepository.cs (88%) rename {Persistence => DD.Persistence}/Repositories/ITimestampedSetRepository.cs (97%) rename {Persistence => DD.Persistence}/Services/Config/WitsConfig.json (100%) rename {Persistence => DD.Persistence}/Services/Interfaces/IArchiveService.cs (93%) rename {Persistence => DD.Persistence}/Services/Interfaces/IWitsDataService.cs (95%) rename {Persistence => DD.Persistence}/Services/WitsDataService.cs (95%) diff --git a/Persistence.API/Controllers/ChangeLogController.cs b/DD.Persistence.API/Controllers/ChangeLogController.cs similarity index 97% rename from Persistence.API/Controllers/ChangeLogController.cs rename to DD.Persistence.API/Controllers/ChangeLogController.cs index 72f0b08..21761e1 100644 --- a/Persistence.API/Controllers/ChangeLogController.cs +++ b/DD.Persistence.API/Controllers/ChangeLogController.cs @@ -1,11 +1,11 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Persistence.Models; -using Persistence.Models.Requests; -using Persistence.Repositories; +using DD.Persistence.Models; +using DD.Persistence.Models.Requests; +using DD.Persistence.Repositories; using System.Net; -namespace Persistence.API.Controllers; +namespace DD.Persistence.API.Controllers; [ApiController] [Authorize] diff --git a/Persistence.API/Controllers/DataSaubController.cs b/DD.Persistence.API/Controllers/DataSaubController.cs similarity index 80% rename from Persistence.API/Controllers/DataSaubController.cs rename to DD.Persistence.API/Controllers/DataSaubController.cs index 715b1ef..832faec 100644 --- a/Persistence.API/Controllers/DataSaubController.cs +++ b/DD.Persistence.API/Controllers/DataSaubController.cs @@ -1,9 +1,9 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Persistence.Models; -using Persistence.Repositories; +using DD.Persistence.Models; +using DD.Persistence.Repositories; -namespace Persistence.API.Controllers; +namespace DD.Persistence.API.Controllers; /// /// Работа с временными данными diff --git a/Persistence.API/Controllers/DataSourceSystemController.cs b/DD.Persistence.API/Controllers/DataSourceSystemController.cs similarity index 92% rename from Persistence.API/Controllers/DataSourceSystemController.cs rename to DD.Persistence.API/Controllers/DataSourceSystemController.cs index 599c11e..896af1f 100644 --- a/Persistence.API/Controllers/DataSourceSystemController.cs +++ b/DD.Persistence.API/Controllers/DataSourceSystemController.cs @@ -1,10 +1,10 @@ using System.Net; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Persistence.Models; -using Persistence.Repositories; +using DD.Persistence.Models; +using DD.Persistence.Repositories; -namespace Persistence.API.Controllers; +namespace DD.Persistence.API.Controllers; /// /// Работа с системами diff --git a/Persistence.API/Controllers/SetpointController.cs b/DD.Persistence.API/Controllers/SetpointController.cs similarity index 97% rename from Persistence.API/Controllers/SetpointController.cs rename to DD.Persistence.API/Controllers/SetpointController.cs index 0ff6878..e3b8b14 100644 --- a/Persistence.API/Controllers/SetpointController.cs +++ b/DD.Persistence.API/Controllers/SetpointController.cs @@ -1,10 +1,10 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Persistence.Models; -using Persistence.Repositories; +using DD.Persistence.Models; +using DD.Persistence.Repositories; using System.Net; -namespace Persistence.API.Controllers; +namespace DD.Persistence.API.Controllers; /// /// Работа с уставками diff --git a/Persistence.API/Controllers/TechMessagesController.cs b/DD.Persistence.API/Controllers/TechMessagesController.cs similarity index 96% rename from Persistence.API/Controllers/TechMessagesController.cs rename to DD.Persistence.API/Controllers/TechMessagesController.cs index 50481a0..81663e0 100644 --- a/Persistence.API/Controllers/TechMessagesController.cs +++ b/DD.Persistence.API/Controllers/TechMessagesController.cs @@ -1,11 +1,11 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Persistence.Models; -using Persistence.Models.Requests; -using Persistence.Repositories; +using DD.Persistence.Models; +using DD.Persistence.Models.Requests; +using DD.Persistence.Repositories; using System.Net; -namespace Persistence.API.Controllers; +namespace DD.Persistence.API.Controllers; /// /// Работа с технологическими сообщениями систем автобурения (АБ) diff --git a/Persistence.API/Controllers/TimeSeriesController.cs b/DD.Persistence.API/Controllers/TimeSeriesController.cs similarity index 96% rename from Persistence.API/Controllers/TimeSeriesController.cs rename to DD.Persistence.API/Controllers/TimeSeriesController.cs index f13c641..5fded36 100644 --- a/Persistence.API/Controllers/TimeSeriesController.cs +++ b/DD.Persistence.API/Controllers/TimeSeriesController.cs @@ -1,9 +1,9 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Persistence.Models; -using Persistence.Repositories; +using DD.Persistence.Models; +using DD.Persistence.Repositories; -namespace Persistence.API.Controllers; +namespace DD.Persistence.API.Controllers; [ApiController] [Authorize] diff --git a/Persistence.API/Controllers/TimestampedSetController.cs b/DD.Persistence.API/Controllers/TimestampedSetController.cs similarity index 97% rename from Persistence.API/Controllers/TimestampedSetController.cs rename to DD.Persistence.API/Controllers/TimestampedSetController.cs index 4687e72..0c805ab 100644 --- a/Persistence.API/Controllers/TimestampedSetController.cs +++ b/DD.Persistence.API/Controllers/TimestampedSetController.cs @@ -1,10 +1,10 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Persistence.Models; -using Persistence.Repositories; +using DD.Persistence.Models; +using DD.Persistence.Repositories; using System.Net; -namespace Persistence.API.Controllers; +namespace DD.Persistence.API.Controllers; /// /// Хранение наборов данных с отметкой времени. diff --git a/Persistence.API/Controllers/WitsDataController.cs b/DD.Persistence.API/Controllers/WitsDataController.cs similarity index 96% rename from Persistence.API/Controllers/WitsDataController.cs rename to DD.Persistence.API/Controllers/WitsDataController.cs index 9e855b7..5df6c3f 100644 --- a/Persistence.API/Controllers/WitsDataController.cs +++ b/DD.Persistence.API/Controllers/WitsDataController.cs @@ -1,10 +1,10 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Persistence.Models; -using Persistence.Services.Interfaces; +using DD.Persistence.Models; +using DD.Persistence.Services.Interfaces; using System.Net; -namespace Persistence.API.Controllers; +namespace DD.Persistence.API.Controllers; /// /// Работа с параметрами Wits diff --git a/Persistence.API/Persistence.API.csproj b/DD.Persistence.API/DD.Persistence.API.csproj similarity index 61% rename from Persistence.API/Persistence.API.csproj rename to DD.Persistence.API/DD.Persistence.API.csproj index fa3b7ad..5f4159b 100644 --- a/Persistence.API/Persistence.API.csproj +++ b/DD.Persistence.API/DD.Persistence.API.csproj @@ -1,17 +1,18 @@ - + net8.0 enable enable Linux - True - $(NoWarn);1591 + true + $(NoWarn);1591 1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH)) 1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH)) + Library @@ -22,9 +23,10 @@ - - - + + + + diff --git a/Persistence.API/DependencyInjection.cs b/DD.Persistence.API/DependencyInjection.cs similarity index 97% rename from Persistence.API/DependencyInjection.cs rename to DD.Persistence.API/DependencyInjection.cs index d2960af..d009aae 100644 --- a/Persistence.API/DependencyInjection.cs +++ b/DD.Persistence.API/DependencyInjection.cs @@ -3,16 +3,16 @@ using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.IdentityModel.Tokens; using Microsoft.OpenApi.Any; using Microsoft.OpenApi.Models; -using Persistence.Database.Entity; -using Persistence.Models; -using Persistence.Models.Configurations; -using Persistence.Services; -using Persistence.Services.Interfaces; +using DD.Persistence.Models; +using DD.Persistence.Models.Configurations; +using DD.Persistence.Services; +using DD.Persistence.Services.Interfaces; using Swashbuckle.AspNetCore.SwaggerGen; using System.Reflection; using System.Text.Json.Nodes; +using DD.Persistence.Database.Entity; -namespace Persistence.API; +namespace DD.Persistence.API; public static class DependencyInjection { diff --git a/Persistence.API/Extensions.cs b/DD.Persistence.API/Extensions.cs similarity index 95% rename from Persistence.API/Extensions.cs rename to DD.Persistence.API/Extensions.cs index 5fa9fd4..a1e070a 100644 --- a/Persistence.API/Extensions.cs +++ b/DD.Persistence.API/Extensions.cs @@ -1,7 +1,7 @@ using System.ComponentModel; using System.Security.Claims; -namespace Persistence.API; +namespace DD.Persistence.API; public static class Extensions { diff --git a/Persistence.API/Properties/launchSettings.json b/DD.Persistence.API/Properties/launchSettings.json similarity index 100% rename from Persistence.API/Properties/launchSettings.json rename to DD.Persistence.API/Properties/launchSettings.json diff --git a/Persistence.API/Startup.cs b/DD.Persistence.API/Startup.cs similarity index 91% rename from Persistence.API/Startup.cs rename to DD.Persistence.API/Startup.cs index 2b522bd..09e4a21 100644 --- a/Persistence.API/Startup.cs +++ b/DD.Persistence.API/Startup.cs @@ -1,8 +1,8 @@ -using Persistence.Database.Model; -using Persistence.Database.Postgres; -using Persistence.Repository; +using DD.Persistence.Database.Model; +using DD.Persistence.Database.Postgres; +using DD.Persistence.Repository; -namespace Persistence.API; +namespace DD.Persistence.API; public class Startup { diff --git a/DD.Persistence.App/.config/dotnet-tools.json b/DD.Persistence.App/.config/dotnet-tools.json new file mode 100644 index 0000000..b0e38ab --- /dev/null +++ b/DD.Persistence.App/.config/dotnet-tools.json @@ -0,0 +1,5 @@ +{ + "version": 1, + "isRoot": true, + "tools": {} +} \ No newline at end of file diff --git a/DD.Persistence.App/DD.Persistence.App.csproj b/DD.Persistence.App/DD.Persistence.App.csproj new file mode 100644 index 0000000..3985241 --- /dev/null +++ b/DD.Persistence.App/DD.Persistence.App.csproj @@ -0,0 +1,26 @@ + + + + net8.0 + enable + enable + 8dcdcfed-c959-4eef-9891-ae60b1b136ea + Linux + + + + <_WebToolingArtifacts Remove="Properties\PublishProfiles\LinuxRelease.pubxml" /> + <_WebToolingArtifacts Remove="Properties\PublishProfiles\WindowsRelease.pubxml" /> + + + + + + + + + + + + + diff --git a/Persistence.API/Dockerfile b/DD.Persistence.App/Dockerfile similarity index 52% rename from Persistence.API/Dockerfile rename to DD.Persistence.App/Dockerfile index bb9a0d6..015ce03 100644 --- a/Persistence.API/Dockerfile +++ b/DD.Persistence.App/Dockerfile @@ -4,21 +4,22 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base USER app WORKDIR /app EXPOSE 8080 +EXPOSE 8081 FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build ARG BUILD_CONFIGURATION=Release WORKDIR /src -COPY ["Persistence.API/Persistence.API.csproj", "Persistence.API/"] -RUN dotnet restore "./Persistence.API/Persistence.API.csproj" +COPY ["DD.Persistence.App/DD.Persistence.App.csproj", "DD.Persistence.App/"] +RUN dotnet restore "./DD.Persistence.App/DD.Persistence.App.csproj" COPY . . -WORKDIR "/src/Persistence.API" -RUN dotnet build "./Persistence.API.csproj" -c $BUILD_CONFIGURATION -o /app/build +WORKDIR "/src/DD.Persistence.App" +RUN dotnet build "./DD.Persistence.App.csproj" -c $BUILD_CONFIGURATION -o /app/build FROM build AS publish ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "./Persistence.API.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false +RUN dotnet publish "./DD.Persistence.App.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "Persistence.API.dll"] \ No newline at end of file +ENTRYPOINT ["dotnet", "DD.Persistence.App.dll"] \ No newline at end of file diff --git a/Persistence.API/Program.cs b/DD.Persistence.App/Program.cs similarity index 88% rename from Persistence.API/Program.cs rename to DD.Persistence.App/Program.cs index bb6e9a7..2477352 100644 --- a/Persistence.API/Program.cs +++ b/DD.Persistence.App/Program.cs @@ -1,4 +1,7 @@ -namespace Persistence.API; + +using DD.Persistence.API; + +namespace DD.Persistence.App; public class Program { diff --git a/DD.Persistence.App/Properties/PublishProfiles/LinuxRelease.pubxml b/DD.Persistence.App/Properties/PublishProfiles/LinuxRelease.pubxml new file mode 100644 index 0000000..0b476ba --- /dev/null +++ b/DD.Persistence.App/Properties/PublishProfiles/LinuxRelease.pubxml @@ -0,0 +1,22 @@ + + + + + true + false + true + Release + Any CPU + FileSystem + bin\Release\net8.0\publish\ + FileSystem + <_TargetId>Folder + + net8.0 + linux-x64 + 063238bf-e982-43fa-9ddb-7d7d279086d8 + true + + \ No newline at end of file diff --git a/DD.Persistence.App/Properties/PublishProfiles/WindowsRelease.pubxml b/DD.Persistence.App/Properties/PublishProfiles/WindowsRelease.pubxml new file mode 100644 index 0000000..139caca --- /dev/null +++ b/DD.Persistence.App/Properties/PublishProfiles/WindowsRelease.pubxml @@ -0,0 +1,22 @@ + + + + + true + false + true + Release + Any CPU + FileSystem + bin\Release\net8.0\publish\ + FileSystem + <_TargetId>Folder + + net8.0 + win-x64 + 063238bf-e982-43fa-9ddb-7d7d279086d8 + false + + \ No newline at end of file diff --git a/DD.Persistence.App/Properties/launchSettings.json b/DD.Persistence.App/Properties/launchSettings.json new file mode 100644 index 0000000..bc27d22 --- /dev/null +++ b/DD.Persistence.App/Properties/launchSettings.json @@ -0,0 +1,52 @@ +{ + "profiles": { + "http": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5266" + }, + "https": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true, + "applicationUrl": "https://localhost:7154;http://localhost:5266" + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Container (Dockerfile)": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "environmentVariables": { + "ASPNETCORE_HTTPS_PORTS": "8081", + "ASPNETCORE_HTTP_PORTS": "8080" + }, + "publishAllPorts": true, + "useSSL": true + } + }, + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:54958", + "sslPort": 44352 + } + } +} \ No newline at end of file diff --git a/DD.Persistence.App/Readme.md b/DD.Persistence.App/Readme.md new file mode 100644 index 0000000..987a2bf --- /dev/null +++ b/DD.Persistence.App/Readme.md @@ -0,0 +1,30 @@ +# DD.Persistence.App Readme +## Краткое описание DD.Persistence.App сервиса +DD.Persistence.App - проект исполняемого файла микросервиса + +## Настройка DD.Persistence.App (файл appsettings.json) +- `appsettings.json` - файл с настройками проекта. + +### Подключение к БД +- Настройки подключения к базе хранятся в свойстве `DefaultConnection` секции `ConnectionStrings` +файла `appsettings.json`, где: + - Host - название или ip хоста; + - Database - название базы данных; + - Username - пользователь базы данных; + - Password - пароль базы данных; +- Больше информации о настройке подключения к postgreSQL можно прочесть по ссылке: +```https://www.npgsql.org/doc/connection-string-parameters.html``` + +### Авторизация +1. В проекте предусмотрены 2 типа авторизации: +- Авторизация через KeyCloak. Используется в продакшен версии. +- Авторизация через Jwt-токен. Используется для разработки и тестирования. +2. Для включения авторизации через KeyCloak необходимо: +- Установить секцию `NeedUseKeyCloak` файла `appsettings.json` в `true` +- По необходимости настроить свойства секции `Authentication` файла `appsettings.json` + +### defaultsettings.json +Копия файла `appsettings.json` хранится в файле `defaultsettings.json` + + + diff --git a/Persistence.API/appsettings.Development.json b/DD.Persistence.App/appsettings.Development.json similarity index 100% rename from Persistence.API/appsettings.Development.json rename to DD.Persistence.App/appsettings.Development.json diff --git a/Persistence.API/appsettings.Tests.json b/DD.Persistence.App/appsettings.Tests.json similarity index 100% rename from Persistence.API/appsettings.Tests.json rename to DD.Persistence.App/appsettings.Tests.json diff --git a/Persistence.API/appsettings.json b/DD.Persistence.App/appsettings.json similarity index 100% rename from Persistence.API/appsettings.json rename to DD.Persistence.App/appsettings.json diff --git a/DD.Persistence.App/defaultsettings.Development.json b/DD.Persistence.App/defaultsettings.Development.json new file mode 100644 index 0000000..896c0b7 --- /dev/null +++ b/DD.Persistence.App/defaultsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "NeedUseKeyCloak": false +} diff --git a/DD.Persistence.App/defaultsettings.Tests.json b/DD.Persistence.App/defaultsettings.Tests.json new file mode 100644 index 0000000..6201a8f --- /dev/null +++ b/DD.Persistence.App/defaultsettings.Tests.json @@ -0,0 +1,16 @@ +{ + "DbConnection": { + "Host": "localhost", + "Port": 5432, + "Username": "postgres", + "Password": "q" + }, + "NeedUseKeyCloak": false, + "AuthUser": { + "username": "myuser", + "password": 12345, + "clientId": "webapi", + "grantType": "password" + }, + "KeycloakGetTokenUrl": "http://192.168.0.10:8321/realms/Persistence/protocol/openid-connect/token" +} diff --git a/DD.Persistence.App/defaultsettings.json b/DD.Persistence.App/defaultsettings.json new file mode 100644 index 0000000..d4248fb --- /dev/null +++ b/DD.Persistence.App/defaultsettings.json @@ -0,0 +1,26 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "ConnectionStrings": { + "DefaultConnection": "Host=localhost;Database=persistence;Username=postgres;Password=q;Persist Security Info=True" + }, + "AllowedHosts": "*", + "Authentication": { + "MetadataAddress": "http://192.168.0.10:8321/realms/Persistence/.well-known/openid-configuration", + "Audience": "account", + "ValidIssuer": "http://192.168.0.10:8321/realms/Persistence", + "AuthorizationUrl": "http://192.168.0.10:8321/realms/Persistence/protocol/openid-connect/auth" + }, + "NeedUseKeyCloak": false, + "AuthUser": { + "username": "myuser", + "password": 12345, + "clientId": "webapi", + "grantType": "password", + "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier": "7d9f3574-6574-4ca3-845a-0276eb4aa8f6" + } +} diff --git a/Persistence.Client/Clients/Base/BaseClient.cs b/DD.Persistence.Client/Clients/Base/BaseClient.cs similarity index 91% rename from Persistence.Client/Clients/Base/BaseClient.cs rename to DD.Persistence.Client/Clients/Base/BaseClient.cs index c29cf14..3b13cdb 100644 --- a/Persistence.Client/Clients/Base/BaseClient.cs +++ b/DD.Persistence.Client/Clients/Base/BaseClient.cs @@ -1,8 +1,8 @@ -using Microsoft.Extensions.Logging; -using Persistence.Client.Helpers; +using DD.Persistence.Client.Helpers; +using Microsoft.Extensions.Logging; using Refit; -namespace Persistence.Client.Clients.Base; +namespace DD.Persistence.Client.Clients.Base; public abstract class BaseClient { private readonly ILogger logger; diff --git a/Persistence.Client/Clients/ChangeLogClient.cs b/DD.Persistence.Client/Clients/ChangeLogClient.cs similarity index 94% rename from Persistence.Client/Clients/ChangeLogClient.cs rename to DD.Persistence.Client/Clients/ChangeLogClient.cs index 78c71a7..e10008e 100644 --- a/Persistence.Client/Clients/ChangeLogClient.cs +++ b/DD.Persistence.Client/Clients/ChangeLogClient.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Persistence.Client.Clients.Base; -using Persistence.Client.Clients.Interfaces; -using Persistence.Models; -using Persistence.Models.Requests; +using DD.Persistence.Client.Clients.Base; +using DD.Persistence.Client.Clients.Interfaces; +using DD.Persistence.Models; +using DD.Persistence.Models.Requests; -namespace Persistence.Client.Clients; +namespace DD.Persistence.Client.Clients; public class ChangeLogClient : BaseClient, IChangeLogClient { private readonly Interfaces.Refit.IRefitChangeLogClient refitChangeLogClient; diff --git a/Persistence.Client/Clients/DataSourceSystemClient.cs b/DD.Persistence.Client/Clients/DataSourceSystemClient.cs similarity index 81% rename from Persistence.Client/Clients/DataSourceSystemClient.cs rename to DD.Persistence.Client/Clients/DataSourceSystemClient.cs index 25ec605..45e2d29 100644 --- a/Persistence.Client/Clients/DataSourceSystemClient.cs +++ b/DD.Persistence.Client/Clients/DataSourceSystemClient.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Persistence.Client.Clients.Base; -using Persistence.Client.Clients.Interfaces; -using Persistence.Client.Clients.Interfaces.Refit; -using Persistence.Models; +using DD.Persistence.Client.Clients.Base; +using DD.Persistence.Client.Clients.Interfaces; +using DD.Persistence.Client.Clients.Interfaces.Refit; +using DD.Persistence.Models; -namespace Persistence.Client.Clients; +namespace DD.Persistence.Client.Clients; public class DataSourceSystemClient : BaseClient, IDataSourceSystemClient { private readonly IRefitDataSourceSystemClient dataSourceSystemClient; diff --git a/Persistence.Client/Clients/Interfaces/IChangeLogClient.cs b/DD.Persistence.Client/Clients/Interfaces/IChangeLogClient.cs similarity index 96% rename from Persistence.Client/Clients/Interfaces/IChangeLogClient.cs rename to DD.Persistence.Client/Clients/Interfaces/IChangeLogClient.cs index 0d24585..19edeab 100644 --- a/Persistence.Client/Clients/Interfaces/IChangeLogClient.cs +++ b/DD.Persistence.Client/Clients/Interfaces/IChangeLogClient.cs @@ -1,7 +1,7 @@ -using Persistence.Models; -using Persistence.Models.Requests; +using DD.Persistence.Models; +using DD.Persistence.Models.Requests; -namespace Persistence.Client.Clients.Interfaces; +namespace DD.Persistence.Client.Clients.Interfaces; /// /// Клиент для работы с записями ChangeLog diff --git a/Persistence.Client/Clients/Interfaces/IDataSourceSystemClient.cs b/DD.Persistence.Client/Clients/Interfaces/IDataSourceSystemClient.cs similarity index 87% rename from Persistence.Client/Clients/Interfaces/IDataSourceSystemClient.cs rename to DD.Persistence.Client/Clients/Interfaces/IDataSourceSystemClient.cs index fc25412..618cef6 100644 --- a/Persistence.Client/Clients/Interfaces/IDataSourceSystemClient.cs +++ b/DD.Persistence.Client/Clients/Interfaces/IDataSourceSystemClient.cs @@ -1,7 +1,7 @@ -using Persistence.Models; +using DD.Persistence.Models; using Refit; -namespace Persistence.Client.Clients.Interfaces; +namespace DD.Persistence.Client.Clients.Interfaces; /// /// Клиент для работы с системами diff --git a/Persistence.Client/Clients/Interfaces/ISetpointClient.cs b/DD.Persistence.Client/Clients/Interfaces/ISetpointClient.cs similarity index 96% rename from Persistence.Client/Clients/Interfaces/ISetpointClient.cs rename to DD.Persistence.Client/Clients/Interfaces/ISetpointClient.cs index 295ab87..86462ea 100644 --- a/Persistence.Client/Clients/Interfaces/ISetpointClient.cs +++ b/DD.Persistence.Client/Clients/Interfaces/ISetpointClient.cs @@ -1,6 +1,6 @@ -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.Client.Clients.Interfaces; +namespace DD.Persistence.Client.Clients.Interfaces; /// /// Клиент для работы с уставками diff --git a/Persistence.Client/Clients/Interfaces/ITechMessagesClient.cs b/DD.Persistence.Client/Clients/Interfaces/ITechMessagesClient.cs similarity index 94% rename from Persistence.Client/Clients/Interfaces/ITechMessagesClient.cs rename to DD.Persistence.Client/Clients/Interfaces/ITechMessagesClient.cs index 5545dad..a27e553 100644 --- a/Persistence.Client/Clients/Interfaces/ITechMessagesClient.cs +++ b/DD.Persistence.Client/Clients/Interfaces/ITechMessagesClient.cs @@ -1,7 +1,7 @@ -using Persistence.Models; -using Persistence.Models.Requests; +using DD.Persistence.Models; +using DD.Persistence.Models.Requests; -namespace Persistence.Client.Clients.Interfaces; +namespace DD.Persistence.Client.Clients.Interfaces; /// /// Клиент для работы с технологическими сообщениями diff --git a/Persistence.Client/Clients/Interfaces/ITimeSeriesClient.cs b/DD.Persistence.Client/Clients/Interfaces/ITimeSeriesClient.cs similarity index 95% rename from Persistence.Client/Clients/Interfaces/ITimeSeriesClient.cs rename to DD.Persistence.Client/Clients/Interfaces/ITimeSeriesClient.cs index 316c0c9..26bbfa6 100644 --- a/Persistence.Client/Clients/Interfaces/ITimeSeriesClient.cs +++ b/DD.Persistence.Client/Clients/Interfaces/ITimeSeriesClient.cs @@ -1,6 +1,6 @@ -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.Client.Clients.Interfaces; +namespace DD.Persistence.Client.Clients.Interfaces; /// /// Клиент для работы с временными данными diff --git a/Persistence.Client/Clients/Interfaces/ITimestampedSetClient.cs b/DD.Persistence.Client/Clients/Interfaces/ITimestampedSetClient.cs similarity index 96% rename from Persistence.Client/Clients/Interfaces/ITimestampedSetClient.cs rename to DD.Persistence.Client/Clients/Interfaces/ITimestampedSetClient.cs index 21fd222..be98a77 100644 --- a/Persistence.Client/Clients/Interfaces/ITimestampedSetClient.cs +++ b/DD.Persistence.Client/Clients/Interfaces/ITimestampedSetClient.cs @@ -1,6 +1,6 @@ -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.Client.Clients.Interfaces; +namespace DD.Persistence.Client.Clients.Interfaces; /// /// Клиент для работы с репозиторием для хранения разных наборов данных рядов. diff --git a/Persistence.Client/Clients/Interfaces/IWitsDataClient.cs b/DD.Persistence.Client/Clients/Interfaces/IWitsDataClient.cs similarity index 95% rename from Persistence.Client/Clients/Interfaces/IWitsDataClient.cs rename to DD.Persistence.Client/Clients/Interfaces/IWitsDataClient.cs index e0fee60..e954484 100644 --- a/Persistence.Client/Clients/Interfaces/IWitsDataClient.cs +++ b/DD.Persistence.Client/Clients/Interfaces/IWitsDataClient.cs @@ -1,7 +1,7 @@ -using Persistence.Models; +using DD.Persistence.Models; using Refit; -namespace Persistence.Client.Clients.Interfaces; +namespace DD.Persistence.Client.Clients.Interfaces; /// /// Клиент для работы с параметрами Wits diff --git a/Persistence.Client/Clients/Interfaces/Refit/IRefitChangeLogClient.cs b/DD.Persistence.Client/Clients/Interfaces/Refit/IRefitChangeLogClient.cs similarity index 93% rename from Persistence.Client/Clients/Interfaces/Refit/IRefitChangeLogClient.cs rename to DD.Persistence.Client/Clients/Interfaces/Refit/IRefitChangeLogClient.cs index c7a7bc1..958e24e 100644 --- a/Persistence.Client/Clients/Interfaces/Refit/IRefitChangeLogClient.cs +++ b/DD.Persistence.Client/Clients/Interfaces/Refit/IRefitChangeLogClient.cs @@ -1,8 +1,8 @@ -using Persistence.Models; -using Persistence.Models.Requests; +using DD.Persistence.Models; +using DD.Persistence.Models.Requests; using Refit; -namespace Persistence.Client.Clients.Interfaces.Refit; +namespace DD.Persistence.Client.Clients.Interfaces.Refit; public interface IRefitChangeLogClient : IDisposable { diff --git a/Persistence.Client/Clients/Interfaces/Refit/IRefitDataSourceSystemClient.cs b/DD.Persistence.Client/Clients/Interfaces/Refit/IRefitDataSourceSystemClient.cs similarity index 80% rename from Persistence.Client/Clients/Interfaces/Refit/IRefitDataSourceSystemClient.cs rename to DD.Persistence.Client/Clients/Interfaces/Refit/IRefitDataSourceSystemClient.cs index ba20504..a4b47eb 100644 --- a/Persistence.Client/Clients/Interfaces/Refit/IRefitDataSourceSystemClient.cs +++ b/DD.Persistence.Client/Clients/Interfaces/Refit/IRefitDataSourceSystemClient.cs @@ -1,7 +1,7 @@ -using Persistence.Models; +using DD.Persistence.Models; using Refit; -namespace Persistence.Client.Clients.Interfaces.Refit; +namespace DD.Persistence.Client.Clients.Interfaces.Refit; public interface IRefitDataSourceSystemClient : IDisposable { private const string BaseRoute = "/api/dataSourceSystem"; diff --git a/Persistence.Client/Clients/Interfaces/Refit/IRefitSetpointClient.cs b/DD.Persistence.Client/Clients/Interfaces/Refit/IRefitSetpointClient.cs similarity index 92% rename from Persistence.Client/Clients/Interfaces/Refit/IRefitSetpointClient.cs rename to DD.Persistence.Client/Clients/Interfaces/Refit/IRefitSetpointClient.cs index 69a2719..b6e021a 100644 --- a/Persistence.Client/Clients/Interfaces/Refit/IRefitSetpointClient.cs +++ b/DD.Persistence.Client/Clients/Interfaces/Refit/IRefitSetpointClient.cs @@ -1,7 +1,7 @@ -using Persistence.Models; +using DD.Persistence.Models; using Refit; -namespace Persistence.Client.Clients.Interfaces.Refit; +namespace DD.Persistence.Client.Clients.Interfaces.Refit; public interface IRefitSetpointClient : IDisposable { diff --git a/Persistence.Client/Clients/Interfaces/Refit/IRefitTechMessagesClient.cs b/DD.Persistence.Client/Clients/Interfaces/Refit/IRefitTechMessagesClient.cs similarity index 90% rename from Persistence.Client/Clients/Interfaces/Refit/IRefitTechMessagesClient.cs rename to DD.Persistence.Client/Clients/Interfaces/Refit/IRefitTechMessagesClient.cs index 3e4cd10..2638600 100644 --- a/Persistence.Client/Clients/Interfaces/Refit/IRefitTechMessagesClient.cs +++ b/DD.Persistence.Client/Clients/Interfaces/Refit/IRefitTechMessagesClient.cs @@ -1,9 +1,9 @@ using Microsoft.AspNetCore.Mvc; -using Persistence.Models; -using Persistence.Models.Requests; +using DD.Persistence.Models; +using DD.Persistence.Models.Requests; using Refit; -namespace Persistence.Client.Clients.Interfaces.Refit +namespace DD.Persistence.Client.Clients.Interfaces.Refit { public interface IRefitTechMessagesClient : IDisposable { diff --git a/Persistence.Client/Clients/Interfaces/Refit/IRefitTimeSeriesClient.cs b/DD.Persistence.Client/Clients/Interfaces/Refit/IRefitTimeSeriesClient.cs similarity index 89% rename from Persistence.Client/Clients/Interfaces/Refit/IRefitTimeSeriesClient.cs rename to DD.Persistence.Client/Clients/Interfaces/Refit/IRefitTimeSeriesClient.cs index 79135e1..2edc8fe 100644 --- a/Persistence.Client/Clients/Interfaces/Refit/IRefitTimeSeriesClient.cs +++ b/DD.Persistence.Client/Clients/Interfaces/Refit/IRefitTimeSeriesClient.cs @@ -1,7 +1,7 @@ -using Persistence.Models; +using DD.Persistence.Models; using Refit; -namespace Persistence.Client.Clients.Interfaces.Refit; +namespace DD.Persistence.Client.Clients.Interfaces.Refit; public interface IRefitTimeSeriesClient : IDisposable where TDto : class, new() { diff --git a/Persistence.Client/Clients/Interfaces/Refit/IRefitTimestampedSetClient.cs b/DD.Persistence.Client/Clients/Interfaces/Refit/IRefitTimestampedSetClient.cs similarity index 91% rename from Persistence.Client/Clients/Interfaces/Refit/IRefitTimestampedSetClient.cs rename to DD.Persistence.Client/Clients/Interfaces/Refit/IRefitTimestampedSetClient.cs index 8caeb61..14db284 100644 --- a/Persistence.Client/Clients/Interfaces/Refit/IRefitTimestampedSetClient.cs +++ b/DD.Persistence.Client/Clients/Interfaces/Refit/IRefitTimestampedSetClient.cs @@ -1,7 +1,7 @@ -using Persistence.Models; +using DD.Persistence.Models; using Refit; -namespace Persistence.Client.Clients.Interfaces.Refit; +namespace DD.Persistence.Client.Clients.Interfaces.Refit; public interface IRefitTimestampedSetClient : IDisposable { diff --git a/Persistence.Client/Clients/Interfaces/Refit/IRefitWitsDataClient.cs b/DD.Persistence.Client/Clients/Interfaces/Refit/IRefitWitsDataClient.cs similarity index 91% rename from Persistence.Client/Clients/Interfaces/Refit/IRefitWitsDataClient.cs rename to DD.Persistence.Client/Clients/Interfaces/Refit/IRefitWitsDataClient.cs index c22f919..57bff6f 100644 --- a/Persistence.Client/Clients/Interfaces/Refit/IRefitWitsDataClient.cs +++ b/DD.Persistence.Client/Clients/Interfaces/Refit/IRefitWitsDataClient.cs @@ -1,8 +1,8 @@ using Microsoft.AspNetCore.Mvc; -using Persistence.Models; +using DD.Persistence.Models; using Refit; -namespace Persistence.Client.Clients.Interfaces.Refit; +namespace DD.Persistence.Client.Clients.Interfaces.Refit; public interface IRefitWitsDataClient : IDisposable { private const string BaseRoute = "/api/witsData"; diff --git a/Persistence.Client/Clients/SetpointClient.cs b/DD.Persistence.Client/Clients/SetpointClient.cs similarity index 90% rename from Persistence.Client/Clients/SetpointClient.cs rename to DD.Persistence.Client/Clients/SetpointClient.cs index ea6d767..4a990c5 100644 --- a/Persistence.Client/Clients/SetpointClient.cs +++ b/DD.Persistence.Client/Clients/SetpointClient.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Persistence.Client.Clients.Base; -using Persistence.Client.Clients.Interfaces; -using Persistence.Client.Clients.Interfaces.Refit; -using Persistence.Models; +using DD.Persistence.Client.Clients.Base; +using DD.Persistence.Client.Clients.Interfaces; +using DD.Persistence.Client.Clients.Interfaces.Refit; +using DD.Persistence.Models; -namespace Persistence.Client.Clients; +namespace DD.Persistence.Client.Clients; public class SetpointClient : BaseClient, ISetpointClient { diff --git a/Persistence.Client/Clients/TechMessagesClient.cs b/DD.Persistence.Client/Clients/TechMessagesClient.cs similarity index 89% rename from Persistence.Client/Clients/TechMessagesClient.cs rename to DD.Persistence.Client/Clients/TechMessagesClient.cs index f69c110..c981569 100644 --- a/Persistence.Client/Clients/TechMessagesClient.cs +++ b/DD.Persistence.Client/Clients/TechMessagesClient.cs @@ -1,11 +1,11 @@ using Microsoft.Extensions.Logging; -using Persistence.Client.Clients.Base; -using Persistence.Client.Clients.Interfaces; -using Persistence.Client.Clients.Interfaces.Refit; -using Persistence.Models; -using Persistence.Models.Requests; +using DD.Persistence.Client.Clients.Base; +using DD.Persistence.Client.Clients.Interfaces; +using DD.Persistence.Client.Clients.Interfaces.Refit; +using DD.Persistence.Models; +using DD.Persistence.Models.Requests; -namespace Persistence.Client.Clients; +namespace DD.Persistence.Client.Clients; public class TechMessagesClient : BaseClient, ITechMessagesClient { diff --git a/Persistence.Client/Clients/TimeSeriesClient.cs b/DD.Persistence.Client/Clients/TimeSeriesClient.cs similarity index 87% rename from Persistence.Client/Clients/TimeSeriesClient.cs rename to DD.Persistence.Client/Clients/TimeSeriesClient.cs index 72b8ed8..2c15938 100644 --- a/Persistence.Client/Clients/TimeSeriesClient.cs +++ b/DD.Persistence.Client/Clients/TimeSeriesClient.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Persistence.Client.Clients.Base; -using Persistence.Client.Clients.Interfaces; -using Persistence.Client.Clients.Interfaces.Refit; -using Persistence.Models; +using DD.Persistence.Client.Clients.Base; +using DD.Persistence.Client.Clients.Interfaces; +using DD.Persistence.Client.Clients.Interfaces.Refit; +using DD.Persistence.Models; -namespace Persistence.Client.Clients; +namespace DD.Persistence.Client.Clients; public class TimeSeriesClient : BaseClient, ITimeSeriesClient where TDto : class, new() { private readonly IRefitTimeSeriesClient timeSeriesClient; diff --git a/Persistence.Client/Clients/TimestampedSetClient.cs b/DD.Persistence.Client/Clients/TimestampedSetClient.cs similarity index 90% rename from Persistence.Client/Clients/TimestampedSetClient.cs rename to DD.Persistence.Client/Clients/TimestampedSetClient.cs index 3009488..38828b6 100644 --- a/Persistence.Client/Clients/TimestampedSetClient.cs +++ b/DD.Persistence.Client/Clients/TimestampedSetClient.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Persistence.Client.Clients.Base; -using Persistence.Client.Clients.Interfaces; -using Persistence.Client.Clients.Interfaces.Refit; -using Persistence.Models; +using DD.Persistence.Client.Clients.Base; +using DD.Persistence.Client.Clients.Interfaces; +using DD.Persistence.Client.Clients.Interfaces.Refit; +using DD.Persistence.Models; -namespace Persistence.Client.Clients; +namespace DD.Persistence.Client.Clients; public class TimestampedSetClient : BaseClient, ITimestampedSetClient { private readonly IRefitTimestampedSetClient refitTimestampedSetClient; diff --git a/Persistence.Client/Clients/WitsDataClient.cs b/DD.Persistence.Client/Clients/WitsDataClient.cs similarity index 88% rename from Persistence.Client/Clients/WitsDataClient.cs rename to DD.Persistence.Client/Clients/WitsDataClient.cs index 73e5873..3251194 100644 --- a/Persistence.Client/Clients/WitsDataClient.cs +++ b/DD.Persistence.Client/Clients/WitsDataClient.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Persistence.Client.Clients.Base; -using Persistence.Client.Clients.Interfaces; -using Persistence.Client.Clients.Interfaces.Refit; -using Persistence.Models; +using DD.Persistence.Client.Clients.Base; +using DD.Persistence.Client.Clients.Interfaces; +using DD.Persistence.Client.Clients.Interfaces.Refit; +using DD.Persistence.Models; -namespace Persistence.Client.Clients; +namespace DD.Persistence.Client.Clients; public class WitsDataClient : BaseClient, IWitsDataClient { private readonly IRefitWitsDataClient refitWitsDataClient; diff --git a/Persistence.Client/CustomExceptions/AcceptableException.cs b/DD.Persistence.Client/CustomExceptions/AcceptableException.cs similarity index 77% rename from Persistence.Client/CustomExceptions/AcceptableException.cs rename to DD.Persistence.Client/CustomExceptions/AcceptableException.cs index 0bdea54..f9c2186 100644 --- a/Persistence.Client/CustomExceptions/AcceptableException.cs +++ b/DD.Persistence.Client/CustomExceptions/AcceptableException.cs @@ -1,4 +1,4 @@ -namespace Persistence.Client.CustomExceptions; +namespace DD.Persistence.Client.CustomExceptions; /// /// Not Acceptable (406) diff --git a/Persistence.Client/CustomExceptions/BadGatewayException.cs b/DD.Persistence.Client/CustomExceptions/BadGatewayException.cs similarity index 76% rename from Persistence.Client/CustomExceptions/BadGatewayException.cs rename to DD.Persistence.Client/CustomExceptions/BadGatewayException.cs index 2730140..b299d85 100644 --- a/Persistence.Client/CustomExceptions/BadGatewayException.cs +++ b/DD.Persistence.Client/CustomExceptions/BadGatewayException.cs @@ -1,4 +1,4 @@ -namespace Persistence.Client.CustomExceptions; +namespace DD.Persistence.Client.CustomExceptions; /// /// Bad gateway (502) diff --git a/Persistence.Client/CustomExceptions/ForbiddenException.cs b/DD.Persistence.Client/CustomExceptions/ForbiddenException.cs similarity index 76% rename from Persistence.Client/CustomExceptions/ForbiddenException.cs rename to DD.Persistence.Client/CustomExceptions/ForbiddenException.cs index bfd9e7d..faa6c76 100644 --- a/Persistence.Client/CustomExceptions/ForbiddenException.cs +++ b/DD.Persistence.Client/CustomExceptions/ForbiddenException.cs @@ -1,4 +1,4 @@ -namespace Persistence.Client.CustomExceptions; +namespace DD.Persistence.Client.CustomExceptions; /// /// Forbidden (403) diff --git a/Persistence.Client/CustomExceptions/InternalServerException.cs b/DD.Persistence.Client/CustomExceptions/InternalServerException.cs similarity index 78% rename from Persistence.Client/CustomExceptions/InternalServerException.cs rename to DD.Persistence.Client/CustomExceptions/InternalServerException.cs index 6e8265b..85d45e8 100644 --- a/Persistence.Client/CustomExceptions/InternalServerException.cs +++ b/DD.Persistence.Client/CustomExceptions/InternalServerException.cs @@ -1,4 +1,4 @@ -namespace Persistence.Client.CustomExceptions; +namespace DD.Persistence.Client.CustomExceptions; /// /// Internal Server Error (500) diff --git a/Persistence.Client/CustomExceptions/LockedException.cs b/DD.Persistence.Client/CustomExceptions/LockedException.cs similarity index 75% rename from Persistence.Client/CustomExceptions/LockedException.cs rename to DD.Persistence.Client/CustomExceptions/LockedException.cs index c24dca4..b798035 100644 --- a/Persistence.Client/CustomExceptions/LockedException.cs +++ b/DD.Persistence.Client/CustomExceptions/LockedException.cs @@ -1,4 +1,4 @@ -namespace Persistence.Client.CustomExceptions; +namespace DD.Persistence.Client.CustomExceptions; /// /// Locked (423) diff --git a/Persistence.Client/CustomExceptions/ServiceUnavailableException.cs b/DD.Persistence.Client/CustomExceptions/ServiceUnavailableException.cs similarity index 79% rename from Persistence.Client/CustomExceptions/ServiceUnavailableException.cs rename to DD.Persistence.Client/CustomExceptions/ServiceUnavailableException.cs index 3929d42..79557ee 100644 --- a/Persistence.Client/CustomExceptions/ServiceUnavailableException.cs +++ b/DD.Persistence.Client/CustomExceptions/ServiceUnavailableException.cs @@ -1,4 +1,4 @@ -namespace Persistence.Client.CustomExceptions; +namespace DD.Persistence.Client.CustomExceptions; /// /// Service Unavailable Error (503) diff --git a/Persistence.Client/CustomExceptions/TooManyRequestsException.cs b/DD.Persistence.Client/CustomExceptions/TooManyRequestsException.cs similarity index 78% rename from Persistence.Client/CustomExceptions/TooManyRequestsException.cs rename to DD.Persistence.Client/CustomExceptions/TooManyRequestsException.cs index d28f642..8ba6567 100644 --- a/Persistence.Client/CustomExceptions/TooManyRequestsException.cs +++ b/DD.Persistence.Client/CustomExceptions/TooManyRequestsException.cs @@ -1,4 +1,4 @@ -namespace Persistence.Client.CustomExceptions; +namespace DD.Persistence.Client.CustomExceptions; /// /// Too Many Requests (429) diff --git a/DD.Persistence.Client/DD.Persistence.Client.csproj b/DD.Persistence.Client/DD.Persistence.Client.csproj new file mode 100644 index 0000000..2943076 --- /dev/null +++ b/DD.Persistence.Client/DD.Persistence.Client.csproj @@ -0,0 +1,63 @@ + + + + net8.0 + enable + enable + true + + + True + + Persistence.Client + + 1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH)) + + 1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH)) + + Persistence.Client + + + Digital Drilling + + Digital Drilling + + Пакет для получения клиентов для работы с Persistence сервисом + + + https://git.ddrilling.ru/on.nemtina/persistence.git + + git + + true + + snupkg + + C:\Projects\Nuget + + + Readme.md + + + + 1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH)) + 1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH)) + + + + + + + + + + + + + + + + + + + diff --git a/Persistence.Client/Helpers/ApiTokenHelper.cs b/DD.Persistence.Client/Helpers/ApiTokenHelper.cs similarity index 97% rename from Persistence.Client/Helpers/ApiTokenHelper.cs rename to DD.Persistence.Client/Helpers/ApiTokenHelper.cs index a2f632e..9e62110 100644 --- a/Persistence.Client/Helpers/ApiTokenHelper.cs +++ b/DD.Persistence.Client/Helpers/ApiTokenHelper.cs @@ -1,13 +1,13 @@ using Microsoft.Extensions.Configuration; using Microsoft.IdentityModel.Tokens; -using Persistence.Models.Configurations; +using DD.Persistence.Models.Configurations; using RestSharp; using System.IdentityModel.Tokens.Jwt; using System.Net.Http.Headers; using System.Security.Claims; using System.Text.Json; -namespace Persistence.Client.Helpers; +namespace DD.Persistence.Client.Helpers; public static class ApiTokenHelper { public static void Authorize(this HttpClient httpClient, IConfiguration configuration) diff --git a/Persistence.Client/Helpers/ExceptionsHelper.cs b/DD.Persistence.Client/Helpers/ExceptionsHelper.cs similarity index 95% rename from Persistence.Client/Helpers/ExceptionsHelper.cs rename to DD.Persistence.Client/Helpers/ExceptionsHelper.cs index 0e3a31a..d4075a0 100644 --- a/Persistence.Client/Helpers/ExceptionsHelper.cs +++ b/DD.Persistence.Client/Helpers/ExceptionsHelper.cs @@ -1,8 +1,8 @@ -using System.ComponentModel.DataAnnotations; -using Persistence.Client.CustomExceptions; +using DD.Persistence.Client.CustomExceptions; using Refit; +using System.ComponentModel.DataAnnotations; -namespace Persistence.Client.Helpers; +namespace DD.Persistence.Client.Helpers; public static class ExceptionsHelper { private static readonly Dictionary ExceptionsDictionary = new Dictionary() @@ -30,6 +30,6 @@ public static class ExceptionsHelper var result = exception ?? new Exception("Неопознанная ошибка"); - return result; + return result; } } diff --git a/Persistence.Client/PersistenceClientFactory.cs b/DD.Persistence.Client/PersistenceClientFactory.cs similarity index 95% rename from Persistence.Client/PersistenceClientFactory.cs rename to DD.Persistence.Client/PersistenceClientFactory.cs index 4807367..ad7c817 100644 --- a/Persistence.Client/PersistenceClientFactory.cs +++ b/DD.Persistence.Client/PersistenceClientFactory.cs @@ -1,15 +1,15 @@ using Microsoft.Extensions.Configuration; -using Persistence.Client.Clients.Interfaces; -using Persistence.Client.Clients; -using Persistence.Client.Helpers; +using DD.Persistence.Client.Clients.Interfaces; +using DD.Persistence.Client.Clients; +using DD.Persistence.Client.Helpers; using Refit; -using Persistence.Factories; -using Persistence.Client.Clients.Interfaces.Refit; +using DD.Persistence.Factories; +using DD.Persistence.Client.Clients.Interfaces.Refit; using Microsoft.Extensions.Logging; using Microsoft.Extensions.DependencyInjection; using System.Text.Json; -namespace Persistence.Client +namespace DD.Persistence.Client { /// /// Фабрика клиентов для доступа к Persistence - сервису diff --git a/Persistence.Client/Readme.md b/DD.Persistence.Client/Readme.md similarity index 94% rename from Persistence.Client/Readme.md rename to DD.Persistence.Client/Readme.md index f7c35f6..1e09e2f 100644 --- a/Persistence.Client/Readme.md +++ b/DD.Persistence.Client/Readme.md @@ -6,7 +6,7 @@ Persistence сервис отвечает за работу с хранимым ## Описание пакета Данный пакет предоставляет возможность взаимодействия с Persistence сервисом посредством обращения к конкретному -клиенту, ответсвенному за работу с одной из областей сервиса. +клиенту, ответственному за работу с одной из областей сервиса. ## Список предоставляемых клиентов - `ISetpointClient` - Клиент для работы с уставками @@ -31,7 +31,7 @@ Persistence сервисом посредством обращения к кон 4. Обратиться к фабрике Persistence - клиентов и получить требуемого клиента. ## xunit тестирование -При написании интеграционных тестов с ипользованием Persistence - клиентов +При написании интеграционных тестов с использованием Persistence - клиентов Http - клиент не обязан быть авторизован через передачу токена в `PersistenceClientFactory`. Для осуществления тестовой авторизации достаточно добавить в `appsettings.Tests.json` : ```json diff --git a/Persistence.Database.Postgres/Persistence.Database.Postgres.csproj b/DD.Persistence.Database.Postgres/DD.Persistence.Database.Postgres.csproj similarity index 87% rename from Persistence.Database.Postgres/Persistence.Database.Postgres.csproj rename to DD.Persistence.Database.Postgres/DD.Persistence.Database.Postgres.csproj index e383e91..e86ac4d 100644 --- a/Persistence.Database.Postgres/Persistence.Database.Postgres.csproj +++ b/DD.Persistence.Database.Postgres/DD.Persistence.Database.Postgres.csproj @@ -14,12 +14,12 @@ - - - - + + + + diff --git a/Persistence.Database.Postgres/DependencyInjection.cs b/DD.Persistence.Database.Postgres/DependencyInjection.cs similarity index 94% rename from Persistence.Database.Postgres/DependencyInjection.cs rename to DD.Persistence.Database.Postgres/DependencyInjection.cs index e775952..f0c8ff1 100644 --- a/Persistence.Database.Postgres/DependencyInjection.cs +++ b/DD.Persistence.Database.Postgres/DependencyInjection.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace Persistence.Database.Model; +namespace DD.Persistence.Database.Model; public static class DependencyInjection { diff --git a/Persistence.Database.Postgres/DesignTimeDbContextFactory.cs b/DD.Persistence.Database.Postgres/DesignTimeDbContextFactory.cs similarity index 92% rename from Persistence.Database.Postgres/DesignTimeDbContextFactory.cs rename to DD.Persistence.Database.Postgres/DesignTimeDbContextFactory.cs index b4fbd85..639f0a9 100644 --- a/Persistence.Database.Postgres/DesignTimeDbContextFactory.cs +++ b/DD.Persistence.Database.Postgres/DesignTimeDbContextFactory.cs @@ -1,9 +1,9 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Npgsql; -using Persistence.Database.Model; +using DD.Persistence.Database.Model; -namespace Persistence.Database.Postgres; +namespace DD.Persistence.Database.Postgres; /// /// Фабрика контекста для dotnet ef миграций diff --git a/Persistence.Database.Postgres/EFExtensionsInitialization.cs b/DD.Persistence.Database.Postgres/EFExtensionsInitialization.cs similarity index 97% rename from Persistence.Database.Postgres/EFExtensionsInitialization.cs rename to DD.Persistence.Database.Postgres/EFExtensionsInitialization.cs index a876f7a..fe24f37 100644 --- a/Persistence.Database.Postgres/EFExtensionsInitialization.cs +++ b/DD.Persistence.Database.Postgres/EFExtensionsInitialization.cs @@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using System.Diagnostics; -namespace Persistence.Database.Postgres; +namespace DD.Persistence.Database.Postgres; public static class EFExtensionsInitialization { public static void EnsureCreatedAndMigrated(this DatabaseFacade db) diff --git a/Persistence.Database.Postgres/Migrations/20241118052225_SetpointMigration.cs b/DD.Persistence.Database.Postgres/Migrations/20241118052225_SetpointMigration.cs similarity index 96% rename from Persistence.Database.Postgres/Migrations/20241118052225_SetpointMigration.cs rename to DD.Persistence.Database.Postgres/Migrations/20241118052225_SetpointMigration.cs index fac75d8..e9f5b95 100644 --- a/Persistence.Database.Postgres/Migrations/20241118052225_SetpointMigration.cs +++ b/DD.Persistence.Database.Postgres/Migrations/20241118052225_SetpointMigration.cs @@ -2,7 +2,7 @@ #nullable disable -namespace Persistence.Database.Postgres.Migrations +namespace DD.Persistence.Database.Postgres.Migrations { /// public partial class SetpointMigration : Migration diff --git a/Persistence.Database.Postgres/Migrations/20241126071115_Add_ChangeLog.Designer.cs b/DD.Persistence.Database.Postgres/Migrations/20241126071115_Add_ChangeLog.Designer.cs similarity index 96% rename from Persistence.Database.Postgres/Migrations/20241126071115_Add_ChangeLog.Designer.cs rename to DD.Persistence.Database.Postgres/Migrations/20241126071115_Add_ChangeLog.Designer.cs index c17da2b..7fa7567 100644 --- a/Persistence.Database.Postgres/Migrations/20241126071115_Add_ChangeLog.Designer.cs +++ b/DD.Persistence.Database.Postgres/Migrations/20241126071115_Add_ChangeLog.Designer.cs @@ -6,11 +6,11 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Persistence.Database.Model; +using DD.Persistence.Database.Model; #nullable disable -namespace Persistence.Database.Postgres.Migrations +namespace DD.Persistence.Database.Postgres.Migrations { [DbContext(typeof(PersistenceDbContext))] [Migration("20241126071115_Add_ChangeLog")] @@ -28,7 +28,7 @@ namespace Persistence.Database.Postgres.Migrations NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - modelBuilder.Entity("Persistence.Database.Model.ChangeLog", b => + modelBuilder.Entity("DD.Persistence.Database.Model.ChangeLog", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -81,7 +81,7 @@ namespace Persistence.Database.Postgres.Migrations b.ToTable("ChangeLog"); }); - modelBuilder.Entity("Persistence.Database.Model.DataSaub", b => + modelBuilder.Entity("DD.Persistence.Database.Model.DataSaub", b => { b.Property("Date") .HasColumnType("timestamp with time zone") diff --git a/Persistence.Database.Postgres/Migrations/20241126071115_Add_ChangeLog.cs b/DD.Persistence.Database.Postgres/Migrations/20241126071115_Add_ChangeLog.cs similarity index 97% rename from Persistence.Database.Postgres/Migrations/20241126071115_Add_ChangeLog.cs rename to DD.Persistence.Database.Postgres/Migrations/20241126071115_Add_ChangeLog.cs index 4750bc3..e001cfe 100644 --- a/Persistence.Database.Postgres/Migrations/20241126071115_Add_ChangeLog.cs +++ b/DD.Persistence.Database.Postgres/Migrations/20241126071115_Add_ChangeLog.cs @@ -2,7 +2,7 @@ #nullable disable -namespace Persistence.Database.Postgres.Migrations +namespace DD.Persistence.Database.Postgres.Migrations { /// public partial class Add_ChangeLog : Migration diff --git a/Persistence.Database.Postgres/Migrations/20241126100631_Init.Designer.cs b/DD.Persistence.Database.Postgres/Migrations/20241126100631_Init.Designer.cs similarity index 94% rename from Persistence.Database.Postgres/Migrations/20241126100631_Init.Designer.cs rename to DD.Persistence.Database.Postgres/Migrations/20241126100631_Init.Designer.cs index e461173..a43cb6a 100644 --- a/Persistence.Database.Postgres/Migrations/20241126100631_Init.Designer.cs +++ b/DD.Persistence.Database.Postgres/Migrations/20241126100631_Init.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Persistence.Database.Model; +using DD.Persistence.Database.Model; #nullable disable -namespace Persistence.Database.Postgres.Migrations +namespace DD.Persistence.Database.Postgres.Migrations { [DbContext(typeof(PersistencePostgresContext))] [Migration("20241126100631_Init")] @@ -27,7 +27,7 @@ namespace Persistence.Database.Postgres.Migrations NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - modelBuilder.Entity("Persistence.Database.Entity.TimestampedSet", b => + modelBuilder.Entity("DD.Persistence.Database.Entity.TimestampedSet", b => { b.Property("IdDiscriminator") .HasColumnType("uuid") @@ -50,7 +50,7 @@ namespace Persistence.Database.Postgres.Migrations }); }); - modelBuilder.Entity("Persistence.Database.Model.DataSaub", b => + modelBuilder.Entity("DD.Persistence.Database.Model.DataSaub", b => { b.Property("Date") .HasColumnType("timestamp with time zone") @@ -133,7 +133,7 @@ namespace Persistence.Database.Postgres.Migrations b.ToTable("DataSaub"); }); - modelBuilder.Entity("Persistence.Database.Model.Setpoint", b => + modelBuilder.Entity("DD.Persistence.Database.Model.Setpoint", b => { b.Property("Key") .HasColumnType("uuid") diff --git a/Persistence.Database.Postgres/Migrations/20241126100631_Init.cs b/DD.Persistence.Database.Postgres/Migrations/20241126100631_Init.cs similarity index 98% rename from Persistence.Database.Postgres/Migrations/20241126100631_Init.cs rename to DD.Persistence.Database.Postgres/Migrations/20241126100631_Init.cs index 74a549e..9bbd704 100644 --- a/Persistence.Database.Postgres/Migrations/20241126100631_Init.cs +++ b/DD.Persistence.Database.Postgres/Migrations/20241126100631_Init.cs @@ -2,7 +2,7 @@ #nullable disable -namespace Persistence.Database.Postgres.Migrations +namespace DD.Persistence.Database.Postgres.Migrations { /// public partial class Init : Migration diff --git a/Persistence.Database.Postgres/Migrations/20241203120141_ParameterDataMigration.Designer.cs b/DD.Persistence.Database.Postgres/Migrations/20241203120141_ParameterDataMigration.Designer.cs similarity index 92% rename from Persistence.Database.Postgres/Migrations/20241203120141_ParameterDataMigration.Designer.cs rename to DD.Persistence.Database.Postgres/Migrations/20241203120141_ParameterDataMigration.Designer.cs index c0f01fc..2afaaa3 100644 --- a/Persistence.Database.Postgres/Migrations/20241203120141_ParameterDataMigration.Designer.cs +++ b/DD.Persistence.Database.Postgres/Migrations/20241203120141_ParameterDataMigration.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Persistence.Database.Model; +using DD.Persistence.Database.Model; #nullable disable -namespace Persistence.Database.Postgres.Migrations +namespace DD.Persistence.Database.Postgres.Migrations { [DbContext(typeof(PersistenceDbContext))] [Migration("20241203120141_ParameterDataMigration")] @@ -27,7 +27,7 @@ namespace Persistence.Database.Postgres.Migrations NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - modelBuilder.Entity("Persistence.Database.Entity.DrillingSystem", b => + modelBuilder.Entity("DD.Persistence.Database.Entity.DrillingSystem", b => { b.Property("SystemId") .ValueGeneratedOnAdd() @@ -48,7 +48,7 @@ namespace Persistence.Database.Postgres.Migrations b.ToTable("DrillingSystem"); }); - modelBuilder.Entity("Persistence.Database.Entity.ParameterData", b => + modelBuilder.Entity("DD.Persistence.Database.Entity.ParameterData", b => { b.Property("DiscriminatorId") .HasColumnType("integer") @@ -72,7 +72,7 @@ namespace Persistence.Database.Postgres.Migrations b.ToTable("ParameterData"); }); - modelBuilder.Entity("Persistence.Database.Entity.TechMessage", b => + modelBuilder.Entity("DD.Persistence.Database.Entity.TechMessage", b => { b.Property("EventId") .ValueGeneratedOnAdd() @@ -111,7 +111,7 @@ namespace Persistence.Database.Postgres.Migrations b.ToTable("TechMessage"); }); - modelBuilder.Entity("Persistence.Database.Entity.TimestampedSet", b => + modelBuilder.Entity("DD.Persistence.Database.Entity.TimestampedSet", b => { b.Property("IdDiscriminator") .HasColumnType("uuid") @@ -134,7 +134,7 @@ namespace Persistence.Database.Postgres.Migrations }); }); - modelBuilder.Entity("Persistence.Database.Model.DataSaub", b => + modelBuilder.Entity("DD.Persistence.Database.Model.DataSaub", b => { b.Property("Date") .HasColumnType("timestamp with time zone") @@ -217,7 +217,7 @@ namespace Persistence.Database.Postgres.Migrations b.ToTable("DataSaub"); }); - modelBuilder.Entity("Persistence.Database.Model.Setpoint", b => + modelBuilder.Entity("DD.Persistence.Database.Model.Setpoint", b => { b.Property("Key") .HasColumnType("uuid") @@ -241,9 +241,9 @@ namespace Persistence.Database.Postgres.Migrations b.ToTable("Setpoint"); }); - modelBuilder.Entity("Persistence.Database.Entity.TechMessage", b => + modelBuilder.Entity("DD.Persistence.Database.Entity.TechMessage", b => { - b.HasOne("Persistence.Database.Entity.DrillingSystem", "System") + b.HasOne("DD.Persistence.Database.Entity.DrillingSystem", "System") .WithMany() .HasForeignKey("SystemId") .OnDelete(DeleteBehavior.Cascade) diff --git a/Persistence.Database.Postgres/Migrations/20241203120141_ParameterDataMigration.cs b/DD.Persistence.Database.Postgres/Migrations/20241203120141_ParameterDataMigration.cs similarity index 96% rename from Persistence.Database.Postgres/Migrations/20241203120141_ParameterDataMigration.cs rename to DD.Persistence.Database.Postgres/Migrations/20241203120141_ParameterDataMigration.cs index 8d44be9..830f5b9 100644 --- a/Persistence.Database.Postgres/Migrations/20241203120141_ParameterDataMigration.cs +++ b/DD.Persistence.Database.Postgres/Migrations/20241203120141_ParameterDataMigration.cs @@ -2,7 +2,7 @@ #nullable disable -namespace Persistence.Database.Postgres.Migrations +namespace DD.Persistence.Database.Postgres.Migrations { /// public partial class ParameterDataMigration : Migration diff --git a/Persistence.Database.Postgres/Migrations/20241212041758_TechMessageMigration.Designer.cs b/DD.Persistence.Database.Postgres/Migrations/20241212041758_TechMessageMigration.Designer.cs similarity index 93% rename from Persistence.Database.Postgres/Migrations/20241212041758_TechMessageMigration.Designer.cs rename to DD.Persistence.Database.Postgres/Migrations/20241212041758_TechMessageMigration.Designer.cs index 0124f24..1e28de3 100644 --- a/Persistence.Database.Postgres/Migrations/20241212041758_TechMessageMigration.Designer.cs +++ b/DD.Persistence.Database.Postgres/Migrations/20241212041758_TechMessageMigration.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Persistence.Database.Model; +using DD.Persistence.Database.Model; #nullable disable -namespace Persistence.Database.Postgres.Migrations.PersistencePostgres +namespace DD.Persistence.Database.Postgres.Migrations.PersistencePostgres { [DbContext(typeof(PersistencePostgresContext))] [Migration("20241212041758_TechMessageMigration")] @@ -27,7 +27,7 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - modelBuilder.Entity("Persistence.Database.Entity.DrillingSystem", b => + modelBuilder.Entity("DD.Persistence.Database.Entity.DrillingSystem", b => { b.Property("SystemId") .ValueGeneratedOnAdd() @@ -48,7 +48,7 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres b.ToTable("DrillingSystem"); }); - modelBuilder.Entity("Persistence.Database.Entity.ParameterData", b => + modelBuilder.Entity("DD.Persistence.Database.Entity.ParameterData", b => { b.Property("DiscriminatorId") .HasColumnType("uuid") @@ -72,7 +72,7 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres b.ToTable("ParameterData"); }); - modelBuilder.Entity("Persistence.Database.Entity.TechMessage", b => + modelBuilder.Entity("DD.Persistence.Database.Entity.TechMessage", b => { b.Property("EventId") .ValueGeneratedOnAdd() @@ -107,7 +107,7 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres b.ToTable("TechMessage"); }); - modelBuilder.Entity("Persistence.Database.Entity.TimestampedSet", b => + modelBuilder.Entity("DD.Persistence.Database.Entity.TimestampedSet", b => { b.Property("IdDiscriminator") .HasColumnType("uuid") @@ -130,7 +130,7 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres }); }); - modelBuilder.Entity("Persistence.Database.Model.ChangeLog", b => + modelBuilder.Entity("DD.Persistence.Database.Model.ChangeLog", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -183,7 +183,7 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres b.ToTable("ChangeLog"); }); - modelBuilder.Entity("Persistence.Database.Model.DataSaub", b => + modelBuilder.Entity("DD.Persistence.Database.Model.DataSaub", b => { b.Property("Date") .HasColumnType("timestamp with time zone") @@ -266,7 +266,7 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres b.ToTable("DataSaub"); }); - modelBuilder.Entity("Persistence.Database.Model.Setpoint", b => + modelBuilder.Entity("DD.Persistence.Database.Model.Setpoint", b => { b.Property("Key") .HasColumnType("uuid") @@ -290,9 +290,9 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres b.ToTable("Setpoint"); }); - modelBuilder.Entity("Persistence.Database.Entity.TechMessage", b => + modelBuilder.Entity("DD.Persistence.Database.Entity.TechMessage", b => { - b.HasOne("Persistence.Database.Entity.DrillingSystem", "System") + b.HasOne("DD.Persistence.Database.Entity.DrillingSystem", "System") .WithMany() .HasForeignKey("SystemId") .OnDelete(DeleteBehavior.Cascade) diff --git a/Persistence.Database.Postgres/Migrations/20241212041758_TechMessageMigration.cs b/DD.Persistence.Database.Postgres/Migrations/20241212041758_TechMessageMigration.cs similarity index 97% rename from Persistence.Database.Postgres/Migrations/20241212041758_TechMessageMigration.cs rename to DD.Persistence.Database.Postgres/Migrations/20241212041758_TechMessageMigration.cs index c0066ae..04be23a 100644 --- a/Persistence.Database.Postgres/Migrations/20241212041758_TechMessageMigration.cs +++ b/DD.Persistence.Database.Postgres/Migrations/20241212041758_TechMessageMigration.cs @@ -2,7 +2,7 @@ #nullable disable -namespace Persistence.Database.Postgres.Migrations.PersistencePostgres +namespace DD.Persistence.Database.Postgres.Migrations.PersistencePostgres { /// public partial class TechMessageMigration : Migration diff --git a/Persistence.Database.Postgres/Migrations/PersistencePostgresContextModelSnapshot.cs b/DD.Persistence.Database.Postgres/Migrations/PersistencePostgresContextModelSnapshot.cs similarity index 93% rename from Persistence.Database.Postgres/Migrations/PersistencePostgresContextModelSnapshot.cs rename to DD.Persistence.Database.Postgres/Migrations/PersistencePostgresContextModelSnapshot.cs index f233af8..a475f75 100644 --- a/Persistence.Database.Postgres/Migrations/PersistencePostgresContextModelSnapshot.cs +++ b/DD.Persistence.Database.Postgres/Migrations/PersistencePostgresContextModelSnapshot.cs @@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Persistence.Database.Model; +using DD.Persistence.Database.Model; #nullable disable -namespace Persistence.Database.Postgres.Migrations +namespace DD.Persistence.Database.Postgres.Migrations { [DbContext(typeof(PersistencePostgresContext))] partial class PersistencePostgresContextModelSnapshot : ModelSnapshot @@ -24,7 +24,7 @@ namespace Persistence.Database.Postgres.Migrations NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - modelBuilder.Entity("Persistence.Database.Entity.DataSourceSystem", b => + modelBuilder.Entity("DD.Persistence.Database.Entity.DataSourceSystem", b => { b.Property("SystemId") .ValueGeneratedOnAdd() @@ -45,7 +45,7 @@ namespace Persistence.Database.Postgres.Migrations b.ToTable("DataSourceSystem"); }); - modelBuilder.Entity("Persistence.Database.Entity.ParameterData", b => + modelBuilder.Entity("DD.Persistence.Database.Entity.ParameterData", b => { b.Property("DiscriminatorId") .HasColumnType("uuid") @@ -69,7 +69,7 @@ namespace Persistence.Database.Postgres.Migrations b.ToTable("ParameterData"); }); - modelBuilder.Entity("Persistence.Database.Entity.TechMessage", b => + modelBuilder.Entity("DD.Persistence.Database.Entity.TechMessage", b => { b.Property("EventId") .ValueGeneratedOnAdd() @@ -104,7 +104,7 @@ namespace Persistence.Database.Postgres.Migrations b.ToTable("TechMessage"); }); - modelBuilder.Entity("Persistence.Database.Entity.TimestampedSet", b => + modelBuilder.Entity("DD.Persistence.Database.Entity.TimestampedSet", b => { b.Property("IdDiscriminator") .HasColumnType("uuid") @@ -127,7 +127,7 @@ namespace Persistence.Database.Postgres.Migrations }); }); - modelBuilder.Entity("Persistence.Database.Model.ChangeLog", b => + modelBuilder.Entity("DD.Persistence.Database.Model.ChangeLog", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -180,7 +180,7 @@ namespace Persistence.Database.Postgres.Migrations b.ToTable("ChangeLog"); }); - modelBuilder.Entity("Persistence.Database.Model.DataSaub", b => + modelBuilder.Entity("DD.Persistence.Database.Model.DataSaub", b => { b.Property("Date") .HasColumnType("timestamp with time zone") @@ -263,7 +263,7 @@ namespace Persistence.Database.Postgres.Migrations b.ToTable("DataSaub"); }); - modelBuilder.Entity("Persistence.Database.Model.Setpoint", b => + modelBuilder.Entity("DD.Persistence.Database.Model.Setpoint", b => { b.Property("Key") .HasColumnType("uuid") @@ -287,9 +287,9 @@ namespace Persistence.Database.Postgres.Migrations b.ToTable("Setpoint"); }); - modelBuilder.Entity("Persistence.Database.Entity.TechMessage", b => + modelBuilder.Entity("DD.Persistence.Database.Entity.TechMessage", b => { - b.HasOne("Persistence.Database.Entity.DataSourceSystem", "System") + b.HasOne("DD.Persistence.Database.Entity.DataSourceSystem", "System") .WithMany() .HasForeignKey("SystemId") .OnDelete(DeleteBehavior.Cascade) diff --git a/Persistence.Database.Postgres/PersistencePostgresContext.cs b/DD.Persistence.Database.Postgres/PersistencePostgresContext.cs similarity index 92% rename from Persistence.Database.Postgres/PersistencePostgresContext.cs rename to DD.Persistence.Database.Postgres/PersistencePostgresContext.cs index 6016a1d..00f1a31 100644 --- a/Persistence.Database.Postgres/PersistencePostgresContext.cs +++ b/DD.Persistence.Database.Postgres/PersistencePostgresContext.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; -namespace Persistence.Database.Model; +namespace DD.Persistence.Database.Model; /// /// EF Postgres diff --git a/DD.Persistence.Database.Postgres/Readme.md b/DD.Persistence.Database.Postgres/Readme.md new file mode 100644 index 0000000..176788f --- /dev/null +++ b/DD.Persistence.Database.Postgres/Readme.md @@ -0,0 +1,11 @@ +## Создать миграцию +``` +dotnet ef migrations add --project DD.Persistence.Database.Postgres + +``` + +## Откатить миграцию +``` +dotnet ef migrations remove --project DD.Persistence.Database.Postgres +``` +Удаляется последняя созданная миграция. \ No newline at end of file diff --git a/Persistence.Database/Persistence.Database.csproj b/DD.Persistence.Database/DD.Persistence.Database.csproj similarity index 88% rename from Persistence.Database/Persistence.Database.csproj rename to DD.Persistence.Database/DD.Persistence.Database.csproj index 3019e82..c1db678 100644 --- a/Persistence.Database/Persistence.Database.csproj +++ b/DD.Persistence.Database/DD.Persistence.Database.csproj @@ -15,7 +15,7 @@ - + diff --git a/Persistence.Database/EFExtensions.cs b/DD.Persistence.Database/EFExtensions.cs similarity index 97% rename from Persistence.Database/EFExtensions.cs rename to DD.Persistence.Database/EFExtensions.cs index decdb39..498d332 100644 --- a/Persistence.Database/EFExtensions.cs +++ b/DD.Persistence.Database/EFExtensions.cs @@ -2,7 +2,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Persistence.Database; +namespace DD.Persistence.Database; public static class EFExtensions { diff --git a/Persistence.Database/Entity/ChangeLog.cs b/DD.Persistence.Database/Entity/ChangeLog.cs similarity index 95% rename from Persistence.Database/Entity/ChangeLog.cs rename to DD.Persistence.Database/Entity/ChangeLog.cs index edffb52..439e886 100644 --- a/Persistence.Database/Entity/ChangeLog.cs +++ b/DD.Persistence.Database/Entity/ChangeLog.cs @@ -1,10 +1,10 @@  using Microsoft.EntityFrameworkCore; -using Persistence.Models; +using DD.Persistence.Models; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Persistence.Database.Model; +namespace DD.Persistence.Database.Model; /// /// Часть записи, описывающая изменение diff --git a/Persistence.Database/Entity/DataSaub.cs b/DD.Persistence.Database/Entity/DataSaub.cs similarity index 97% rename from Persistence.Database/Entity/DataSaub.cs rename to DD.Persistence.Database/Entity/DataSaub.cs index ee18d40..d4515b2 100644 --- a/Persistence.Database/Entity/DataSaub.cs +++ b/DD.Persistence.Database/Entity/DataSaub.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Persistence.Database.Model; +namespace DD.Persistence.Database.Model; public class DataSaub : ITimestampedData { [Key, Column("date")] diff --git a/Persistence.Database/Entity/DataSourceSystem.cs b/DD.Persistence.Database/Entity/DataSourceSystem.cs similarity index 93% rename from Persistence.Database/Entity/DataSourceSystem.cs rename to DD.Persistence.Database/Entity/DataSourceSystem.cs index a2fcaf9..d200731 100644 --- a/Persistence.Database/Entity/DataSourceSystem.cs +++ b/DD.Persistence.Database/Entity/DataSourceSystem.cs @@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Persistence.Database.Entity; +namespace DD.Persistence.Database.Entity; public class DataSourceSystem { [Key, Comment("Id системы - источника данных")] diff --git a/Persistence.Database/Entity/IChangeLog.cs b/DD.Persistence.Database/Entity/IChangeLog.cs similarity index 96% rename from Persistence.Database/Entity/IChangeLog.cs rename to DD.Persistence.Database/Entity/IChangeLog.cs index c4dc962..b91808b 100644 --- a/Persistence.Database/Entity/IChangeLog.cs +++ b/DD.Persistence.Database/Entity/IChangeLog.cs @@ -1,5 +1,5 @@  -namespace Persistence.Database.Model; +namespace DD.Persistence.Database.Model; /// /// Часть записи, описывающая изменение diff --git a/Persistence.Database/Entity/ITimestampedData.cs b/DD.Persistence.Database/Entity/ITimestampedData.cs similarity index 80% rename from Persistence.Database/Entity/ITimestampedData.cs rename to DD.Persistence.Database/Entity/ITimestampedData.cs index ce21da5..ce5468c 100644 --- a/Persistence.Database/Entity/ITimestampedData.cs +++ b/DD.Persistence.Database/Entity/ITimestampedData.cs @@ -1,4 +1,4 @@ -namespace Persistence.Database.Model; +namespace DD.Persistence.Database.Model; public interface ITimestampedData { /// diff --git a/Persistence.Database/Entity/ParameterData.cs b/DD.Persistence.Database/Entity/ParameterData.cs similarity index 94% rename from Persistence.Database/Entity/ParameterData.cs rename to DD.Persistence.Database/Entity/ParameterData.cs index eb4fa4c..c81b029 100644 --- a/Persistence.Database/Entity/ParameterData.cs +++ b/DD.Persistence.Database/Entity/ParameterData.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Persistence.Database.Entity; +namespace DD.Persistence.Database.Entity; [PrimaryKey(nameof(DiscriminatorId), nameof(ParameterId), nameof(Timestamp))] public class ParameterData diff --git a/Persistence.Database/Entity/Setpoint.cs b/DD.Persistence.Database/Entity/Setpoint.cs similarity index 93% rename from Persistence.Database/Entity/Setpoint.cs rename to DD.Persistence.Database/Entity/Setpoint.cs index 968bdd7..94eca3f 100644 --- a/Persistence.Database/Entity/Setpoint.cs +++ b/DD.Persistence.Database/Entity/Setpoint.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; using System.ComponentModel.DataAnnotations.Schema; -namespace Persistence.Database.Model +namespace DD.Persistence.Database.Model { [PrimaryKey(nameof(Key), nameof(Created))] public class Setpoint diff --git a/Persistence.Database/Entity/TechMessage.cs b/DD.Persistence.Database/Entity/TechMessage.cs similarity index 96% rename from Persistence.Database/Entity/TechMessage.cs rename to DD.Persistence.Database/Entity/TechMessage.cs index 52fcecc..e233941 100644 --- a/Persistence.Database/Entity/TechMessage.cs +++ b/DD.Persistence.Database/Entity/TechMessage.cs @@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Persistence.Database.Entity +namespace DD.Persistence.Database.Entity { public class TechMessage { diff --git a/Persistence.Database/Entity/TimestampedSet.cs b/DD.Persistence.Database/Entity/TimestampedSet.cs similarity index 93% rename from Persistence.Database/Entity/TimestampedSet.cs rename to DD.Persistence.Database/Entity/TimestampedSet.cs index 09a50ee..f0d1815 100644 --- a/Persistence.Database/Entity/TimestampedSet.cs +++ b/DD.Persistence.Database/Entity/TimestampedSet.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; using System.ComponentModel.DataAnnotations.Schema; -namespace Persistence.Database.Entity; +namespace DD.Persistence.Database.Entity; [Comment("Общая таблица данных временных рядов")] [PrimaryKey(nameof(IdDiscriminator), nameof(Timestamp))] diff --git a/Persistence.Database/PersistenceDbContext.cs b/DD.Persistence.Database/PersistenceDbContext.cs similarity index 90% rename from Persistence.Database/PersistenceDbContext.cs rename to DD.Persistence.Database/PersistenceDbContext.cs index e43b1d7..a0587cd 100644 --- a/Persistence.Database/PersistenceDbContext.cs +++ b/DD.Persistence.Database/PersistenceDbContext.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; -using Persistence.Database.Entity; -using Persistence.Database.Model; +using DD.Persistence.Database.Entity; +using DD.Persistence.Database.Model; -namespace Persistence.Database; +namespace DD.Persistence.Database; /// /// EF контекст для любых БД поддерживаемых в EF diff --git a/Persistence.IntegrationTests/BaseIntegrationTest.cs b/DD.Persistence.IntegrationTests/BaseIntegrationTest.cs similarity index 84% rename from Persistence.IntegrationTests/BaseIntegrationTest.cs rename to DD.Persistence.IntegrationTests/BaseIntegrationTest.cs index 9cc68ab..4a15ecf 100644 --- a/Persistence.IntegrationTests/BaseIntegrationTest.cs +++ b/DD.Persistence.IntegrationTests/BaseIntegrationTest.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.DependencyInjection; -using Persistence.Database; -using Persistence.Database.Model; +using DD.Persistence.Database; +using DD.Persistence.Database.Model; using Xunit; -namespace Persistence.IntegrationTests; +namespace DD.Persistence.IntegrationTests; public abstract class BaseIntegrationTest : IClassFixture, IDisposable { protected readonly IServiceScope scope; diff --git a/Persistence.IntegrationTests/Controllers/ChangeLogControllerTest.cs b/DD.Persistence.IntegrationTests/Controllers/ChangeLogControllerTest.cs similarity index 97% rename from Persistence.IntegrationTests/Controllers/ChangeLogControllerTest.cs rename to DD.Persistence.IntegrationTests/Controllers/ChangeLogControllerTest.cs index 51edebd..558ef33 100644 --- a/Persistence.IntegrationTests/Controllers/ChangeLogControllerTest.cs +++ b/DD.Persistence.IntegrationTests/Controllers/ChangeLogControllerTest.cs @@ -1,15 +1,14 @@ using Mapster; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; -using Persistence.Client; -using Persistence.Client.Clients.Interfaces; -using Persistence.Database.Entity; -using Persistence.Database.Model; -using Persistence.Models; -using Persistence.Models.Requests; +using DD.Persistence.Database.Model; +using DD.Persistence.Models; +using DD.Persistence.Models.Requests; using Xunit; +using DD.Persistence.Client.Clients.Interfaces; +using DD.Persistence.Client; -namespace Persistence.IntegrationTests.Controllers; +namespace DD.Persistence.IntegrationTests.Controllers; public class ChangeLogControllerTest : BaseIntegrationTest { private readonly IChangeLogClient client; diff --git a/Persistence.IntegrationTests/Controllers/DataSaubControllerTest.cs b/DD.Persistence.IntegrationTests/Controllers/DataSaubControllerTest.cs similarity index 93% rename from Persistence.IntegrationTests/Controllers/DataSaubControllerTest.cs rename to DD.Persistence.IntegrationTests/Controllers/DataSaubControllerTest.cs index 49365a8..7daad50 100644 --- a/Persistence.IntegrationTests/Controllers/DataSaubControllerTest.cs +++ b/DD.Persistence.IntegrationTests/Controllers/DataSaubControllerTest.cs @@ -1,8 +1,8 @@ -using Persistence.Database.Model; -using Persistence.Models; +using DD.Persistence.Database.Model; +using DD.Persistence.Models; using Xunit; -namespace Persistence.IntegrationTests.Controllers; +namespace DD.Persistence.IntegrationTests.Controllers; public class DataSaubControllerTest : TimeSeriesBaseControllerTest { private readonly DataSaubDto dto = new() diff --git a/Persistence.IntegrationTests/Controllers/DataSourceSystemControllerTest.cs b/DD.Persistence.IntegrationTests/Controllers/DataSourceSystemControllerTest.cs similarity index 89% rename from Persistence.IntegrationTests/Controllers/DataSourceSystemControllerTest.cs rename to DD.Persistence.IntegrationTests/Controllers/DataSourceSystemControllerTest.cs index 8638e90..12c8b95 100644 --- a/Persistence.IntegrationTests/Controllers/DataSourceSystemControllerTest.cs +++ b/DD.Persistence.IntegrationTests/Controllers/DataSourceSystemControllerTest.cs @@ -1,13 +1,13 @@ using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.DependencyInjection; -using Persistence.Client; -using Persistence.Client.Clients; -using Persistence.Client.Clients.Interfaces; -using Persistence.Database.Entity; -using Persistence.Models; +using DD.Persistence.Client; +using DD.Persistence.Client.Clients; +using DD.Persistence.Client.Clients.Interfaces; +using DD.Persistence.Database.Entity; +using DD.Persistence.Models; using Xunit; -namespace Persistence.IntegrationTests.Controllers +namespace DD.Persistence.IntegrationTests.Controllers { public class DataSourceSystemControllerTest : BaseIntegrationTest { diff --git a/Persistence.IntegrationTests/Controllers/SetpointControllerTest.cs b/DD.Persistence.IntegrationTests/Controllers/SetpointControllerTest.cs similarity index 97% rename from Persistence.IntegrationTests/Controllers/SetpointControllerTest.cs rename to DD.Persistence.IntegrationTests/Controllers/SetpointControllerTest.cs index 404d8b2..2770c5e 100644 --- a/Persistence.IntegrationTests/Controllers/SetpointControllerTest.cs +++ b/DD.Persistence.IntegrationTests/Controllers/SetpointControllerTest.cs @@ -1,11 +1,11 @@ using Microsoft.Extensions.DependencyInjection; -using Persistence.Client; -using Persistence.Client.Clients.Interfaces; -using Persistence.Database.Model; +using DD.Persistence.Client; +using DD.Persistence.Client.Clients.Interfaces; +using DD.Persistence.Database.Model; using System.Net; using Xunit; -namespace Persistence.IntegrationTests.Controllers +namespace DD.Persistence.IntegrationTests.Controllers { public class SetpointControllerTest : BaseIntegrationTest { diff --git a/Persistence.IntegrationTests/Controllers/TechMessagesControllerTest.cs b/DD.Persistence.IntegrationTests/Controllers/TechMessagesControllerTest.cs similarity index 96% rename from Persistence.IntegrationTests/Controllers/TechMessagesControllerTest.cs rename to DD.Persistence.IntegrationTests/Controllers/TechMessagesControllerTest.cs index c51804a..eb0fed9 100644 --- a/Persistence.IntegrationTests/Controllers/TechMessagesControllerTest.cs +++ b/DD.Persistence.IntegrationTests/Controllers/TechMessagesControllerTest.cs @@ -1,15 +1,15 @@ using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.DependencyInjection; -using Persistence.Client; -using Persistence.Client.Clients.Interfaces; -using Persistence.Database.Entity; -using Persistence.Models; -using Persistence.Models.Enumerations; -using Persistence.Models.Requests; +using DD.Persistence.Client; +using DD.Persistence.Client.Clients.Interfaces; +using DD.Persistence.Database.Entity; +using DD.Persistence.Models; +using DD.Persistence.Models.Enumerations; +using DD.Persistence.Models.Requests; using System.Net; using Xunit; -namespace Persistence.IntegrationTests.Controllers +namespace DD.Persistence.IntegrationTests.Controllers { public class TechMessagesControllerTest : BaseIntegrationTest { diff --git a/Persistence.IntegrationTests/Controllers/TimeSeriesBaseControllerTest.cs b/DD.Persistence.IntegrationTests/Controllers/TimeSeriesBaseControllerTest.cs similarity index 95% rename from Persistence.IntegrationTests/Controllers/TimeSeriesBaseControllerTest.cs rename to DD.Persistence.IntegrationTests/Controllers/TimeSeriesBaseControllerTest.cs index ef43a10..c083f3b 100644 --- a/Persistence.IntegrationTests/Controllers/TimeSeriesBaseControllerTest.cs +++ b/DD.Persistence.IntegrationTests/Controllers/TimeSeriesBaseControllerTest.cs @@ -1,12 +1,12 @@ using Mapster; using Microsoft.Extensions.DependencyInjection; -using Persistence.Client; -using Persistence.Client.Clients.Interfaces; -using Persistence.Database.Model; +using DD.Persistence.Client; +using DD.Persistence.Client.Clients.Interfaces; +using DD.Persistence.Database.Model; using System.Net; using Xunit; -namespace Persistence.IntegrationTests.Controllers; +namespace DD.Persistence.IntegrationTests.Controllers; public abstract class TimeSeriesBaseControllerTest : BaseIntegrationTest where TEntity : class, ITimestampedData, new() diff --git a/Persistence.IntegrationTests/Controllers/TimestampedSetControllerTest.cs b/DD.Persistence.IntegrationTests/Controllers/TimestampedSetControllerTest.cs similarity index 97% rename from Persistence.IntegrationTests/Controllers/TimestampedSetControllerTest.cs rename to DD.Persistence.IntegrationTests/Controllers/TimestampedSetControllerTest.cs index f3546f5..28dc734 100644 --- a/Persistence.IntegrationTests/Controllers/TimestampedSetControllerTest.cs +++ b/DD.Persistence.IntegrationTests/Controllers/TimestampedSetControllerTest.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.DependencyInjection; -using Persistence.Client; -using Persistence.Client.Clients.Interfaces; -using Persistence.Models; +using DD.Persistence.Client; +using DD.Persistence.Client.Clients.Interfaces; +using DD.Persistence.Models; using Xunit; -namespace Persistence.IntegrationTests.Controllers; +namespace DD.Persistence.IntegrationTests.Controllers; public class TimestampedSetControllerTest : BaseIntegrationTest { private readonly ITimestampedSetClient client; diff --git a/Persistence.IntegrationTests/Controllers/WitsDataControllerTest.cs b/DD.Persistence.IntegrationTests/Controllers/WitsDataControllerTest.cs similarity index 96% rename from Persistence.IntegrationTests/Controllers/WitsDataControllerTest.cs rename to DD.Persistence.IntegrationTests/Controllers/WitsDataControllerTest.cs index 731ec9e..f96d21c 100644 --- a/Persistence.IntegrationTests/Controllers/WitsDataControllerTest.cs +++ b/DD.Persistence.IntegrationTests/Controllers/WitsDataControllerTest.cs @@ -1,13 +1,12 @@ using Microsoft.Extensions.DependencyInjection; -using Persistence.Client; -using Persistence.Client.Clients; -using Persistence.Client.Clients.Interfaces; -using Persistence.Database.Entity; -using Persistence.Models; +using DD.Persistence.Database.Entity; +using DD.Persistence.Models; using System.Net; using Xunit; +using DD.Persistence.Client.Clients.Interfaces; +using DD.Persistence.Client; -namespace Persistence.IntegrationTests.Controllers; +namespace DD.Persistence.IntegrationTests.Controllers; public class WitsDataControllerTest : BaseIntegrationTest { private IWitsDataClient witsDataClient; diff --git a/Persistence.IntegrationTests/Persistence.IntegrationTests.csproj b/DD.Persistence.IntegrationTests/DD.Persistence.IntegrationTests.csproj similarity index 76% rename from Persistence.IntegrationTests/Persistence.IntegrationTests.csproj rename to DD.Persistence.IntegrationTests/DD.Persistence.IntegrationTests.csproj index a5cf35f..d452985 100644 --- a/Persistence.IntegrationTests/Persistence.IntegrationTests.csproj +++ b/DD.Persistence.IntegrationTests/DD.Persistence.IntegrationTests.csproj @@ -24,9 +24,10 @@ - - - + + + + diff --git a/Persistence.IntegrationTests/DbConnection.cs b/DD.Persistence.IntegrationTests/DbConnection.cs similarity index 89% rename from Persistence.IntegrationTests/DbConnection.cs rename to DD.Persistence.IntegrationTests/DbConnection.cs index ac733fa..55ada6b 100644 --- a/Persistence.IntegrationTests/DbConnection.cs +++ b/DD.Persistence.IntegrationTests/DbConnection.cs @@ -1,4 +1,4 @@ -namespace Persistence.IntegrationTests; +namespace DD.Persistence.IntegrationTests; public class DbConnection { public string Host { get; set; } = null!; diff --git a/Persistence.IntegrationTests/EFCoreExtensions.cs b/DD.Persistence.IntegrationTests/EFCoreExtensions.cs similarity index 87% rename from Persistence.IntegrationTests/EFCoreExtensions.cs rename to DD.Persistence.IntegrationTests/EFCoreExtensions.cs index 4e20423..49afd23 100644 --- a/Persistence.IntegrationTests/EFCoreExtensions.cs +++ b/DD.Persistence.IntegrationTests/EFCoreExtensions.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; -namespace Persistence.IntegrationTests; +namespace DD.Persistence.IntegrationTests; public static class EFCoreExtensions { public static void CleanupDbSet(this DbContext dbContext) diff --git a/Persistence.IntegrationTests/TestHttpClientFactory.cs b/DD.Persistence.IntegrationTests/TestHttpClientFactory.cs similarity index 91% rename from Persistence.IntegrationTests/TestHttpClientFactory.cs rename to DD.Persistence.IntegrationTests/TestHttpClientFactory.cs index a158b10..b0f86c8 100644 --- a/Persistence.IntegrationTests/TestHttpClientFactory.cs +++ b/DD.Persistence.IntegrationTests/TestHttpClientFactory.cs @@ -1,4 +1,4 @@ -namespace Persistence.IntegrationTests +namespace DD.Persistence.IntegrationTests { /// /// Фабрика HTTP клиентов для интеграционных тестов diff --git a/Persistence.IntegrationTests/WebAppFactoryFixture.cs b/DD.Persistence.IntegrationTests/WebAppFactoryFixture.cs similarity index 92% rename from Persistence.IntegrationTests/WebAppFactoryFixture.cs rename to DD.Persistence.IntegrationTests/WebAppFactoryFixture.cs index 535236f..0d113a5 100644 --- a/Persistence.IntegrationTests/WebAppFactoryFixture.cs +++ b/DD.Persistence.IntegrationTests/WebAppFactoryFixture.cs @@ -5,13 +5,13 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Logging; -using Persistence.API; -using Persistence.Client; -using Persistence.Database.Model; -using Persistence.Database.Postgres; +using DD.Persistence.API; +using DD.Persistence.Client; +using DD.Persistence.Database.Model; +using DD.Persistence.Database.Postgres; using RestSharp; -namespace Persistence.IntegrationTests; +namespace DD.Persistence.IntegrationTests; public class WebAppFactoryFixture : WebApplicationFactory { private string connectionString = string.Empty; diff --git a/Persistence.Repository/CyclicArray.cs b/DD.Persistence.Repository/CyclicArray.cs similarity index 99% rename from Persistence.Repository/CyclicArray.cs rename to DD.Persistence.Repository/CyclicArray.cs index 1de7a5b..7a7ea1d 100644 --- a/Persistence.Repository/CyclicArray.cs +++ b/DD.Persistence.Repository/CyclicArray.cs @@ -1,6 +1,6 @@ using System.Collections; -namespace Persistence.Repository; +namespace DD.Persistence.Repository; /// /// Цикличный массив /// diff --git a/Persistence.Repository/Persistence.Repository.csproj b/DD.Persistence.Repository/DD.Persistence.Repository.csproj similarity index 70% rename from Persistence.Repository/Persistence.Repository.csproj rename to DD.Persistence.Repository/DD.Persistence.Repository.csproj index 833fc6f..09ea5a5 100644 --- a/Persistence.Repository/Persistence.Repository.csproj +++ b/DD.Persistence.Repository/DD.Persistence.Repository.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/Persistence.Repository/DependencyInjection.cs b/DD.Persistence.Repository/DependencyInjection.cs similarity index 88% rename from Persistence.Repository/DependencyInjection.cs rename to DD.Persistence.Repository/DependencyInjection.cs index a7db05e..6a2e5f4 100644 --- a/Persistence.Repository/DependencyInjection.cs +++ b/DD.Persistence.Repository/DependencyInjection.cs @@ -1,11 +1,11 @@ using Mapster; using Microsoft.Extensions.DependencyInjection; -using Persistence.Database.Model; -using Persistence.Models; -using Persistence.Repositories; -using Persistence.Repository.Repositories; +using DD.Persistence.Database.Model; +using DD.Persistence.Models; +using DD.Persistence.Repositories; +using DD.Persistence.Repository.Repositories; -namespace Persistence.Repository; +namespace DD.Persistence.Repository; public static class DependencyInjection { public static void MapsterSetup() diff --git a/Persistence.Repository/Extensions/EFExtensionsSortBy.cs b/DD.Persistence.Repository/Extensions/EFExtensionsSortBy.cs similarity index 99% rename from Persistence.Repository/Extensions/EFExtensionsSortBy.cs rename to DD.Persistence.Repository/Extensions/EFExtensionsSortBy.cs index 97ca992..bdfc8a2 100644 --- a/Persistence.Repository/Extensions/EFExtensionsSortBy.cs +++ b/DD.Persistence.Repository/Extensions/EFExtensionsSortBy.cs @@ -2,7 +2,7 @@ using System.Collections.Concurrent; using System.Linq.Expressions; using System.Reflection; -namespace Persistence.Repository.Extensions; +namespace DD.Persistence.Repository.Extensions; public static class EFExtensionsSortBy { diff --git a/Persistence.Repository/QueryBuilders.cs b/DD.Persistence.Repository/QueryBuilders.cs similarity index 94% rename from Persistence.Repository/QueryBuilders.cs rename to DD.Persistence.Repository/QueryBuilders.cs index a0e17be..6fad2cc 100644 --- a/Persistence.Repository/QueryBuilders.cs +++ b/DD.Persistence.Repository/QueryBuilders.cs @@ -1,9 +1,9 @@ using Microsoft.EntityFrameworkCore; -using Persistence.Database.Model; -using Persistence.Models; -using Persistence.Models.Requests; +using DD.Persistence.Database.Model; +using DD.Persistence.Models; +using DD.Persistence.Models.Requests; -namespace Persistence.Repository; +namespace DD.Persistence.Repository; /// /// класс с набором методов, необходимых для фильтрации записей diff --git a/Persistence.Repository/Repositories/ChangeLogRepository.cs b/DD.Persistence.Repository/Repositories/ChangeLogRepository.cs similarity index 97% rename from Persistence.Repository/Repositories/ChangeLogRepository.cs rename to DD.Persistence.Repository/Repositories/ChangeLogRepository.cs index aecb62c..ef57d10 100644 --- a/Persistence.Repository/Repositories/ChangeLogRepository.cs +++ b/DD.Persistence.Repository/Repositories/ChangeLogRepository.cs @@ -1,12 +1,12 @@ using Mapster; using Microsoft.EntityFrameworkCore; -using Persistence.Database.Model; -using Persistence.Models; -using Persistence.Models.Requests; -using Persistence.Repositories; +using DD.Persistence.Database.Model; +using DD.Persistence.Models; +using DD.Persistence.Models.Requests; +using DD.Persistence.Repositories; using UuidExtensions; -namespace Persistence.Repository.Repositories; +namespace DD.Persistence.Repository.Repositories; public class ChangeLogRepository : IChangeLogRepository { private readonly DbContext db; diff --git a/Persistence.Repository/Repositories/DataSourceSystemCachedRepository.cs b/DD.Persistence.Repository/Repositories/DataSourceSystemCachedRepository.cs similarity index 94% rename from Persistence.Repository/Repositories/DataSourceSystemCachedRepository.cs rename to DD.Persistence.Repository/Repositories/DataSourceSystemCachedRepository.cs index 5869992..37009e8 100644 --- a/Persistence.Repository/Repositories/DataSourceSystemCachedRepository.cs +++ b/DD.Persistence.Repository/Repositories/DataSourceSystemCachedRepository.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Caching.Memory; -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.Repository.Repositories; +namespace DD.Persistence.Repository.Repositories; public class DataSourceSystemCachedRepository : DataSourceSystemRepository { private static readonly string SystemCacheKey = $"{typeof(Database.Entity.DataSourceSystem).FullName}CacheKey"; diff --git a/DD.Persistence.Repository/Repositories/DataSourceSystemRepository.cs b/DD.Persistence.Repository/Repositories/DataSourceSystemRepository.cs new file mode 100644 index 0000000..d8b6c0a --- /dev/null +++ b/DD.Persistence.Repository/Repositories/DataSourceSystemRepository.cs @@ -0,0 +1,33 @@ +using DD.Persistence.Database.Entity; +using DD.Persistence.Models; +using DD.Persistence.Repositories; +using Mapster; +using Microsoft.EntityFrameworkCore; + +namespace DD.Persistence.Repository.Repositories; +public class DataSourceSystemRepository : IDataSourceSystemRepository +{ + protected DbContext db; + public DataSourceSystemRepository(DbContext db) + { + this.db = db; + } + protected virtual IQueryable GetQueryReadOnly() => db.Set(); + + public virtual async Task Add(DataSourceSystemDto dataSourceSystemDto, CancellationToken token) + { + var entity = dataSourceSystemDto.Adapt(); + + await db.Set().AddAsync(entity, token); + await db.SaveChangesAsync(token); + } + + public virtual async Task> Get(CancellationToken token) + { + var query = GetQueryReadOnly(); + var entities = await query.ToArrayAsync(token); + var dtos = entities.Select(e => e.Adapt()); + + return dtos; + } +} diff --git a/Persistence.Repository/Repositories/ParameterRepository.cs b/DD.Persistence.Repository/Repositories/ParameterRepository.cs similarity index 94% rename from Persistence.Repository/Repositories/ParameterRepository.cs rename to DD.Persistence.Repository/Repositories/ParameterRepository.cs index 38f3ef0..434d59f 100644 --- a/Persistence.Repository/Repositories/ParameterRepository.cs +++ b/DD.Persistence.Repository/Repositories/ParameterRepository.cs @@ -1,10 +1,10 @@ using Mapster; using Microsoft.EntityFrameworkCore; -using Persistence.Database.Entity; -using Persistence.Models; -using Persistence.Repositories; +using DD.Persistence.Database.Entity; +using DD.Persistence.Models; +using DD.Persistence.Repositories; -namespace Persistence.Repository.Repositories; +namespace DD.Persistence.Repository.Repositories; public class ParameterRepository : IParameterRepository { private DbContext db; diff --git a/Persistence.Repository/Repositories/SetpointRepository.cs b/DD.Persistence.Repository/Repositories/SetpointRepository.cs similarity index 95% rename from Persistence.Repository/Repositories/SetpointRepository.cs rename to DD.Persistence.Repository/Repositories/SetpointRepository.cs index 800d7fa..f7a719a 100644 --- a/Persistence.Repository/Repositories/SetpointRepository.cs +++ b/DD.Persistence.Repository/Repositories/SetpointRepository.cs @@ -1,10 +1,10 @@ using Mapster; using Microsoft.EntityFrameworkCore; -using Persistence.Database.Model; -using Persistence.Models; -using Persistence.Repositories; +using DD.Persistence.Database.Model; +using DD.Persistence.Models; +using DD.Persistence.Repositories; -namespace Persistence.Repository.Repositories +namespace DD.Persistence.Repository.Repositories { public class SetpointRepository : ISetpointRepository { diff --git a/Persistence.Repository/Repositories/TechMessagesRepository.cs b/DD.Persistence.Repository/Repositories/TechMessagesRepository.cs similarity index 96% rename from Persistence.Repository/Repositories/TechMessagesRepository.cs rename to DD.Persistence.Repository/Repositories/TechMessagesRepository.cs index 74aff0a..6bbb382 100644 --- a/Persistence.Repository/Repositories/TechMessagesRepository.cs +++ b/DD.Persistence.Repository/Repositories/TechMessagesRepository.cs @@ -2,13 +2,13 @@ using Mapster; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Caching.Memory; using Newtonsoft.Json.Linq; -using Persistence.Database.Entity; -using Persistence.Models; -using Persistence.Models.Requests; -using Persistence.Repositories; +using DD.Persistence.Database.Entity; +using DD.Persistence.Models; +using DD.Persistence.Models.Requests; +using DD.Persistence.Repositories; using UuidExtensions; -namespace Persistence.Repository.Repositories +namespace DD.Persistence.Repository.Repositories { public class TechMessagesRepository : ITechMessagesRepository { diff --git a/Persistence.Repository/Repositories/TimeSeriesDataCachedRepository.cs b/DD.Persistence.Repository/Repositories/TimeSeriesDataCachedRepository.cs similarity index 96% rename from Persistence.Repository/Repositories/TimeSeriesDataCachedRepository.cs rename to DD.Persistence.Repository/Repositories/TimeSeriesDataCachedRepository.cs index 2690c09..768f747 100644 --- a/Persistence.Repository/Repositories/TimeSeriesDataCachedRepository.cs +++ b/DD.Persistence.Repository/Repositories/TimeSeriesDataCachedRepository.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; -using Persistence.Database.Model; -using Persistence.Models; +using DD.Persistence.Database.Model; +using DD.Persistence.Models; -namespace Persistence.Repository.Repositories; +namespace DD.Persistence.Repository.Repositories; public class TimeSeriesDataCachedRepository : TimeSeriesDataRepository where TEntity : class, ITimestampedData, new() diff --git a/Persistence.Repository/Repositories/TimeSeriesDataRepository.cs b/DD.Persistence.Repository/Repositories/TimeSeriesDataRepository.cs similarity index 94% rename from Persistence.Repository/Repositories/TimeSeriesDataRepository.cs rename to DD.Persistence.Repository/Repositories/TimeSeriesDataRepository.cs index ba60f27..c4c634b 100644 --- a/Persistence.Repository/Repositories/TimeSeriesDataRepository.cs +++ b/DD.Persistence.Repository/Repositories/TimeSeriesDataRepository.cs @@ -1,10 +1,10 @@ using Mapster; using Microsoft.EntityFrameworkCore; -using Persistence.Database.Model; -using Persistence.Models; -using Persistence.Repositories; +using DD.Persistence.Database.Model; +using DD.Persistence.Models; +using DD.Persistence.Repositories; -namespace Persistence.Repository.Repositories; +namespace DD.Persistence.Repository.Repositories; public class TimeSeriesDataRepository : ITimeSeriesDataRepository where TEntity : class, ITimestampedData, new() where TDto : class, ITimeSeriesAbstractDto, new() diff --git a/Persistence.Repository/Repositories/TimestampedSetRepository.cs b/DD.Persistence.Repository/Repositories/TimestampedSetRepository.cs similarity index 96% rename from Persistence.Repository/Repositories/TimestampedSetRepository.cs rename to DD.Persistence.Repository/Repositories/TimestampedSetRepository.cs index 158bfd7..6f54521 100644 --- a/Persistence.Repository/Repositories/TimestampedSetRepository.cs +++ b/DD.Persistence.Repository/Repositories/TimestampedSetRepository.cs @@ -1,9 +1,9 @@ using Microsoft.EntityFrameworkCore; -using Persistence.Database.Entity; -using Persistence.Models; -using Persistence.Repositories; +using DD.Persistence.Database.Entity; +using DD.Persistence.Models; +using DD.Persistence.Repositories; -namespace Persistence.Repository.Repositories; +namespace DD.Persistence.Repository.Repositories; /// /// Репозиторий для хранения разных наборов данных временных рядов. diff --git a/Persistence/API/IChangeLogApi.cs b/DD.Persistence/API/IChangeLogApi.cs similarity index 97% rename from Persistence/API/IChangeLogApi.cs rename to DD.Persistence/API/IChangeLogApi.cs index 25b5158..e865894 100644 --- a/Persistence/API/IChangeLogApi.cs +++ b/DD.Persistence/API/IChangeLogApi.cs @@ -1,8 +1,8 @@ using Microsoft.AspNetCore.Mvc; -using Persistence.Models; -using Persistence.Models.Requests; +using DD.Persistence.Models; +using DD.Persistence.Models.Requests; -namespace Persistence.API; +namespace DD.Persistence.API; /// /// Интерфейс для работы с API журнала изменений diff --git a/Persistence/API/ISetpointApi.cs b/DD.Persistence/API/ISetpointApi.cs similarity index 97% rename from Persistence/API/ISetpointApi.cs rename to DD.Persistence/API/ISetpointApi.cs index 9be553e..f600f99 100644 --- a/Persistence/API/ISetpointApi.cs +++ b/DD.Persistence/API/ISetpointApi.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Mvc; -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.API; +namespace DD.Persistence.API; /// /// Интерфейс для API, предназначенного для работы с уставками diff --git a/Persistence/API/ISyncApi.cs b/DD.Persistence/API/ISyncApi.cs similarity index 94% rename from Persistence/API/ISyncApi.cs rename to DD.Persistence/API/ISyncApi.cs index e630ee7..5bd8379 100644 --- a/Persistence/API/ISyncApi.cs +++ b/DD.Persistence/API/ISyncApi.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Mvc; -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.API; +namespace DD.Persistence.API; /// /// Интерфейс для API, предназначенного для синхронизации данных diff --git a/Persistence/API/ISyncWithDiscriminatorApi.cs b/DD.Persistence/API/ISyncWithDiscriminatorApi.cs similarity index 95% rename from Persistence/API/ISyncWithDiscriminatorApi.cs rename to DD.Persistence/API/ISyncWithDiscriminatorApi.cs index eb74533..05f0a90 100644 --- a/Persistence/API/ISyncWithDiscriminatorApi.cs +++ b/DD.Persistence/API/ISyncWithDiscriminatorApi.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Mvc; -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.API; +namespace DD.Persistence.API; /// /// Интерфейс для API, предназначенного для синхронизации данных, у которых есть дискриминатор diff --git a/Persistence/API/ITimeSeriesBaseDataApi.cs b/DD.Persistence/API/ITimeSeriesBaseDataApi.cs similarity index 97% rename from Persistence/API/ITimeSeriesBaseDataApi.cs rename to DD.Persistence/API/ITimeSeriesBaseDataApi.cs index 8f80acb..a16a51d 100644 --- a/Persistence/API/ITimeSeriesBaseDataApi.cs +++ b/DD.Persistence/API/ITimeSeriesBaseDataApi.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Mvc; -namespace Persistence.API; +namespace DD.Persistence.API; /// /// Базовый интерфейс для работы с временными рядами diff --git a/Persistence/API/ITimeSeriesDataApi.cs b/DD.Persistence/API/ITimeSeriesDataApi.cs similarity index 93% rename from Persistence/API/ITimeSeriesDataApi.cs rename to DD.Persistence/API/ITimeSeriesDataApi.cs index 9dc39a4..d9b415a 100644 --- a/Persistence/API/ITimeSeriesDataApi.cs +++ b/DD.Persistence/API/ITimeSeriesDataApi.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Mvc; -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.API; +namespace DD.Persistence.API; /// /// Интерфейс для работы с API временных данных diff --git a/Persistence/API/IWitsDataApi.cs b/DD.Persistence/API/IWitsDataApi.cs similarity index 94% rename from Persistence/API/IWitsDataApi.cs rename to DD.Persistence/API/IWitsDataApi.cs index 5f41b4b..266c5b0 100644 --- a/Persistence/API/IWitsDataApi.cs +++ b/DD.Persistence/API/IWitsDataApi.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Mvc; -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.API; +namespace DD.Persistence.API; /// /// Интерфейс для работы с параметрами Wits diff --git a/Persistence/Persistence.csproj b/DD.Persistence/DD.Persistence.csproj similarity index 91% rename from Persistence/Persistence.csproj rename to DD.Persistence/DD.Persistence.csproj index 3e63047..f43aaa4 100644 --- a/Persistence/Persistence.csproj +++ b/DD.Persistence/DD.Persistence.csproj @@ -4,6 +4,7 @@ net8.0 enable enable + true diff --git a/Persistence/EFExtensions.cs b/DD.Persistence/EFExtensions.cs similarity index 99% rename from Persistence/EFExtensions.cs rename to DD.Persistence/EFExtensions.cs index 425e52a..a308db9 100644 --- a/Persistence/EFExtensions.cs +++ b/DD.Persistence/EFExtensions.cs @@ -2,7 +2,7 @@ using System.Linq.Expressions; using System.Reflection; -namespace Persistence; +namespace DD.Persistence; public static class EFExtensions { struct TypeAccessor diff --git a/Persistence/Factories/IAuthTokenFactory.cs b/DD.Persistence/Factories/IAuthTokenFactory.cs similarity index 86% rename from Persistence/Factories/IAuthTokenFactory.cs rename to DD.Persistence/Factories/IAuthTokenFactory.cs index 2b12095..412565b 100644 --- a/Persistence/Factories/IAuthTokenFactory.cs +++ b/DD.Persistence/Factories/IAuthTokenFactory.cs @@ -1,4 +1,4 @@ -namespace Persistence.Factories; +namespace DD.Persistence.Factories; /// /// Фабрика токенов аутентификации diff --git a/Persistence/Models/ChangeLogDto.cs b/DD.Persistence/Models/ChangeLogDto.cs similarity index 96% rename from Persistence/Models/ChangeLogDto.cs rename to DD.Persistence/Models/ChangeLogDto.cs index d42d659..8f2725b 100644 --- a/Persistence/Models/ChangeLogDto.cs +++ b/DD.Persistence/Models/ChangeLogDto.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models; +namespace DD.Persistence.Models; /// /// Часть записи описывающая изменение diff --git a/Persistence/Models/Configurations/AuthUser.cs b/DD.Persistence/Models/Configurations/AuthUser.cs similarity index 86% rename from Persistence/Models/Configurations/AuthUser.cs rename to DD.Persistence/Models/Configurations/AuthUser.cs index 94f65b7..6287c7f 100644 --- a/Persistence/Models/Configurations/AuthUser.cs +++ b/DD.Persistence/Models/Configurations/AuthUser.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models.Configurations; +namespace DD.Persistence.Models.Configurations; /// /// Настройки credentials для авторизации diff --git a/Persistence/Models/Configurations/JwtParams.cs b/DD.Persistence/Models/Configurations/JwtParams.cs similarity index 91% rename from Persistence/Models/Configurations/JwtParams.cs rename to DD.Persistence/Models/Configurations/JwtParams.cs index 44436ed..767094f 100644 --- a/Persistence/Models/Configurations/JwtParams.cs +++ b/DD.Persistence/Models/Configurations/JwtParams.cs @@ -1,7 +1,7 @@ using Microsoft.IdentityModel.Tokens; using System.Text; -namespace Persistence.Models.Configurations +namespace DD.Persistence.Models.Configurations { public static class JwtParams { diff --git a/Persistence/Models/Configurations/JwtToken.cs b/DD.Persistence/Models/Configurations/JwtToken.cs similarity index 79% rename from Persistence/Models/Configurations/JwtToken.cs rename to DD.Persistence/Models/Configurations/JwtToken.cs index ff19aa9..0e9b066 100644 --- a/Persistence/Models/Configurations/JwtToken.cs +++ b/DD.Persistence/Models/Configurations/JwtToken.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace Persistence.Models.Configurations +namespace DD.Persistence.Models.Configurations { public class JwtToken { diff --git a/Persistence/Models/Configurations/WitsInfo.cs b/DD.Persistence/Models/Configurations/WitsInfo.cs similarity index 68% rename from Persistence/Models/Configurations/WitsInfo.cs rename to DD.Persistence/Models/Configurations/WitsInfo.cs index 76b2a51..26e473f 100644 --- a/Persistence/Models/Configurations/WitsInfo.cs +++ b/DD.Persistence/Models/Configurations/WitsInfo.cs @@ -1,6 +1,6 @@ -using Persistence.Models.Enumerations; +using DD.Persistence.Models.Enumerations; -namespace Persistence.Models.Configurations; +namespace DD.Persistence.Models.Configurations; /// /// Протокол Wits diff --git a/Persistence/Models/DataSaubDto.cs b/DD.Persistence/Models/DataSaubDto.cs similarity index 96% rename from Persistence/Models/DataSaubDto.cs rename to DD.Persistence/Models/DataSaubDto.cs index cd547da..34306d9 100644 --- a/Persistence/Models/DataSaubDto.cs +++ b/DD.Persistence/Models/DataSaubDto.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models; +namespace DD.Persistence.Models; public class DataSaubDto : ITimeSeriesAbstractDto { public DateTimeOffset Date { get; set; } = DateTimeOffset.UtcNow; diff --git a/Persistence/Models/DataSourceSystemDto.cs b/DD.Persistence/Models/DataSourceSystemDto.cs similarity index 93% rename from Persistence/Models/DataSourceSystemDto.cs rename to DD.Persistence/Models/DataSourceSystemDto.cs index 56df611..4abe706 100644 --- a/Persistence/Models/DataSourceSystemDto.cs +++ b/DD.Persistence/Models/DataSourceSystemDto.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models; +namespace DD.Persistence.Models; /// /// Модель системы - источника данных diff --git a/Persistence/Models/DataWithWellDepthAndSectionDto.cs b/DD.Persistence/Models/DataWithWellDepthAndSectionDto.cs similarity index 96% rename from Persistence/Models/DataWithWellDepthAndSectionDto.cs rename to DD.Persistence/Models/DataWithWellDepthAndSectionDto.cs index 033ddb8..7644229 100644 --- a/Persistence/Models/DataWithWellDepthAndSectionDto.cs +++ b/DD.Persistence/Models/DataWithWellDepthAndSectionDto.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models; +namespace DD.Persistence.Models; /// /// Dto для хранения записей, содержащих начальную и конечную глубину забоя, а также секцию diff --git a/Persistence/Models/DatesRangeDto.cs b/DD.Persistence/Models/DatesRangeDto.cs similarity index 90% rename from Persistence/Models/DatesRangeDto.cs rename to DD.Persistence/Models/DatesRangeDto.cs index 1df7369..0a764ce 100644 --- a/Persistence/Models/DatesRangeDto.cs +++ b/DD.Persistence/Models/DatesRangeDto.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models; +namespace DD.Persistence.Models; /// /// Диапазон дат diff --git a/Persistence/Models/Enumerations/EventState.cs b/DD.Persistence/Models/Enumerations/EventState.cs similarity index 55% rename from Persistence/Models/Enumerations/EventState.cs rename to DD.Persistence/Models/Enumerations/EventState.cs index 3f4103c..ab7efa8 100644 --- a/Persistence/Models/Enumerations/EventState.cs +++ b/DD.Persistence/Models/Enumerations/EventState.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models.Enumerations; +namespace DD.Persistence.Models.Enumerations; public enum EventState { NotTriggered = 0, diff --git a/Persistence/Models/Enumerations/WitsType.cs b/DD.Persistence/Models/Enumerations/WitsType.cs similarity index 90% rename from Persistence/Models/Enumerations/WitsType.cs rename to DD.Persistence/Models/Enumerations/WitsType.cs index 888e237..59c9117 100644 --- a/Persistence/Models/Enumerations/WitsType.cs +++ b/DD.Persistence/Models/Enumerations/WitsType.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models.Enumerations; +namespace DD.Persistence.Models.Enumerations; /// /// WITS Data Type Codes diff --git a/Persistence/Models/ITimeSeriesAbstractDto.cs b/DD.Persistence/Models/ITimeSeriesAbstractDto.cs similarity index 88% rename from Persistence/Models/ITimeSeriesAbstractDto.cs rename to DD.Persistence/Models/ITimeSeriesAbstractDto.cs index 39a29cf..b01c104 100644 --- a/Persistence/Models/ITimeSeriesAbstractDto.cs +++ b/DD.Persistence/Models/ITimeSeriesAbstractDto.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models; +namespace DD.Persistence.Models; /// /// Интерфейс, описывающий временные данные diff --git a/Persistence/Models/IWithSectionPart.cs b/DD.Persistence/Models/IWithSectionPart.cs similarity index 82% rename from Persistence/Models/IWithSectionPart.cs rename to DD.Persistence/Models/IWithSectionPart.cs index adb5fdd..8b3fbaf 100644 --- a/Persistence/Models/IWithSectionPart.cs +++ b/DD.Persistence/Models/IWithSectionPart.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models; +namespace DD.Persistence.Models; public interface IWithSectionPart { public double DepthStart { get; set; } diff --git a/Persistence/Models/MessagesStatisticDto.cs b/DD.Persistence/Models/MessagesStatisticDto.cs similarity index 93% rename from Persistence/Models/MessagesStatisticDto.cs rename to DD.Persistence/Models/MessagesStatisticDto.cs index 2e1e419..1a8d984 100644 --- a/Persistence/Models/MessagesStatisticDto.cs +++ b/DD.Persistence/Models/MessagesStatisticDto.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models; +namespace DD.Persistence.Models; /// /// Статистика сообщений по системам бурения diff --git a/Persistence/Models/PaginationContainer.cs b/DD.Persistence/Models/PaginationContainer.cs similarity index 96% rename from Persistence/Models/PaginationContainer.cs rename to DD.Persistence/Models/PaginationContainer.cs index 7054b2c..89306f8 100644 --- a/Persistence/Models/PaginationContainer.cs +++ b/DD.Persistence/Models/PaginationContainer.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models; +namespace DD.Persistence.Models; /// /// Контейнер для поддержки постраничного просмотра таблиц diff --git a/Persistence/Models/ParameterDto.cs b/DD.Persistence/Models/ParameterDto.cs similarity index 96% rename from Persistence/Models/ParameterDto.cs rename to DD.Persistence/Models/ParameterDto.cs index 9413a79..fbc3beb 100644 --- a/Persistence/Models/ParameterDto.cs +++ b/DD.Persistence/Models/ParameterDto.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Persistence.Models; +namespace DD.Persistence.Models; /// /// Модель параметра diff --git a/Persistence/Models/Requests/PaginationRequest.cs b/DD.Persistence/Models/Requests/PaginationRequest.cs similarity index 95% rename from Persistence/Models/Requests/PaginationRequest.cs rename to DD.Persistence/Models/Requests/PaginationRequest.cs index d9974cd..2aca196 100644 --- a/Persistence/Models/Requests/PaginationRequest.cs +++ b/DD.Persistence/Models/Requests/PaginationRequest.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models.Requests; +namespace DD.Persistence.Models.Requests; /// /// Контейнер для поддержки постраничного просмотра таблиц diff --git a/Persistence/Models/Requests/SectionPartRequest.cs b/DD.Persistence/Models/Requests/SectionPartRequest.cs similarity index 92% rename from Persistence/Models/Requests/SectionPartRequest.cs rename to DD.Persistence/Models/Requests/SectionPartRequest.cs index 3eca015..73319c6 100644 --- a/Persistence/Models/Requests/SectionPartRequest.cs +++ b/DD.Persistence/Models/Requests/SectionPartRequest.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models.Requests; +namespace DD.Persistence.Models.Requests; /// /// Запрос для фильтрации данных по секции и глубине diff --git a/Persistence/Models/SetpointLogDto.cs b/DD.Persistence/Models/SetpointLogDto.cs similarity index 92% rename from Persistence/Models/SetpointLogDto.cs rename to DD.Persistence/Models/SetpointLogDto.cs index 663bf30..9a46a99 100644 --- a/Persistence/Models/SetpointLogDto.cs +++ b/DD.Persistence/Models/SetpointLogDto.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models; +namespace DD.Persistence.Models; /// /// Модель для описания лога уставки diff --git a/Persistence/Models/SetpointValueDto.cs b/DD.Persistence/Models/SetpointValueDto.cs similarity index 92% rename from Persistence/Models/SetpointValueDto.cs rename to DD.Persistence/Models/SetpointValueDto.cs index 4cae4ff..6d24b0d 100644 --- a/Persistence/Models/SetpointValueDto.cs +++ b/DD.Persistence/Models/SetpointValueDto.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models; +namespace DD.Persistence.Models; /// /// Модель для хранения значения уставки diff --git a/Persistence/Models/TechMessageDto.cs b/DD.Persistence/Models/TechMessageDto.cs similarity index 93% rename from Persistence/Models/TechMessageDto.cs rename to DD.Persistence/Models/TechMessageDto.cs index e076443..254129a 100644 --- a/Persistence/Models/TechMessageDto.cs +++ b/DD.Persistence/Models/TechMessageDto.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; -using Persistence.Models.Enumerations; +using DD.Persistence.Models.Enumerations; -namespace Persistence.Models +namespace DD.Persistence.Models { /// /// Модель технологического сообщения diff --git a/Persistence/Models/TimestampedSetDto.cs b/DD.Persistence/Models/TimestampedSetDto.cs similarity index 89% rename from Persistence/Models/TimestampedSetDto.cs rename to DD.Persistence/Models/TimestampedSetDto.cs index 3235a4e..cf72032 100644 --- a/Persistence/Models/TimestampedSetDto.cs +++ b/DD.Persistence/Models/TimestampedSetDto.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models; +namespace DD.Persistence.Models; /// /// набор данных с отметкой времени diff --git a/Persistence/Models/WitsDataDto.cs b/DD.Persistence/Models/WitsDataDto.cs similarity index 93% rename from Persistence/Models/WitsDataDto.cs rename to DD.Persistence/Models/WitsDataDto.cs index 982df1f..5aa64f3 100644 --- a/Persistence/Models/WitsDataDto.cs +++ b/DD.Persistence/Models/WitsDataDto.cs @@ -1,4 +1,4 @@ -namespace Persistence.Models; +namespace DD.Persistence.Models; /// /// Группа параметров Wits diff --git a/Persistence/Models/WitsValueDto.cs b/DD.Persistence/Models/WitsValueDto.cs similarity index 95% rename from Persistence/Models/WitsValueDto.cs rename to DD.Persistence/Models/WitsValueDto.cs index dcbd1cb..0cbaed0 100644 --- a/Persistence/Models/WitsValueDto.cs +++ b/DD.Persistence/Models/WitsValueDto.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Persistence.Models; +namespace DD.Persistence.Models; /// /// Параметр Wits diff --git a/Persistence/Repositories/IChangeLogRepository.cs b/DD.Persistence/Repositories/IChangeLogRepository.cs similarity index 97% rename from Persistence/Repositories/IChangeLogRepository.cs rename to DD.Persistence/Repositories/IChangeLogRepository.cs index e197090..41dd379 100644 --- a/Persistence/Repositories/IChangeLogRepository.cs +++ b/DD.Persistence/Repositories/IChangeLogRepository.cs @@ -1,7 +1,7 @@ -using Persistence.Models; -using Persistence.Models.Requests; +using DD.Persistence.Models; +using DD.Persistence.Models.Requests; -namespace Persistence.Repositories; +namespace DD.Persistence.Repositories; /// /// Интерфейс для работы с историческими данными diff --git a/Persistence/Repositories/IDataSourceSystemRepository.cs b/DD.Persistence/Repositories/IDataSourceSystemRepository.cs similarity index 89% rename from Persistence/Repositories/IDataSourceSystemRepository.cs rename to DD.Persistence/Repositories/IDataSourceSystemRepository.cs index d6cf29c..ce674d6 100644 --- a/Persistence/Repositories/IDataSourceSystemRepository.cs +++ b/DD.Persistence/Repositories/IDataSourceSystemRepository.cs @@ -1,6 +1,6 @@ -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.Repositories; +namespace DD.Persistence.Repositories; /// /// Интерфейс по работе с системами - источниками данных diff --git a/Persistence/Repositories/IParameterRepository.cs b/DD.Persistence/Repositories/IParameterRepository.cs similarity index 95% rename from Persistence/Repositories/IParameterRepository.cs rename to DD.Persistence/Repositories/IParameterRepository.cs index 6345708..53c48c3 100644 --- a/Persistence/Repositories/IParameterRepository.cs +++ b/DD.Persistence/Repositories/IParameterRepository.cs @@ -1,6 +1,6 @@ -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.Repositories; +namespace DD.Persistence.Repositories; public interface IParameterRepository { /// diff --git a/Persistence/Repositories/ISetpointRepository.cs b/DD.Persistence/Repositories/ISetpointRepository.cs similarity index 97% rename from Persistence/Repositories/ISetpointRepository.cs rename to DD.Persistence/Repositories/ISetpointRepository.cs index 272c9ec..0af805d 100644 --- a/Persistence/Repositories/ISetpointRepository.cs +++ b/DD.Persistence/Repositories/ISetpointRepository.cs @@ -1,6 +1,6 @@ -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.Repositories; +namespace DD.Persistence.Repositories; /// /// Интерфейс по работе с уставками diff --git a/Persistence/Repositories/ISyncRepository.cs b/DD.Persistence/Repositories/ISyncRepository.cs similarity index 91% rename from Persistence/Repositories/ISyncRepository.cs rename to DD.Persistence/Repositories/ISyncRepository.cs index 5a5c9be..10c21f2 100644 --- a/Persistence/Repositories/ISyncRepository.cs +++ b/DD.Persistence/Repositories/ISyncRepository.cs @@ -1,6 +1,6 @@ -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.Repositories; +namespace DD.Persistence.Repositories; /// /// Интерфейс по работе с данными diff --git a/Persistence/Repositories/ISyncWithDiscriminatorRepository.cs b/DD.Persistence/Repositories/ISyncWithDiscriminatorRepository.cs similarity index 93% rename from Persistence/Repositories/ISyncWithDiscriminatorRepository.cs rename to DD.Persistence/Repositories/ISyncWithDiscriminatorRepository.cs index 7e0bd62..e761c8a 100644 --- a/Persistence/Repositories/ISyncWithDiscriminatorRepository.cs +++ b/DD.Persistence/Repositories/ISyncWithDiscriminatorRepository.cs @@ -1,6 +1,6 @@ -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.Repositories; +namespace DD.Persistence.Repositories; /// /// Интерфейс по работе с данными, у которых есть дискриминатор diff --git a/Persistence/Repositories/ITechMessagesRepository.cs b/DD.Persistence/Repositories/ITechMessagesRepository.cs similarity index 95% rename from Persistence/Repositories/ITechMessagesRepository.cs rename to DD.Persistence/Repositories/ITechMessagesRepository.cs index ebb7563..9909106 100644 --- a/Persistence/Repositories/ITechMessagesRepository.cs +++ b/DD.Persistence/Repositories/ITechMessagesRepository.cs @@ -1,7 +1,7 @@ -using Persistence.Models; -using Persistence.Models.Requests; +using DD.Persistence.Models; +using DD.Persistence.Models.Requests; -namespace Persistence.Repositories +namespace DD.Persistence.Repositories { /// /// Интерфейс по работе с технологическими сообщениями diff --git a/Persistence/Repositories/ITimeSeriesBaseRepository.cs b/DD.Persistence/Repositories/ITimeSeriesBaseRepository.cs similarity index 93% rename from Persistence/Repositories/ITimeSeriesBaseRepository.cs rename to DD.Persistence/Repositories/ITimeSeriesBaseRepository.cs index abe6b05..0d5e531 100644 --- a/Persistence/Repositories/ITimeSeriesBaseRepository.cs +++ b/DD.Persistence/Repositories/ITimeSeriesBaseRepository.cs @@ -1,4 +1,4 @@ -namespace Persistence.Repositories; +namespace DD.Persistence.Repositories; /// /// Интерфейс по работе с прореженными данными diff --git a/Persistence/Repositories/ITimeSeriesDataRepository.cs b/DD.Persistence/Repositories/ITimeSeriesDataRepository.cs similarity index 88% rename from Persistence/Repositories/ITimeSeriesDataRepository.cs rename to DD.Persistence/Repositories/ITimeSeriesDataRepository.cs index aa2c9ff..ed05980 100644 --- a/Persistence/Repositories/ITimeSeriesDataRepository.cs +++ b/DD.Persistence/Repositories/ITimeSeriesDataRepository.cs @@ -1,6 +1,6 @@ -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.Repositories; +namespace DD.Persistence.Repositories; /// /// Интерфейс по работе с временными данными diff --git a/Persistence/Repositories/ITimestampedSetRepository.cs b/DD.Persistence/Repositories/ITimestampedSetRepository.cs similarity index 97% rename from Persistence/Repositories/ITimestampedSetRepository.cs rename to DD.Persistence/Repositories/ITimestampedSetRepository.cs index c350739..cefbb3e 100644 --- a/Persistence/Repositories/ITimestampedSetRepository.cs +++ b/DD.Persistence/Repositories/ITimestampedSetRepository.cs @@ -1,6 +1,6 @@ -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.Repositories; +namespace DD.Persistence.Repositories; /// /// Репозиторий для хранения разных наборов данных рядов. diff --git a/Persistence/Services/Config/WitsConfig.json b/DD.Persistence/Services/Config/WitsConfig.json similarity index 100% rename from Persistence/Services/Config/WitsConfig.json rename to DD.Persistence/Services/Config/WitsConfig.json diff --git a/Persistence/Services/Interfaces/IArchiveService.cs b/DD.Persistence/Services/Interfaces/IArchiveService.cs similarity index 93% rename from Persistence/Services/Interfaces/IArchiveService.cs rename to DD.Persistence/Services/Interfaces/IArchiveService.cs index 73abf3f..9829e21 100644 --- a/Persistence/Services/Interfaces/IArchiveService.cs +++ b/DD.Persistence/Services/Interfaces/IArchiveService.cs @@ -1,4 +1,4 @@ -namespace Persistence.Services.Interfaces; +namespace DD.Persistence.Services.Interfaces; /// /// Сервис по работе с БД diff --git a/Persistence/Services/Interfaces/IWitsDataService.cs b/DD.Persistence/Services/Interfaces/IWitsDataService.cs similarity index 95% rename from Persistence/Services/Interfaces/IWitsDataService.cs rename to DD.Persistence/Services/Interfaces/IWitsDataService.cs index 68c5851..3a18da9 100644 --- a/Persistence/Services/Interfaces/IWitsDataService.cs +++ b/DD.Persistence/Services/Interfaces/IWitsDataService.cs @@ -1,6 +1,6 @@ -using Persistence.Models; +using DD.Persistence.Models; -namespace Persistence.Services.Interfaces; +namespace DD.Persistence.Services.Interfaces; /// /// Сервис для работы с параметрами Wits diff --git a/Persistence/Services/WitsDataService.cs b/DD.Persistence/Services/WitsDataService.cs similarity index 95% rename from Persistence/Services/WitsDataService.cs rename to DD.Persistence/Services/WitsDataService.cs index 100bf56..432c564 100644 --- a/Persistence/Services/WitsDataService.cs +++ b/DD.Persistence/Services/WitsDataService.cs @@ -1,13 +1,13 @@ -using Persistence.Models; -using Persistence.Models.Configurations; -using Persistence.Models.Enumerations; -using Persistence.Repositories; -using Persistence.Services.Interfaces; +using DD.Persistence.Models; +using DD.Persistence.Models.Configurations; +using DD.Persistence.Models.Enumerations; +using DD.Persistence.Repositories; +using DD.Persistence.Services.Interfaces; using System.Globalization; using System.Text.Json; using System.Text.Json.Serialization; -namespace Persistence.Services; +namespace DD.Persistence.Services; public class WitsDataService : IWitsDataService { private readonly IParameterRepository witsDataRepository; diff --git a/Persistence.sln b/Persistence.sln index a8115a8..22c6b2a 100644 --- a/Persistence.sln +++ b/Persistence.sln @@ -3,19 +3,21 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.9.34714.143 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Persistence", "Persistence\Persistence.csproj", "{417177AE-A27E-445B-B3B9-D5EFCEC812A0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DD.Persistence", "DD.Persistence\DD.Persistence.csproj", "{417177AE-A27E-445B-B3B9-D5EFCEC812A0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Persistence.API", "Persistence.API\Persistence.API.csproj", "{8650A227-929E-45F0-AEF7-2C91F45FE884}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DD.Persistence.API", "DD.Persistence.API\DD.Persistence.API.csproj", "{8650A227-929E-45F0-AEF7-2C91F45FE884}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Persistence.Repository", "Persistence.Repository\Persistence.Repository.csproj", "{493D6D92-231B-4CB6-831B-BE13884B0DE4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DD.Persistence.Repository", "DD.Persistence.Repository\DD.Persistence.Repository.csproj", "{493D6D92-231B-4CB6-831B-BE13884B0DE4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Persistence.Database", "Persistence.Database\Persistence.Database.csproj", "{F77475D1-D074-407A-9D69-2FADDDAE2056}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DD.Persistence.Database", "DD.Persistence.Database\DD.Persistence.Database.csproj", "{F77475D1-D074-407A-9D69-2FADDDAE2056}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Persistence.IntegrationTests", "Persistence.IntegrationTests\Persistence.IntegrationTests.csproj", "{10752C25-3773-4081-A1F2-215A1D950126}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DD.Persistence.IntegrationTests", "DD.Persistence.IntegrationTests\DD.Persistence.IntegrationTests.csproj", "{10752C25-3773-4081-A1F2-215A1D950126}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Persistence.Database.Postgres", "Persistence.Database.Postgres\Persistence.Database.Postgres.csproj", "{CC284D27-162D-490C-B6CF-74D666B7C5F3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DD.Persistence.Database.Postgres", "DD.Persistence.Database.Postgres\DD.Persistence.Database.Postgres.csproj", "{CC284D27-162D-490C-B6CF-74D666B7C5F3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Persistence.Client", "Persistence.Client\Persistence.Client.csproj", "{84B68660-48E6-4974-A4E5-517552D9DE23}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DD.Persistence.Client", "DD.Persistence.Client\DD.Persistence.Client.csproj", "{84B68660-48E6-4974-A4E5-517552D9DE23}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DD.Persistence.App", "DD.Persistence.App\DD.Persistence.App.csproj", "{063238BF-E982-43FA-9DDB-7D7D279086D8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -51,6 +53,10 @@ Global {84B68660-48E6-4974-A4E5-517552D9DE23}.Debug|Any CPU.Build.0 = Debug|Any CPU {84B68660-48E6-4974-A4E5-517552D9DE23}.Release|Any CPU.ActiveCfg = Release|Any CPU {84B68660-48E6-4974-A4E5-517552D9DE23}.Release|Any CPU.Build.0 = Release|Any CPU + {063238BF-E982-43FA-9DDB-7D7D279086D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {063238BF-E982-43FA-9DDB-7D7D279086D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {063238BF-E982-43FA-9DDB-7D7D279086D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {063238BF-E982-43FA-9DDB-7D7D279086D8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 654b1f5a0354a1fb11405b112044b56ac44208c3 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 16 Dec 2024 17:17:07 +0500 Subject: [PATCH 2/5] Persistence.sln rename into DD.Persistence.sln --- DD.Persistence.App/Readme.md | 3 +-- Persistence.sln => DD.Persistence.sln | 0 2 files changed, 1 insertion(+), 2 deletions(-) rename Persistence.sln => DD.Persistence.sln (100%) diff --git a/DD.Persistence.App/Readme.md b/DD.Persistence.App/Readme.md index 987a2bf..f0e7d34 100644 --- a/DD.Persistence.App/Readme.md +++ b/DD.Persistence.App/Readme.md @@ -12,8 +12,7 @@ DD.Persistence.App - проект исполняемого файла микро - Database - название базы данных; - Username - пользователь базы данных; - Password - пароль базы данных; -- Больше информации о настройке подключения к postgreSQL можно прочесть по ссылке: -```https://www.npgsql.org/doc/connection-string-parameters.html``` +- Больше информации о настройке подключения к postgreSQL можно прочесть по [ссылке](https://www.npgsql.org/doc/connection-string-parameters.html) ### Авторизация 1. В проекте предусмотрены 2 типа авторизации: diff --git a/Persistence.sln b/DD.Persistence.sln similarity index 100% rename from Persistence.sln rename to DD.Persistence.sln From 98d8a5b77f1dc549c1afe6c1b9432b92d6c6c6a9 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 16 Dec 2024 17:47:12 +0500 Subject: [PATCH 3/5] =?UTF-8?q?WebApplicationFactory=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BC=D0=B5=D0=BD=D1=8F=D0=BD=20=D0=BD=D0=B0=20WebApplic?= =?UTF-8?q?ationFactory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DD.Persistence.IntegrationTests/WebAppFactoryFixture.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DD.Persistence.IntegrationTests/WebAppFactoryFixture.cs b/DD.Persistence.IntegrationTests/WebAppFactoryFixture.cs index 0d113a5..84c1a9e 100644 --- a/DD.Persistence.IntegrationTests/WebAppFactoryFixture.cs +++ b/DD.Persistence.IntegrationTests/WebAppFactoryFixture.cs @@ -10,9 +10,10 @@ using DD.Persistence.Client; using DD.Persistence.Database.Model; using DD.Persistence.Database.Postgres; using RestSharp; +using DD.Persistence.App; namespace DD.Persistence.IntegrationTests; -public class WebAppFactoryFixture : WebApplicationFactory +public class WebAppFactoryFixture : WebApplicationFactory { private string connectionString = string.Empty; From 441d5293730dd2ac5e549ef7b60908245103abc6 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 16 Dec 2024 17:58:35 +0500 Subject: [PATCH 4/5] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D1=81=D0=B5=D0=BA=D1=86=D0=B8=D0=B8=20Authentication=20=D0=B2?= =?UTF-8?q?=D0=BD=D1=83=D1=82=D1=80=D0=B8=20appsettings.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DD.Persistence.API/DependencyInjection.cs | 5 +++-- DD.Persistence.App/appsettings.json | 1 - DD.Persistence.App/defaultsettings.json | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/DD.Persistence.API/DependencyInjection.cs b/DD.Persistence.API/DependencyInjection.cs index d009aae..0b0ee72 100644 --- a/DD.Persistence.API/DependencyInjection.cs +++ b/DD.Persistence.API/DependencyInjection.cs @@ -74,15 +74,16 @@ public static class DependencyInjection private static void AddKeyCloakAuthentication(this IServiceCollection services, IConfiguration configuration) { + var keyCloakHost = configuration["Authentication:Audience"]; services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(options => { options.RequireHttpsMetadata = false; options.Audience = configuration["Authentication:Audience"]; - options.MetadataAddress = configuration["Authentication:MetadataAddress"]!; + options.MetadataAddress = $"{keyCloakHost}/.well-known/openid-configuration"; options.TokenValidationParameters = new TokenValidationParameters { - ValidIssuer = configuration["Authentication:ValidIssuer"], + ValidIssuer = keyCloakHost, }; }); } diff --git a/DD.Persistence.App/appsettings.json b/DD.Persistence.App/appsettings.json index d4248fb..bec1541 100644 --- a/DD.Persistence.App/appsettings.json +++ b/DD.Persistence.App/appsettings.json @@ -10,7 +10,6 @@ }, "AllowedHosts": "*", "Authentication": { - "MetadataAddress": "http://192.168.0.10:8321/realms/Persistence/.well-known/openid-configuration", "Audience": "account", "ValidIssuer": "http://192.168.0.10:8321/realms/Persistence", "AuthorizationUrl": "http://192.168.0.10:8321/realms/Persistence/protocol/openid-connect/auth" diff --git a/DD.Persistence.App/defaultsettings.json b/DD.Persistence.App/defaultsettings.json index d4248fb..bec1541 100644 --- a/DD.Persistence.App/defaultsettings.json +++ b/DD.Persistence.App/defaultsettings.json @@ -10,7 +10,6 @@ }, "AllowedHosts": "*", "Authentication": { - "MetadataAddress": "http://192.168.0.10:8321/realms/Persistence/.well-known/openid-configuration", "Audience": "account", "ValidIssuer": "http://192.168.0.10:8321/realms/Persistence", "AuthorizationUrl": "http://192.168.0.10:8321/realms/Persistence/protocol/openid-connect/auth" From 218eb6520199f22f8fd87ff2cc18160dcb4cbe4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D1=8F=20=D0=91=D0=B8=D0=B7=D1=8E=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0?= Date: Tue, 17 Dec 2024 10:58:30 +0500 Subject: [PATCH 5/5] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B5=D0=BA=20Keycloak=20?= =?UTF-8?q?=D0=B2=20appsettings.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DD.Persistence.API/DependencyInjection.cs | 10 ++++++---- DD.Persistence.App/appsettings.json | 9 ++++----- DD.Persistence.App/defaultsettings.json | 9 ++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/DD.Persistence.API/DependencyInjection.cs b/DD.Persistence.API/DependencyInjection.cs index 0b0ee72..b5068cc 100644 --- a/DD.Persistence.API/DependencyInjection.cs +++ b/DD.Persistence.API/DependencyInjection.cs @@ -74,16 +74,16 @@ public static class DependencyInjection private static void AddKeyCloakAuthentication(this IServiceCollection services, IConfiguration configuration) { - var keyCloakHost = configuration["Authentication:Audience"]; + var keyCloakHost = configuration["KeyCloakAuthentication:Host"]; services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(options => { options.RequireHttpsMetadata = false; - options.Audience = configuration["Authentication:Audience"]; + options.Audience = configuration["KeyCloakAuthentication:Audience"]; options.MetadataAddress = $"{keyCloakHost}/.well-known/openid-configuration"; options.TokenValidationParameters = new TokenValidationParameters { - ValidIssuer = keyCloakHost, + ValidIssuer = keyCloakHost }; }); } @@ -144,6 +144,8 @@ public static class DependencyInjection #region Keycloak private static void AddKeycloakSecurity(this SwaggerGenOptions options, IConfiguration configuration) { + var keyCloakHost = configuration["KeyCloakAuthentication:Host"]; + options.AddSecurityDefinition("Keycloak", new OpenApiSecurityScheme { Description = @"JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token in the text input below. Example: 'Bearer 12345token'", @@ -154,7 +156,7 @@ public static class DependencyInjection { Implicit = new OpenApiOAuthFlow { - AuthorizationUrl = new Uri(configuration["Authentication:AuthorizationUrl"]!), + AuthorizationUrl = new Uri($"{keyCloakHost}/protocol/openid-connect/auth"), } } }); diff --git a/DD.Persistence.App/appsettings.json b/DD.Persistence.App/appsettings.json index bec1541..9b3a54f 100644 --- a/DD.Persistence.App/appsettings.json +++ b/DD.Persistence.App/appsettings.json @@ -9,12 +9,11 @@ "DefaultConnection": "Host=localhost;Database=persistence;Username=postgres;Password=q;Persist Security Info=True" }, "AllowedHosts": "*", - "Authentication": { - "Audience": "account", - "ValidIssuer": "http://192.168.0.10:8321/realms/Persistence", - "AuthorizationUrl": "http://192.168.0.10:8321/realms/Persistence/protocol/openid-connect/auth" - }, "NeedUseKeyCloak": false, + "KeyCloakAuthentication": { + "Audience": "account", + "Host": "http://192.168.0.10:8321/realms/Persistence" + }, "AuthUser": { "username": "myuser", "password": 12345, diff --git a/DD.Persistence.App/defaultsettings.json b/DD.Persistence.App/defaultsettings.json index bec1541..9b3a54f 100644 --- a/DD.Persistence.App/defaultsettings.json +++ b/DD.Persistence.App/defaultsettings.json @@ -9,12 +9,11 @@ "DefaultConnection": "Host=localhost;Database=persistence;Username=postgres;Password=q;Persist Security Info=True" }, "AllowedHosts": "*", - "Authentication": { - "Audience": "account", - "ValidIssuer": "http://192.168.0.10:8321/realms/Persistence", - "AuthorizationUrl": "http://192.168.0.10:8321/realms/Persistence/protocol/openid-connect/auth" - }, "NeedUseKeyCloak": false, + "KeyCloakAuthentication": { + "Audience": "account", + "Host": "http://192.168.0.10:8321/realms/Persistence" + }, "AuthUser": { "username": "myuser", "password": 12345,