Merge pull request 'Исправить namespace' (#13) from feature/#644-new-namespaces into master

Reviewed-on: #13
This commit is contained in:
on.nemtina 2024-12-17 10:59:12 +05:00
commit 47f57ba86a
166 changed files with 727 additions and 401 deletions

View File

@ -1,11 +1,11 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Persistence.Models; using DD.Persistence.Models;
using Persistence.Models.Requests; using DD.Persistence.Models.Requests;
using Persistence.Repositories; using DD.Persistence.Repositories;
using System.Net; using System.Net;
namespace Persistence.API.Controllers; namespace DD.Persistence.API.Controllers;
[ApiController] [ApiController]
[Authorize] [Authorize]

View File

@ -1,9 +1,9 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Persistence.Models; using DD.Persistence.Models;
using Persistence.Repositories; using DD.Persistence.Repositories;
namespace Persistence.API.Controllers; namespace DD.Persistence.API.Controllers;
/// <summary> /// <summary>
/// Работа с временными данными /// Работа с временными данными

View File

@ -1,10 +1,10 @@
using System.Net; using System.Net;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Persistence.Models; using DD.Persistence.Models;
using Persistence.Repositories; using DD.Persistence.Repositories;
namespace Persistence.API.Controllers; namespace DD.Persistence.API.Controllers;
/// <summary> /// <summary>
/// Работа с системами /// Работа с системами

View File

@ -1,10 +1,10 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Persistence.Models; using DD.Persistence.Models;
using Persistence.Repositories; using DD.Persistence.Repositories;
using System.Net; using System.Net;
namespace Persistence.API.Controllers; namespace DD.Persistence.API.Controllers;
/// <summary> /// <summary>
/// Работа с уставками /// Работа с уставками

View File

@ -1,11 +1,11 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Persistence.Models; using DD.Persistence.Models;
using Persistence.Models.Requests; using DD.Persistence.Models.Requests;
using Persistence.Repositories; using DD.Persistence.Repositories;
using System.Net; using System.Net;
namespace Persistence.API.Controllers; namespace DD.Persistence.API.Controllers;
/// <summary> /// <summary>
/// Работа с технологическими сообщениями систем автобурения (АБ) /// Работа с технологическими сообщениями систем автобурения (АБ)

View File

@ -1,9 +1,9 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Persistence.Models; using DD.Persistence.Models;
using Persistence.Repositories; using DD.Persistence.Repositories;
namespace Persistence.API.Controllers; namespace DD.Persistence.API.Controllers;
[ApiController] [ApiController]
[Authorize] [Authorize]

View File

@ -1,10 +1,10 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Persistence.Models; using DD.Persistence.Models;
using Persistence.Repositories; using DD.Persistence.Repositories;
using System.Net; using System.Net;
namespace Persistence.API.Controllers; namespace DD.Persistence.API.Controllers;
/// <summary> /// <summary>
/// Хранение наборов данных с отметкой времени. /// Хранение наборов данных с отметкой времени.

View File

@ -1,10 +1,10 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Persistence.Models; using DD.Persistence.Models;
using Persistence.Services.Interfaces; using DD.Persistence.Services.Interfaces;
using System.Net; using System.Net;
namespace Persistence.API.Controllers; namespace DD.Persistence.API.Controllers;
/// <summary> /// <summary>
/// Работа с параметрами Wits /// Работа с параметрами Wits

View File

@ -1,17 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<GenerateDocumentationFile>True</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn> <NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<VersionPrefix>1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH))</VersionPrefix> <VersionPrefix>1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH))</VersionPrefix>
<AssemblyVersion>1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH))</AssemblyVersion> <AssemblyVersion>1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH))</AssemblyVersion>
<OutputType>Library</OutputType>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -22,9 +23,10 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Persistence.Database.Postgres\Persistence.Database.Postgres.csproj" /> <ProjectReference Include="..\DD.Persistence.Database.Postgres\DD.Persistence.Database.Postgres.csproj" />
<ProjectReference Include="..\Persistence.Repository\Persistence.Repository.csproj" /> <ProjectReference Include="..\DD.Persistence.Database\DD.Persistence.Database.csproj" />
<ProjectReference Include="..\Persistence\Persistence.csproj" /> <ProjectReference Include="..\DD.Persistence.Repository\DD.Persistence.Repository.csproj" />
<ProjectReference Include="..\DD.Persistence\DD.Persistence.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -3,16 +3,16 @@ using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
using Microsoft.OpenApi.Any; using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Models;
using Persistence.Database.Entity; using DD.Persistence.Models;
using Persistence.Models; using DD.Persistence.Models.Configurations;
using Persistence.Models.Configurations; using DD.Persistence.Services;
using Persistence.Services; using DD.Persistence.Services.Interfaces;
using Persistence.Services.Interfaces;
using Swashbuckle.AspNetCore.SwaggerGen; using Swashbuckle.AspNetCore.SwaggerGen;
using System.Reflection; using System.Reflection;
using System.Text.Json.Nodes; using System.Text.Json.Nodes;
using DD.Persistence.Database.Entity;
namespace Persistence.API; namespace DD.Persistence.API;
public static class DependencyInjection public static class DependencyInjection
{ {
@ -74,15 +74,16 @@ public static class DependencyInjection
private static void AddKeyCloakAuthentication(this IServiceCollection services, IConfiguration configuration) private static void AddKeyCloakAuthentication(this IServiceCollection services, IConfiguration configuration)
{ {
var keyCloakHost = configuration["KeyCloakAuthentication:Host"];
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options => .AddJwtBearer(options =>
{ {
options.RequireHttpsMetadata = false; options.RequireHttpsMetadata = false;
options.Audience = configuration["Authentication:Audience"]; options.Audience = configuration["KeyCloakAuthentication:Audience"];
options.MetadataAddress = configuration["Authentication:MetadataAddress"]!; options.MetadataAddress = $"{keyCloakHost}/.well-known/openid-configuration";
options.TokenValidationParameters = new TokenValidationParameters options.TokenValidationParameters = new TokenValidationParameters
{ {
ValidIssuer = configuration["Authentication:ValidIssuer"], ValidIssuer = keyCloakHost
}; };
}); });
} }
@ -143,6 +144,8 @@ public static class DependencyInjection
#region Keycloak #region Keycloak
private static void AddKeycloakSecurity(this SwaggerGenOptions options, IConfiguration configuration) private static void AddKeycloakSecurity(this SwaggerGenOptions options, IConfiguration configuration)
{ {
var keyCloakHost = configuration["KeyCloakAuthentication:Host"];
options.AddSecurityDefinition("Keycloak", new OpenApiSecurityScheme 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'", Description = @"JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token in the text input below. Example: 'Bearer 12345token'",
@ -153,7 +156,7 @@ public static class DependencyInjection
{ {
Implicit = new OpenApiOAuthFlow Implicit = new OpenApiOAuthFlow
{ {
AuthorizationUrl = new Uri(configuration["Authentication:AuthorizationUrl"]!), AuthorizationUrl = new Uri($"{keyCloakHost}/protocol/openid-connect/auth"),
} }
} }
}); });

View File

@ -1,7 +1,7 @@
using System.ComponentModel; using System.ComponentModel;
using System.Security.Claims; using System.Security.Claims;
namespace Persistence.API; namespace DD.Persistence.API;
public static class Extensions public static class Extensions
{ {

View File

@ -1,8 +1,8 @@
using Persistence.Database.Model; using DD.Persistence.Database.Model;
using Persistence.Database.Postgres; using DD.Persistence.Database.Postgres;
using Persistence.Repository; using DD.Persistence.Repository;
namespace Persistence.API; namespace DD.Persistence.API;
public class Startup public class Startup
{ {

View File

@ -0,0 +1,5 @@
{
"version": 1,
"isRoot": true,
"tools": {}
}

View File

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>8dcdcfed-c959-4eef-9891-ae60b1b136ea</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
<_WebToolingArtifacts Remove="Properties\PublishProfiles\LinuxRelease.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\WindowsRelease.pubxml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.3" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DD.Persistence.API\DD.Persistence.API.csproj" />
</ItemGroup>
</Project>

View File

@ -4,21 +4,22 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app USER app
WORKDIR /app WORKDIR /app
EXPOSE 8080 EXPOSE 8080
EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release ARG BUILD_CONFIGURATION=Release
WORKDIR /src WORKDIR /src
COPY ["Persistence.API/Persistence.API.csproj", "Persistence.API/"] COPY ["DD.Persistence.App/DD.Persistence.App.csproj", "DD.Persistence.App/"]
RUN dotnet restore "./Persistence.API/Persistence.API.csproj" RUN dotnet restore "./DD.Persistence.App/DD.Persistence.App.csproj"
COPY . . COPY . .
WORKDIR "/src/Persistence.API" WORKDIR "/src/DD.Persistence.App"
RUN dotnet build "./Persistence.API.csproj" -c $BUILD_CONFIGURATION -o /app/build RUN dotnet build "./DD.Persistence.App.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish FROM build AS publish
ARG BUILD_CONFIGURATION=Release 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 FROM base AS final
WORKDIR /app WORKDIR /app
COPY --from=publish /app/publish . COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Persistence.API.dll"] ENTRYPOINT ["dotnet", "DD.Persistence.App.dll"]

View File

@ -1,4 +1,7 @@
namespace Persistence.API;
using DD.Persistence.API;
namespace DD.Persistence.App;
public class Program public class Program
{ {

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<DeleteExistingFiles>true</DeleteExistingFiles>
<ExcludeApp_Data>false</ExcludeApp_Data>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\Release\net8.0\publish\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<ProjectGuid>063238bf-e982-43fa-9ddb-7d7d279086d8</ProjectGuid>
<SelfContained>true</SelfContained>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<DeleteExistingFiles>true</DeleteExistingFiles>
<ExcludeApp_Data>false</ExcludeApp_Data>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\Release\net8.0\publish\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<ProjectGuid>063238bf-e982-43fa-9ddb-7d7d279086d8</ProjectGuid>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>

View File

@ -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
}
}
}

View File

@ -0,0 +1,29 @@
# 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`

View File

@ -9,13 +9,11 @@
"DefaultConnection": "Host=localhost;Database=persistence;Username=postgres;Password=q;Persist Security Info=True" "DefaultConnection": "Host=localhost;Database=persistence;Username=postgres;Password=q;Persist Security Info=True"
}, },
"AllowedHosts": "*", "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, "NeedUseKeyCloak": false,
"KeyCloakAuthentication": {
"Audience": "account",
"Host": "http://192.168.0.10:8321/realms/Persistence"
},
"AuthUser": { "AuthUser": {
"username": "myuser", "username": "myuser",
"password": 12345, "password": 12345,

View File

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"NeedUseKeyCloak": false
}

View File

@ -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"
}

View File

@ -0,0 +1,24 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"DefaultConnection": "Host=localhost;Database=persistence;Username=postgres;Password=q;Persist Security Info=True"
},
"AllowedHosts": "*",
"NeedUseKeyCloak": false,
"KeyCloakAuthentication": {
"Audience": "account",
"Host": "http://192.168.0.10:8321/realms/Persistence"
},
"AuthUser": {
"username": "myuser",
"password": 12345,
"clientId": "webapi",
"grantType": "password",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier": "7d9f3574-6574-4ca3-845a-0276eb4aa8f6"
}
}

View File

@ -1,8 +1,8 @@
using Microsoft.Extensions.Logging; using DD.Persistence.Client.Helpers;
using Persistence.Client.Helpers; using Microsoft.Extensions.Logging;
using Refit; using Refit;
namespace Persistence.Client.Clients.Base; namespace DD.Persistence.Client.Clients.Base;
public abstract class BaseClient public abstract class BaseClient
{ {
private readonly ILogger logger; private readonly ILogger logger;

View File

@ -1,10 +1,10 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Persistence.Client.Clients.Base; using DD.Persistence.Client.Clients.Base;
using Persistence.Client.Clients.Interfaces; using DD.Persistence.Client.Clients.Interfaces;
using Persistence.Models; using DD.Persistence.Models;
using Persistence.Models.Requests; using DD.Persistence.Models.Requests;
namespace Persistence.Client.Clients; namespace DD.Persistence.Client.Clients;
public class ChangeLogClient : BaseClient, IChangeLogClient public class ChangeLogClient : BaseClient, IChangeLogClient
{ {
private readonly Interfaces.Refit.IRefitChangeLogClient refitChangeLogClient; private readonly Interfaces.Refit.IRefitChangeLogClient refitChangeLogClient;

View File

@ -1,10 +1,10 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Persistence.Client.Clients.Base; using DD.Persistence.Client.Clients.Base;
using Persistence.Client.Clients.Interfaces; using DD.Persistence.Client.Clients.Interfaces;
using Persistence.Client.Clients.Interfaces.Refit; using DD.Persistence.Client.Clients.Interfaces.Refit;
using Persistence.Models; using DD.Persistence.Models;
namespace Persistence.Client.Clients; namespace DD.Persistence.Client.Clients;
public class DataSourceSystemClient : BaseClient, IDataSourceSystemClient public class DataSourceSystemClient : BaseClient, IDataSourceSystemClient
{ {
private readonly IRefitDataSourceSystemClient dataSourceSystemClient; private readonly IRefitDataSourceSystemClient dataSourceSystemClient;

View File

@ -1,7 +1,7 @@
using Persistence.Models; using DD.Persistence.Models;
using Persistence.Models.Requests; using DD.Persistence.Models.Requests;
namespace Persistence.Client.Clients.Interfaces; namespace DD.Persistence.Client.Clients.Interfaces;
/// <summary> /// <summary>
/// Клиент для работы с записями ChangeLog /// Клиент для работы с записями ChangeLog

View File

@ -1,7 +1,7 @@
using Persistence.Models; using DD.Persistence.Models;
using Refit; using Refit;
namespace Persistence.Client.Clients.Interfaces; namespace DD.Persistence.Client.Clients.Interfaces;
/// <summary> /// <summary>
/// Клиент для работы с системами /// Клиент для работы с системами

View File

@ -1,6 +1,6 @@
using Persistence.Models; using DD.Persistence.Models;
namespace Persistence.Client.Clients.Interfaces; namespace DD.Persistence.Client.Clients.Interfaces;
/// <summary> /// <summary>
/// Клиент для работы с уставками /// Клиент для работы с уставками

View File

@ -1,7 +1,7 @@
using Persistence.Models; using DD.Persistence.Models;
using Persistence.Models.Requests; using DD.Persistence.Models.Requests;
namespace Persistence.Client.Clients.Interfaces; namespace DD.Persistence.Client.Clients.Interfaces;
/// <summary> /// <summary>
/// Клиент для работы с технологическими сообщениями /// Клиент для работы с технологическими сообщениями

View File

@ -1,6 +1,6 @@
using Persistence.Models; using DD.Persistence.Models;
namespace Persistence.Client.Clients.Interfaces; namespace DD.Persistence.Client.Clients.Interfaces;
/// <summary> /// <summary>
/// Клиент для работы с временными данными /// Клиент для работы с временными данными

View File

@ -1,6 +1,6 @@
using Persistence.Models; using DD.Persistence.Models;
namespace Persistence.Client.Clients.Interfaces; namespace DD.Persistence.Client.Clients.Interfaces;
/// <summary> /// <summary>
/// Клиент для работы с репозиторием для хранения разных наборов данных рядов. /// Клиент для работы с репозиторием для хранения разных наборов данных рядов.

View File

@ -1,7 +1,7 @@
using Persistence.Models; using DD.Persistence.Models;
using Refit; using Refit;
namespace Persistence.Client.Clients.Interfaces; namespace DD.Persistence.Client.Clients.Interfaces;
/// <summary> /// <summary>
/// Клиент для работы с параметрами Wits /// Клиент для работы с параметрами Wits

View File

@ -1,8 +1,8 @@
using Persistence.Models; using DD.Persistence.Models;
using Persistence.Models.Requests; using DD.Persistence.Models.Requests;
using Refit; using Refit;
namespace Persistence.Client.Clients.Interfaces.Refit; namespace DD.Persistence.Client.Clients.Interfaces.Refit;
public interface IRefitChangeLogClient : IDisposable public interface IRefitChangeLogClient : IDisposable
{ {

View File

@ -1,7 +1,7 @@
using Persistence.Models; using DD.Persistence.Models;
using Refit; using Refit;
namespace Persistence.Client.Clients.Interfaces.Refit; namespace DD.Persistence.Client.Clients.Interfaces.Refit;
public interface IRefitDataSourceSystemClient : IDisposable public interface IRefitDataSourceSystemClient : IDisposable
{ {
private const string BaseRoute = "/api/dataSourceSystem"; private const string BaseRoute = "/api/dataSourceSystem";

View File

@ -1,7 +1,7 @@
using Persistence.Models; using DD.Persistence.Models;
using Refit; using Refit;
namespace Persistence.Client.Clients.Interfaces.Refit; namespace DD.Persistence.Client.Clients.Interfaces.Refit;
public interface IRefitSetpointClient : IDisposable public interface IRefitSetpointClient : IDisposable
{ {

View File

@ -1,9 +1,9 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Persistence.Models; using DD.Persistence.Models;
using Persistence.Models.Requests; using DD.Persistence.Models.Requests;
using Refit; using Refit;
namespace Persistence.Client.Clients.Interfaces.Refit namespace DD.Persistence.Client.Clients.Interfaces.Refit
{ {
public interface IRefitTechMessagesClient : IDisposable public interface IRefitTechMessagesClient : IDisposable
{ {

View File

@ -1,7 +1,7 @@
using Persistence.Models; using DD.Persistence.Models;
using Refit; using Refit;
namespace Persistence.Client.Clients.Interfaces.Refit; namespace DD.Persistence.Client.Clients.Interfaces.Refit;
public interface IRefitTimeSeriesClient<TDto> : IDisposable public interface IRefitTimeSeriesClient<TDto> : IDisposable
where TDto : class, new() where TDto : class, new()
{ {

View File

@ -1,7 +1,7 @@
using Persistence.Models; using DD.Persistence.Models;
using Refit; using Refit;
namespace Persistence.Client.Clients.Interfaces.Refit; namespace DD.Persistence.Client.Clients.Interfaces.Refit;
public interface IRefitTimestampedSetClient : IDisposable public interface IRefitTimestampedSetClient : IDisposable
{ {

View File

@ -1,8 +1,8 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Persistence.Models; using DD.Persistence.Models;
using Refit; using Refit;
namespace Persistence.Client.Clients.Interfaces.Refit; namespace DD.Persistence.Client.Clients.Interfaces.Refit;
public interface IRefitWitsDataClient : IDisposable public interface IRefitWitsDataClient : IDisposable
{ {
private const string BaseRoute = "/api/witsData"; private const string BaseRoute = "/api/witsData";

View File

@ -1,10 +1,10 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Persistence.Client.Clients.Base; using DD.Persistence.Client.Clients.Base;
using Persistence.Client.Clients.Interfaces; using DD.Persistence.Client.Clients.Interfaces;
using Persistence.Client.Clients.Interfaces.Refit; using DD.Persistence.Client.Clients.Interfaces.Refit;
using Persistence.Models; using DD.Persistence.Models;
namespace Persistence.Client.Clients; namespace DD.Persistence.Client.Clients;
public class SetpointClient : BaseClient, ISetpointClient public class SetpointClient : BaseClient, ISetpointClient
{ {

View File

@ -1,11 +1,11 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Persistence.Client.Clients.Base; using DD.Persistence.Client.Clients.Base;
using Persistence.Client.Clients.Interfaces; using DD.Persistence.Client.Clients.Interfaces;
using Persistence.Client.Clients.Interfaces.Refit; using DD.Persistence.Client.Clients.Interfaces.Refit;
using Persistence.Models; using DD.Persistence.Models;
using Persistence.Models.Requests; using DD.Persistence.Models.Requests;
namespace Persistence.Client.Clients; namespace DD.Persistence.Client.Clients;
public class TechMessagesClient : BaseClient, ITechMessagesClient public class TechMessagesClient : BaseClient, ITechMessagesClient
{ {

View File

@ -1,10 +1,10 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Persistence.Client.Clients.Base; using DD.Persistence.Client.Clients.Base;
using Persistence.Client.Clients.Interfaces; using DD.Persistence.Client.Clients.Interfaces;
using Persistence.Client.Clients.Interfaces.Refit; using DD.Persistence.Client.Clients.Interfaces.Refit;
using Persistence.Models; using DD.Persistence.Models;
namespace Persistence.Client.Clients; namespace DD.Persistence.Client.Clients;
public class TimeSeriesClient<TDto> : BaseClient, ITimeSeriesClient<TDto> where TDto : class, new() public class TimeSeriesClient<TDto> : BaseClient, ITimeSeriesClient<TDto> where TDto : class, new()
{ {
private readonly IRefitTimeSeriesClient<TDto> timeSeriesClient; private readonly IRefitTimeSeriesClient<TDto> timeSeriesClient;

View File

@ -1,10 +1,10 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Persistence.Client.Clients.Base; using DD.Persistence.Client.Clients.Base;
using Persistence.Client.Clients.Interfaces; using DD.Persistence.Client.Clients.Interfaces;
using Persistence.Client.Clients.Interfaces.Refit; using DD.Persistence.Client.Clients.Interfaces.Refit;
using Persistence.Models; using DD.Persistence.Models;
namespace Persistence.Client.Clients; namespace DD.Persistence.Client.Clients;
public class TimestampedSetClient : BaseClient, ITimestampedSetClient public class TimestampedSetClient : BaseClient, ITimestampedSetClient
{ {
private readonly IRefitTimestampedSetClient refitTimestampedSetClient; private readonly IRefitTimestampedSetClient refitTimestampedSetClient;

View File

@ -1,10 +1,10 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Persistence.Client.Clients.Base; using DD.Persistence.Client.Clients.Base;
using Persistence.Client.Clients.Interfaces; using DD.Persistence.Client.Clients.Interfaces;
using Persistence.Client.Clients.Interfaces.Refit; using DD.Persistence.Client.Clients.Interfaces.Refit;
using Persistence.Models; using DD.Persistence.Models;
namespace Persistence.Client.Clients; namespace DD.Persistence.Client.Clients;
public class WitsDataClient : BaseClient, IWitsDataClient public class WitsDataClient : BaseClient, IWitsDataClient
{ {
private readonly IRefitWitsDataClient refitWitsDataClient; private readonly IRefitWitsDataClient refitWitsDataClient;

View File

@ -1,4 +1,4 @@
namespace Persistence.Client.CustomExceptions; namespace DD.Persistence.Client.CustomExceptions;
/// <summary> /// <summary>
/// Not Acceptable (406) /// Not Acceptable (406)

View File

@ -1,4 +1,4 @@
namespace Persistence.Client.CustomExceptions; namespace DD.Persistence.Client.CustomExceptions;
/// <summary> /// <summary>
/// Bad gateway (502) /// Bad gateway (502)

View File

@ -1,4 +1,4 @@
namespace Persistence.Client.CustomExceptions; namespace DD.Persistence.Client.CustomExceptions;
/// <summary> /// <summary>
/// Forbidden (403) /// Forbidden (403)

View File

@ -1,4 +1,4 @@
namespace Persistence.Client.CustomExceptions; namespace DD.Persistence.Client.CustomExceptions;
/// <summary> /// <summary>
/// Internal Server Error (500) /// Internal Server Error (500)

View File

@ -1,4 +1,4 @@
namespace Persistence.Client.CustomExceptions; namespace DD.Persistence.Client.CustomExceptions;
/// <summary> /// <summary>
/// Locked (423) /// Locked (423)

View File

@ -1,4 +1,4 @@
namespace Persistence.Client.CustomExceptions; namespace DD.Persistence.Client.CustomExceptions;
/// <summary> /// <summary>
/// Service Unavailable Error (503) /// Service Unavailable Error (503)

View File

@ -1,4 +1,4 @@
namespace Persistence.Client.CustomExceptions; namespace DD.Persistence.Client.CustomExceptions;
/// <summary> /// <summary>
/// Too Many Requests (429) /// Too Many Requests (429)

View File

@ -0,0 +1,63 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!--Генерация NuGet пакета при сборке-->
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<!--Наименование-->
<Title>Persistence.Client</Title>
<!--Версия пакета-->
<VersionPrefix>1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH))</VersionPrefix>
<!--Версия сборки-->
<AssemblyVersion>1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH))</AssemblyVersion>
<!--Id пакета-->
<PackageId>Persistence.Client</PackageId>
<!--Автор-->
<Authors>Digital Drilling</Authors>
<!--Компания-->
<Company>Digital Drilling</Company>
<!--Описание-->
<Description>Пакет для получения клиентов для работы с Persistence сервисом</Description>
<!--Url репозитория-->
<RepositoryUrl>https://git.ddrilling.ru/on.nemtina/persistence.git</RepositoryUrl>
<!--тип репозитория-->
<RepositoryType>git</RepositoryType>
<!--Символы отладки-->
<IncludeSymbols>true</IncludeSymbols>
<!--Формат пакета с символами-->
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<!--Путь к пакету-->
<PackageOutputPath>C:\Projects\Nuget</PackageOutputPath>
<!--Readme-->
<PackageReadmeFile>Readme.md</PackageReadmeFile>
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH))</VersionPrefix>
<AssemblyVersion>1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH))</AssemblyVersion>
</PropertyGroup>
<ItemGroup>
<None Include="Readme.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.2.1" />
<PackageReference Include="Refit" Version="8.0.0" />
<PackageReference Include="Refit.HttpClientFactory" Version="8.0.0" />
<PackageReference Include="RestSharp" Version="112.1.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.2.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DD.Persistence\DD.Persistence.csproj" />
</ItemGroup>
</Project>

View File

@ -1,13 +1,13 @@
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
using Persistence.Models.Configurations; using DD.Persistence.Models.Configurations;
using RestSharp; using RestSharp;
using System.IdentityModel.Tokens.Jwt; using System.IdentityModel.Tokens.Jwt;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Security.Claims; using System.Security.Claims;
using System.Text.Json; using System.Text.Json;
namespace Persistence.Client.Helpers; namespace DD.Persistence.Client.Helpers;
public static class ApiTokenHelper public static class ApiTokenHelper
{ {
public static void Authorize(this HttpClient httpClient, IConfiguration configuration) public static void Authorize(this HttpClient httpClient, IConfiguration configuration)

View File

@ -1,8 +1,8 @@
using System.ComponentModel.DataAnnotations; using DD.Persistence.Client.CustomExceptions;
using Persistence.Client.CustomExceptions;
using Refit; using Refit;
using System.ComponentModel.DataAnnotations;
namespace Persistence.Client.Helpers; namespace DD.Persistence.Client.Helpers;
public static class ExceptionsHelper public static class ExceptionsHelper
{ {
private static readonly Dictionary<System.Net.HttpStatusCode, Exception> ExceptionsDictionary = new Dictionary<System.Net.HttpStatusCode, Exception>() private static readonly Dictionary<System.Net.HttpStatusCode, Exception> ExceptionsDictionary = new Dictionary<System.Net.HttpStatusCode, Exception>()

View File

@ -1,15 +1,15 @@
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Persistence.Client.Clients.Interfaces; using DD.Persistence.Client.Clients.Interfaces;
using Persistence.Client.Clients; using DD.Persistence.Client.Clients;
using Persistence.Client.Helpers; using DD.Persistence.Client.Helpers;
using Refit; using Refit;
using Persistence.Factories; using DD.Persistence.Factories;
using Persistence.Client.Clients.Interfaces.Refit; using DD.Persistence.Client.Clients.Interfaces.Refit;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using System.Text.Json; using System.Text.Json;
namespace Persistence.Client namespace DD.Persistence.Client
{ {
/// <summary> /// <summary>
/// Фабрика клиентов для доступа к Persistence - сервису /// Фабрика клиентов для доступа к Persistence - сервису

View File

@ -6,7 +6,7 @@ Persistence сервис отвечает за работу с хранимым
## Описание пакета ## Описание пакета
Данный пакет предоставляет возможность взаимодействия с Данный пакет предоставляет возможность взаимодействия с
Persistence сервисом посредством обращения к конкретному Persistence сервисом посредством обращения к конкретному
клиенту, ответсвенному за работу с одной из областей сервиса. клиенту, ответственному за работу с одной из областей сервиса.
## Список предоставляемых клиентов ## Список предоставляемых клиентов
- `ISetpointClient` - Клиент для работы с уставками - `ISetpointClient` - Клиент для работы с уставками
@ -31,7 +31,7 @@ Persistence сервисом посредством обращения к кон
4. Обратиться к фабрике Persistence - клиентов и получить требуемого клиента. 4. Обратиться к фабрике Persistence - клиентов и получить требуемого клиента.
## xunit тестирование ## xunit тестирование
При написании интеграционных тестов с ипользованием Persistence - клиентов При написании интеграционных тестов с использованием Persistence - клиентов
Http - клиент не обязан быть авторизован через передачу токена в `PersistenceClientFactory`. Http - клиент не обязан быть авторизован через передачу токена в `PersistenceClientFactory`.
Для осуществления тестовой авторизации достаточно добавить в `appsettings.Tests.json` : Для осуществления тестовой авторизации достаточно добавить в `appsettings.Tests.json` :
```json ```json

View File

@ -14,12 +14,12 @@
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.10" /> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.10" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Persistence.Database\Persistence.Database.csproj" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Migrations\" /> <Folder Include="Migrations\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DD.Persistence.Database\DD.Persistence.Database.csproj" />
</ItemGroup>
</Project> </Project>

View File

@ -2,7 +2,7 @@
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace Persistence.Database.Model; namespace DD.Persistence.Database.Model;
public static class DependencyInjection public static class DependencyInjection
{ {

View File

@ -1,9 +1,9 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design; using Microsoft.EntityFrameworkCore.Design;
using Npgsql; using Npgsql;
using Persistence.Database.Model; using DD.Persistence.Database.Model;
namespace Persistence.Database.Postgres; namespace DD.Persistence.Database.Postgres;
/// <summary> /// <summary>
/// Фабрика контекста для dotnet ef миграций /// Фабрика контекста для dotnet ef миграций

View File

@ -2,7 +2,7 @@
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using System.Diagnostics; using System.Diagnostics;
namespace Persistence.Database.Postgres; namespace DD.Persistence.Database.Postgres;
public static class EFExtensionsInitialization public static class EFExtensionsInitialization
{ {
public static void EnsureCreatedAndMigrated(this DatabaseFacade db) public static void EnsureCreatedAndMigrated(this DatabaseFacade db)

View File

@ -2,7 +2,7 @@
#nullable disable #nullable disable
namespace Persistence.Database.Postgres.Migrations namespace DD.Persistence.Database.Postgres.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class SetpointMigration : Migration public partial class SetpointMigration : Migration

View File

@ -6,11 +6,11 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Persistence.Database.Model; using DD.Persistence.Database.Model;
#nullable disable #nullable disable
namespace Persistence.Database.Postgres.Migrations namespace DD.Persistence.Database.Postgres.Migrations
{ {
[DbContext(typeof(PersistenceDbContext))] [DbContext(typeof(PersistenceDbContext))]
[Migration("20241126071115_Add_ChangeLog")] [Migration("20241126071115_Add_ChangeLog")]
@ -28,7 +28,7 @@ namespace Persistence.Database.Postgres.Migrations
NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack");
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Persistence.Database.Model.ChangeLog", b => modelBuilder.Entity("DD.Persistence.Database.Model.ChangeLog", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -81,7 +81,7 @@ namespace Persistence.Database.Postgres.Migrations
b.ToTable("ChangeLog"); b.ToTable("ChangeLog");
}); });
modelBuilder.Entity("Persistence.Database.Model.DataSaub", b => modelBuilder.Entity("DD.Persistence.Database.Model.DataSaub", b =>
{ {
b.Property<DateTimeOffset>("Date") b.Property<DateTimeOffset>("Date")
.HasColumnType("timestamp with time zone") .HasColumnType("timestamp with time zone")

View File

@ -2,7 +2,7 @@
#nullable disable #nullable disable
namespace Persistence.Database.Postgres.Migrations namespace DD.Persistence.Database.Postgres.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class Add_ChangeLog : Migration public partial class Add_ChangeLog : Migration

View File

@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Persistence.Database.Model; using DD.Persistence.Database.Model;
#nullable disable #nullable disable
namespace Persistence.Database.Postgres.Migrations namespace DD.Persistence.Database.Postgres.Migrations
{ {
[DbContext(typeof(PersistencePostgresContext))] [DbContext(typeof(PersistencePostgresContext))]
[Migration("20241126100631_Init")] [Migration("20241126100631_Init")]
@ -27,7 +27,7 @@ namespace Persistence.Database.Postgres.Migrations
NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack");
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Persistence.Database.Entity.TimestampedSet", b => modelBuilder.Entity("DD.Persistence.Database.Entity.TimestampedSet", b =>
{ {
b.Property<Guid>("IdDiscriminator") b.Property<Guid>("IdDiscriminator")
.HasColumnType("uuid") .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<DateTimeOffset>("Date") b.Property<DateTimeOffset>("Date")
.HasColumnType("timestamp with time zone") .HasColumnType("timestamp with time zone")
@ -133,7 +133,7 @@ namespace Persistence.Database.Postgres.Migrations
b.ToTable("DataSaub"); b.ToTable("DataSaub");
}); });
modelBuilder.Entity("Persistence.Database.Model.Setpoint", b => modelBuilder.Entity("DD.Persistence.Database.Model.Setpoint", b =>
{ {
b.Property<Guid>("Key") b.Property<Guid>("Key")
.HasColumnType("uuid") .HasColumnType("uuid")

View File

@ -2,7 +2,7 @@
#nullable disable #nullable disable
namespace Persistence.Database.Postgres.Migrations namespace DD.Persistence.Database.Postgres.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class Init : Migration public partial class Init : Migration

View File

@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Persistence.Database.Model; using DD.Persistence.Database.Model;
#nullable disable #nullable disable
namespace Persistence.Database.Postgres.Migrations namespace DD.Persistence.Database.Postgres.Migrations
{ {
[DbContext(typeof(PersistenceDbContext))] [DbContext(typeof(PersistenceDbContext))]
[Migration("20241203120141_ParameterDataMigration")] [Migration("20241203120141_ParameterDataMigration")]
@ -27,7 +27,7 @@ namespace Persistence.Database.Postgres.Migrations
NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack");
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Persistence.Database.Entity.DrillingSystem", b => modelBuilder.Entity("DD.Persistence.Database.Entity.DrillingSystem", b =>
{ {
b.Property<Guid>("SystemId") b.Property<Guid>("SystemId")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -48,7 +48,7 @@ namespace Persistence.Database.Postgres.Migrations
b.ToTable("DrillingSystem"); b.ToTable("DrillingSystem");
}); });
modelBuilder.Entity("Persistence.Database.Entity.ParameterData", b => modelBuilder.Entity("DD.Persistence.Database.Entity.ParameterData", b =>
{ {
b.Property<int>("DiscriminatorId") b.Property<int>("DiscriminatorId")
.HasColumnType("integer") .HasColumnType("integer")
@ -72,7 +72,7 @@ namespace Persistence.Database.Postgres.Migrations
b.ToTable("ParameterData"); b.ToTable("ParameterData");
}); });
modelBuilder.Entity("Persistence.Database.Entity.TechMessage", b => modelBuilder.Entity("DD.Persistence.Database.Entity.TechMessage", b =>
{ {
b.Property<Guid>("EventId") b.Property<Guid>("EventId")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -111,7 +111,7 @@ namespace Persistence.Database.Postgres.Migrations
b.ToTable("TechMessage"); b.ToTable("TechMessage");
}); });
modelBuilder.Entity("Persistence.Database.Entity.TimestampedSet", b => modelBuilder.Entity("DD.Persistence.Database.Entity.TimestampedSet", b =>
{ {
b.Property<Guid>("IdDiscriminator") b.Property<Guid>("IdDiscriminator")
.HasColumnType("uuid") .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<DateTimeOffset>("Date") b.Property<DateTimeOffset>("Date")
.HasColumnType("timestamp with time zone") .HasColumnType("timestamp with time zone")
@ -217,7 +217,7 @@ namespace Persistence.Database.Postgres.Migrations
b.ToTable("DataSaub"); b.ToTable("DataSaub");
}); });
modelBuilder.Entity("Persistence.Database.Model.Setpoint", b => modelBuilder.Entity("DD.Persistence.Database.Model.Setpoint", b =>
{ {
b.Property<Guid>("Key") b.Property<Guid>("Key")
.HasColumnType("uuid") .HasColumnType("uuid")
@ -241,9 +241,9 @@ namespace Persistence.Database.Postgres.Migrations
b.ToTable("Setpoint"); 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() .WithMany()
.HasForeignKey("SystemId") .HasForeignKey("SystemId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)

View File

@ -2,7 +2,7 @@
#nullable disable #nullable disable
namespace Persistence.Database.Postgres.Migrations namespace DD.Persistence.Database.Postgres.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class ParameterDataMigration : Migration public partial class ParameterDataMigration : Migration

View File

@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Persistence.Database.Model; using DD.Persistence.Database.Model;
#nullable disable #nullable disable
namespace Persistence.Database.Postgres.Migrations.PersistencePostgres namespace DD.Persistence.Database.Postgres.Migrations.PersistencePostgres
{ {
[DbContext(typeof(PersistencePostgresContext))] [DbContext(typeof(PersistencePostgresContext))]
[Migration("20241212041758_TechMessageMigration")] [Migration("20241212041758_TechMessageMigration")]
@ -27,7 +27,7 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres
NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack");
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Persistence.Database.Entity.DrillingSystem", b => modelBuilder.Entity("DD.Persistence.Database.Entity.DrillingSystem", b =>
{ {
b.Property<Guid>("SystemId") b.Property<Guid>("SystemId")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -48,7 +48,7 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres
b.ToTable("DrillingSystem"); b.ToTable("DrillingSystem");
}); });
modelBuilder.Entity("Persistence.Database.Entity.ParameterData", b => modelBuilder.Entity("DD.Persistence.Database.Entity.ParameterData", b =>
{ {
b.Property<Guid>("DiscriminatorId") b.Property<Guid>("DiscriminatorId")
.HasColumnType("uuid") .HasColumnType("uuid")
@ -72,7 +72,7 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres
b.ToTable("ParameterData"); b.ToTable("ParameterData");
}); });
modelBuilder.Entity("Persistence.Database.Entity.TechMessage", b => modelBuilder.Entity("DD.Persistence.Database.Entity.TechMessage", b =>
{ {
b.Property<Guid>("EventId") b.Property<Guid>("EventId")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -107,7 +107,7 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres
b.ToTable("TechMessage"); b.ToTable("TechMessage");
}); });
modelBuilder.Entity("Persistence.Database.Entity.TimestampedSet", b => modelBuilder.Entity("DD.Persistence.Database.Entity.TimestampedSet", b =>
{ {
b.Property<Guid>("IdDiscriminator") b.Property<Guid>("IdDiscriminator")
.HasColumnType("uuid") .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<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -183,7 +183,7 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres
b.ToTable("ChangeLog"); b.ToTable("ChangeLog");
}); });
modelBuilder.Entity("Persistence.Database.Model.DataSaub", b => modelBuilder.Entity("DD.Persistence.Database.Model.DataSaub", b =>
{ {
b.Property<DateTimeOffset>("Date") b.Property<DateTimeOffset>("Date")
.HasColumnType("timestamp with time zone") .HasColumnType("timestamp with time zone")
@ -266,7 +266,7 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres
b.ToTable("DataSaub"); b.ToTable("DataSaub");
}); });
modelBuilder.Entity("Persistence.Database.Model.Setpoint", b => modelBuilder.Entity("DD.Persistence.Database.Model.Setpoint", b =>
{ {
b.Property<Guid>("Key") b.Property<Guid>("Key")
.HasColumnType("uuid") .HasColumnType("uuid")
@ -290,9 +290,9 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres
b.ToTable("Setpoint"); 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() .WithMany()
.HasForeignKey("SystemId") .HasForeignKey("SystemId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)

View File

@ -2,7 +2,7 @@
#nullable disable #nullable disable
namespace Persistence.Database.Postgres.Migrations.PersistencePostgres namespace DD.Persistence.Database.Postgres.Migrations.PersistencePostgres
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class TechMessageMigration : Migration public partial class TechMessageMigration : Migration

View File

@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Persistence.Database.Model; using DD.Persistence.Database.Model;
#nullable disable #nullable disable
namespace Persistence.Database.Postgres.Migrations namespace DD.Persistence.Database.Postgres.Migrations
{ {
[DbContext(typeof(PersistencePostgresContext))] [DbContext(typeof(PersistencePostgresContext))]
partial class PersistencePostgresContextModelSnapshot : ModelSnapshot partial class PersistencePostgresContextModelSnapshot : ModelSnapshot
@ -24,7 +24,7 @@ namespace Persistence.Database.Postgres.Migrations
NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack");
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Persistence.Database.Entity.DataSourceSystem", b => modelBuilder.Entity("DD.Persistence.Database.Entity.DataSourceSystem", b =>
{ {
b.Property<Guid>("SystemId") b.Property<Guid>("SystemId")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -45,7 +45,7 @@ namespace Persistence.Database.Postgres.Migrations
b.ToTable("DataSourceSystem"); b.ToTable("DataSourceSystem");
}); });
modelBuilder.Entity("Persistence.Database.Entity.ParameterData", b => modelBuilder.Entity("DD.Persistence.Database.Entity.ParameterData", b =>
{ {
b.Property<Guid>("DiscriminatorId") b.Property<Guid>("DiscriminatorId")
.HasColumnType("uuid") .HasColumnType("uuid")
@ -69,7 +69,7 @@ namespace Persistence.Database.Postgres.Migrations
b.ToTable("ParameterData"); b.ToTable("ParameterData");
}); });
modelBuilder.Entity("Persistence.Database.Entity.TechMessage", b => modelBuilder.Entity("DD.Persistence.Database.Entity.TechMessage", b =>
{ {
b.Property<Guid>("EventId") b.Property<Guid>("EventId")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -104,7 +104,7 @@ namespace Persistence.Database.Postgres.Migrations
b.ToTable("TechMessage"); b.ToTable("TechMessage");
}); });
modelBuilder.Entity("Persistence.Database.Entity.TimestampedSet", b => modelBuilder.Entity("DD.Persistence.Database.Entity.TimestampedSet", b =>
{ {
b.Property<Guid>("IdDiscriminator") b.Property<Guid>("IdDiscriminator")
.HasColumnType("uuid") .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<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -180,7 +180,7 @@ namespace Persistence.Database.Postgres.Migrations
b.ToTable("ChangeLog"); b.ToTable("ChangeLog");
}); });
modelBuilder.Entity("Persistence.Database.Model.DataSaub", b => modelBuilder.Entity("DD.Persistence.Database.Model.DataSaub", b =>
{ {
b.Property<DateTimeOffset>("Date") b.Property<DateTimeOffset>("Date")
.HasColumnType("timestamp with time zone") .HasColumnType("timestamp with time zone")
@ -263,7 +263,7 @@ namespace Persistence.Database.Postgres.Migrations
b.ToTable("DataSaub"); b.ToTable("DataSaub");
}); });
modelBuilder.Entity("Persistence.Database.Model.Setpoint", b => modelBuilder.Entity("DD.Persistence.Database.Model.Setpoint", b =>
{ {
b.Property<Guid>("Key") b.Property<Guid>("Key")
.HasColumnType("uuid") .HasColumnType("uuid")
@ -287,9 +287,9 @@ namespace Persistence.Database.Postgres.Migrations
b.ToTable("Setpoint"); 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() .WithMany()
.HasForeignKey("SystemId") .HasForeignKey("SystemId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)

View File

@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace Persistence.Database.Model; namespace DD.Persistence.Database.Model;
/// <summary> /// <summary>
/// EF êîíòåêñò äëÿ ÁÄ Postgres /// EF êîíòåêñò äëÿ ÁÄ Postgres

View File

@ -0,0 +1,11 @@
## Создать миграцию
```
dotnet ef migrations add <MigrationName> --project DD.Persistence.Database.Postgres
```
## Откатить миграцию
```
dotnet ef migrations remove --project DD.Persistence.Database.Postgres
```
Удаляется последняя созданная миграция.

View File

@ -15,7 +15,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Persistence\Persistence.csproj" /> <ProjectReference Include="..\DD.Persistence\DD.Persistence.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -2,7 +2,7 @@
using System.Text.Json; using System.Text.Json;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
namespace Persistence.Database; namespace DD.Persistence.Database;
public static class EFExtensions public static class EFExtensions
{ {

View File

@ -1,10 +1,10 @@
 
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Persistence.Models; using DD.Persistence.Models;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Persistence.Database.Model; namespace DD.Persistence.Database.Model;
/// <summary> /// <summary>
/// Часть записи, описывающая изменение /// Часть записи, описывающая изменение

View File

@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Persistence.Database.Model; namespace DD.Persistence.Database.Model;
public class DataSaub : ITimestampedData public class DataSaub : ITimestampedData
{ {
[Key, Column("date")] [Key, Column("date")]

View File

@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Persistence.Database.Entity; namespace DD.Persistence.Database.Entity;
public class DataSourceSystem public class DataSourceSystem
{ {
[Key, Comment("Id системы - источника данных")] [Key, Comment("Id системы - источника данных")]

View File

@ -1,5 +1,5 @@
 
namespace Persistence.Database.Model; namespace DD.Persistence.Database.Model;
/// <summary> /// <summary>
/// Часть записи, описывающая изменение /// Часть записи, описывающая изменение

View File

@ -1,4 +1,4 @@
namespace Persistence.Database.Model; namespace DD.Persistence.Database.Model;
public interface ITimestampedData public interface ITimestampedData
{ {
/// <summary> /// <summary>

View File

@ -2,7 +2,7 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Persistence.Database.Entity; namespace DD.Persistence.Database.Entity;
[PrimaryKey(nameof(DiscriminatorId), nameof(ParameterId), nameof(Timestamp))] [PrimaryKey(nameof(DiscriminatorId), nameof(ParameterId), nameof(Timestamp))]
public class ParameterData public class ParameterData

View File

@ -1,7 +1,7 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Persistence.Database.Model namespace DD.Persistence.Database.Model
{ {
[PrimaryKey(nameof(Key), nameof(Created))] [PrimaryKey(nameof(Key), nameof(Created))]
public class Setpoint public class Setpoint

View File

@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Persistence.Database.Entity namespace DD.Persistence.Database.Entity
{ {
public class TechMessage public class TechMessage
{ {

View File

@ -1,7 +1,7 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Persistence.Database.Entity; namespace DD.Persistence.Database.Entity;
[Comment("Общая таблица данных временных рядов")] [Comment("Общая таблица данных временных рядов")]
[PrimaryKey(nameof(IdDiscriminator), nameof(Timestamp))] [PrimaryKey(nameof(IdDiscriminator), nameof(Timestamp))]

View File

@ -1,8 +1,8 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Persistence.Database.Entity; using DD.Persistence.Database.Entity;
using Persistence.Database.Model; using DD.Persistence.Database.Model;
namespace Persistence.Database; namespace DD.Persistence.Database;
/// <summary> /// <summary>
/// EF контекст для любых БД поддерживаемых в EF /// EF контекст для любых БД поддерживаемых в EF

View File

@ -1,9 +1,9 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Persistence.Database; using DD.Persistence.Database;
using Persistence.Database.Model; using DD.Persistence.Database.Model;
using Xunit; using Xunit;
namespace Persistence.IntegrationTests; namespace DD.Persistence.IntegrationTests;
public abstract class BaseIntegrationTest : IClassFixture<WebAppFactoryFixture>, IDisposable public abstract class BaseIntegrationTest : IClassFixture<WebAppFactoryFixture>, IDisposable
{ {
protected readonly IServiceScope scope; protected readonly IServiceScope scope;

View File

@ -1,15 +1,14 @@
using Mapster; using Mapster;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Persistence.Client; using DD.Persistence.Database.Model;
using Persistence.Client.Clients.Interfaces; using DD.Persistence.Models;
using Persistence.Database.Entity; using DD.Persistence.Models.Requests;
using Persistence.Database.Model;
using Persistence.Models;
using Persistence.Models.Requests;
using Xunit; 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 public class ChangeLogControllerTest : BaseIntegrationTest
{ {
private readonly IChangeLogClient client; private readonly IChangeLogClient client;

View File

@ -1,8 +1,8 @@
using Persistence.Database.Model; using DD.Persistence.Database.Model;
using Persistence.Models; using DD.Persistence.Models;
using Xunit; using Xunit;
namespace Persistence.IntegrationTests.Controllers; namespace DD.Persistence.IntegrationTests.Controllers;
public class DataSaubControllerTest : TimeSeriesBaseControllerTest<DataSaub, DataSaubDto> public class DataSaubControllerTest : TimeSeriesBaseControllerTest<DataSaub, DataSaubDto>
{ {
private readonly DataSaubDto dto = new() private readonly DataSaubDto dto = new()

View File

@ -1,13 +1,13 @@
using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Persistence.Client; using DD.Persistence.Client;
using Persistence.Client.Clients; using DD.Persistence.Client.Clients;
using Persistence.Client.Clients.Interfaces; using DD.Persistence.Client.Clients.Interfaces;
using Persistence.Database.Entity; using DD.Persistence.Database.Entity;
using Persistence.Models; using DD.Persistence.Models;
using Xunit; using Xunit;
namespace Persistence.IntegrationTests.Controllers namespace DD.Persistence.IntegrationTests.Controllers
{ {
public class DataSourceSystemControllerTest : BaseIntegrationTest public class DataSourceSystemControllerTest : BaseIntegrationTest
{ {

View File

@ -1,11 +1,11 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Persistence.Client; using DD.Persistence.Client;
using Persistence.Client.Clients.Interfaces; using DD.Persistence.Client.Clients.Interfaces;
using Persistence.Database.Model; using DD.Persistence.Database.Model;
using System.Net; using System.Net;
using Xunit; using Xunit;
namespace Persistence.IntegrationTests.Controllers namespace DD.Persistence.IntegrationTests.Controllers
{ {
public class SetpointControllerTest : BaseIntegrationTest public class SetpointControllerTest : BaseIntegrationTest
{ {

View File

@ -1,15 +1,15 @@
using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Persistence.Client; using DD.Persistence.Client;
using Persistence.Client.Clients.Interfaces; using DD.Persistence.Client.Clients.Interfaces;
using Persistence.Database.Entity; using DD.Persistence.Database.Entity;
using Persistence.Models; using DD.Persistence.Models;
using Persistence.Models.Enumerations; using DD.Persistence.Models.Enumerations;
using Persistence.Models.Requests; using DD.Persistence.Models.Requests;
using System.Net; using System.Net;
using Xunit; using Xunit;
namespace Persistence.IntegrationTests.Controllers namespace DD.Persistence.IntegrationTests.Controllers
{ {
public class TechMessagesControllerTest : BaseIntegrationTest public class TechMessagesControllerTest : BaseIntegrationTest
{ {

View File

@ -1,12 +1,12 @@
using Mapster; using Mapster;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Persistence.Client; using DD.Persistence.Client;
using Persistence.Client.Clients.Interfaces; using DD.Persistence.Client.Clients.Interfaces;
using Persistence.Database.Model; using DD.Persistence.Database.Model;
using System.Net; using System.Net;
using Xunit; using Xunit;
namespace Persistence.IntegrationTests.Controllers; namespace DD.Persistence.IntegrationTests.Controllers;
public abstract class TimeSeriesBaseControllerTest<TEntity, TDto> : BaseIntegrationTest public abstract class TimeSeriesBaseControllerTest<TEntity, TDto> : BaseIntegrationTest
where TEntity : class, ITimestampedData, new() where TEntity : class, ITimestampedData, new()

View File

@ -1,10 +1,10 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Persistence.Client; using DD.Persistence.Client;
using Persistence.Client.Clients.Interfaces; using DD.Persistence.Client.Clients.Interfaces;
using Persistence.Models; using DD.Persistence.Models;
using Xunit; using Xunit;
namespace Persistence.IntegrationTests.Controllers; namespace DD.Persistence.IntegrationTests.Controllers;
public class TimestampedSetControllerTest : BaseIntegrationTest public class TimestampedSetControllerTest : BaseIntegrationTest
{ {
private readonly ITimestampedSetClient client; private readonly ITimestampedSetClient client;

View File

@ -1,13 +1,12 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Persistence.Client; using DD.Persistence.Database.Entity;
using Persistence.Client.Clients; using DD.Persistence.Models;
using Persistence.Client.Clients.Interfaces;
using Persistence.Database.Entity;
using Persistence.Models;
using System.Net; using System.Net;
using Xunit; 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 public class WitsDataControllerTest : BaseIntegrationTest
{ {
private IWitsDataClient witsDataClient; private IWitsDataClient witsDataClient;

View File

@ -24,9 +24,10 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Persistence.API\Persistence.API.csproj" /> <ProjectReference Include="..\DD.Persistence.App\DD.Persistence.App.csproj" />
<ProjectReference Include="..\Persistence.Client\Persistence.Client.csproj" /> <ProjectReference Include="..\DD.Persistence.Client\DD.Persistence.Client.csproj" />
<ProjectReference Include="..\Persistence.Database.Postgres\Persistence.Database.Postgres.csproj" /> <ProjectReference Include="..\DD.Persistence.Database\DD.Persistence.Database.csproj" />
<ProjectReference Include="..\DD.Persistence\DD.Persistence.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,4 +1,4 @@
namespace Persistence.IntegrationTests; namespace DD.Persistence.IntegrationTests;
public class DbConnection public class DbConnection
{ {
public string Host { get; set; } = null!; public string Host { get; set; } = null!;

Some files were not shown because too many files have changed in this diff Show More