Add project files.

This commit is contained in:
Olga Nemt 2024-10-31 15:01:12 +05:00
parent 8c8ea941cb
commit 5998d71562
12 changed files with 310 additions and 0 deletions

25
Persistence.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34714.143
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Persistence", "Persistence\Persistence.csproj", "{417177AE-A27E-445B-B3B9-D5EFCEC812A0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{417177AE-A27E-445B-B3B9-D5EFCEC812A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{417177AE-A27E-445B-B3B9-D5EFCEC812A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{417177AE-A27E-445B-B3B9-D5EFCEC812A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{417177AE-A27E-445B-B3B9-D5EFCEC812A0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B9055079-BB6F-482E-A0B7-39421CF2674E}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<Class Name="Persistence.Repositories.AbstractChangeLogRepository&lt;T, TRequest&gt;" Collapsed="true">
<Position X="7.75" Y="2.75" Width="1.5" />
<TypeIdentifier>
<HashCode>ACCAAAAAAAAABAAQAAAABAAAAAACAAAgAAAAAABAAAE=</HashCode>
<FileName>Repositories\AbstractChangeLogRepository.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="Persistence.Repositories.AbstractTimeSeriesDataRepository&lt;T&gt;" Collapsed="true">
<Position X="10.75" Y="2.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Repositories\AbstractTimeSeriesDataRepository.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="Persistence.Services.ArchiveService" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="7.75" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Services\ArchiveService.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="Persistence.Services.TimeSeriesDataObserverService" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="11" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Services\TimeSeriesDataObserverService.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Interface Name="Persistence.Repositories.IChangeLogRepository&lt;T, TRequest&gt;">
<Position X="4.75" Y="2.75" Width="1.5" />
<TypeIdentifier>
<HashCode>ACCAAAAAAAAABAAAAAAABAAAAAACAAAgAAAAAABAAAE=</HashCode>
<FileName>Repositories\IChangeLogRepository.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="Persistence.Repositories.ISyncRepository&lt;T&gt;" Collapsed="true">
<Position X="3.75" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Repositories\ISyncRepository.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="Persistence.Repositories.ITimeSeriesDataRepository&lt;T&gt;" Collapsed="true">
<Position X="2.5" Y="2.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Repositories\ITimeSeriesDataRepository.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="Persistence.Services.IArchiveService" Collapsed="true">
<Position X="2.75" Y="6" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Services\IArchiveService.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="Persistence.Services.ITimeSeriesDataObserverService" Collapsed="true">
<Position X="4.75" Y="6" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Services\ITimeSeriesDataObserverService.cs</FileName>
</TypeIdentifier>
</Interface>
<Font Name="Segoe UI" Size="9" />
</ClassDiagram>

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Persistence.Repositories;
public abstract class AbstractChangeLogRepository<T, TRequest> : IChangeLogRepository<T, TRequest>
{
public Task<int> Clear(int idUser, TRequest request, CancellationToken token)
{
throw new NotImplementedException();
}
public Task<int> ClearAndInsertRange(int idUser, TRequest request, IEnumerable<T> dtos, CancellationToken token)
{
throw new NotImplementedException();
}
public Task<IEnumerable<T>> GetCurrent(TRequest request, CancellationToken token)
{
throw new NotImplementedException();
}
public Task<IEnumerable<DateOnly>> GetDatesChange(TRequest request, CancellationToken token)
{
throw new NotImplementedException();
}
public Task<IEnumerable<T>> GetGtDate(DateTimeOffset date, CancellationToken token)
{
throw new NotImplementedException();
}
public Task<int> InsertRange(int idUser, IEnumerable<T> dtos, CancellationToken token)
{
throw new NotImplementedException();
}
public Task<int> MarkAsDeleted(int idUser, IEnumerable<int> ids, CancellationToken token)
{
throw new NotImplementedException();
}
public Task<int> UpdateOrInsertRange(int idUser, IEnumerable<T> dtos, CancellationToken token)
{
throw new NotImplementedException();
}
public Task<int> UpdateRange(int idUser, IEnumerable<T> dtos, CancellationToken token)
{
throw new NotImplementedException();
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Persistence.Repositories;
public abstract class AbstractTimeSeriesDataRepository<T> : ITimeSeriesDataRepository<T>
{
public Task<IEnumerable<T>> GetGtDate(DateTimeOffset date, CancellationToken token)
{
throw new NotImplementedException();
}
}

View File

@ -0,0 +1,95 @@
namespace Persistence.Repositories;
/// <summary>
///
/// </summary>
/// <typeparam name="T"></typeparam>
public interface IChangeLogRepository<T, TRequest> : ISyncRepository<T>
{
/// <summary>
/// Добавление записей
/// </summary>
/// <param name="idUser">пользователь, который добавляет</param>
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> InsertRange(int idUser, IEnumerable<T> dtos, CancellationToken token);
/// <summary>
/// Редактирование записей
/// </summary>
/// <param name="idUser">пользователь, который редактирует</param>
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> UpdateRange(int idUser, IEnumerable<T> dtos, CancellationToken token);
/// <summary>
/// Добавляет Dto у которых id == 0, изменяет dto у которых id != 0
/// </summary>
/// <param name="idUser">пользователь, который редактирует или добавляет</param>
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> UpdateOrInsertRange(int idUser, IEnumerable<T> dtos, CancellationToken token);
/// <summary>
/// Помечает записи как удаленные
/// </summary>
/// <param name="idUser">пользователь, который чистит</param>
/// <param name="request">Фильтр по свойствам конкретной сущности</param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> Clear(int idUser, TRequest request, CancellationToken token);
/// <summary>
/// Очистить и добавить новые
/// </summary>
/// <param name="idUser"></param>
/// <param name="request"></param>
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> ClearAndInsertRange(int idUser, TRequest request, IEnumerable<T> dtos, CancellationToken token);
/// <summary>
/// Пометить записи как удаленные
/// </summary>
/// <param name="idUser"></param>
/// <param name="ids"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> MarkAsDeleted(int idUser, IEnumerable<int> ids, CancellationToken token);
/// <summary>
/// Получение дат изменений записей
/// </summary>
/// <param name="request"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<DateOnly>> GetDatesChange(TRequest request, CancellationToken token);
/// <summary>
/// Получение измененных записей за определенную дату
/// </summary>
/// <param name="request"></param>
/// <param name="date">Фильтр по дате. Если null - вернет все записи, без привязки к дате</param>
/// <param name="token"></param>
/// <returns></returns>
//Task<IEnumerable<ChangeLogDto<T>>> GetChangeLogForDate(TRequest request, DateOnly? date, CancellationToken token);
/// <summary>
/// Получение текущих сейчас записей по параметрам
/// </summary>
/// <param name="request"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<T>> GetCurrent(TRequest request, CancellationToken token);
/// <summary>
/// Получение объекта, реализующего интерфейс IChangeLogRepositoryBuilder
/// для последующих вызовов методов фильтрации по запросам
/// </summary>
/// <returns></returns>
//IChangeLogQueryBuilder<TDto, TRequest> GetQueryBuilder(ChangeLogRequest request);
}

View File

@ -0,0 +1,16 @@
namespace Persistence.Repositories;
/// <summary>
///
/// </summary>
/// <typeparam name="T"></typeparam>
public interface ISyncRepository<T>
{
/// <summary>
///
/// </summary>
/// <param name="date"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<T>> GetGtDate(DateTimeOffset date, CancellationToken token);
}

View File

@ -0,0 +1,10 @@
namespace Persistence.Repositories;
/// <summary>
///
/// </summary>
/// <typeparam name="T"></typeparam>
public interface ITimeSeriesDataRepository<T> : ISyncRepository<T>
{
}

View File

@ -0,0 +1,4 @@
namespace Persistence.Services;
public abstract class ArchiveService : IArchiveService
{
}

View File

@ -0,0 +1,4 @@
namespace Persistence.Services;
internal interface IArchiveService
{
}

View File

@ -0,0 +1,4 @@
namespace Persistence.Services;
public interface ITimeSeriesDataObserverService
{
}

View File

@ -0,0 +1,4 @@
namespace Persistence.Services;
public abstract class TimeSeriesDataObserverService : ITimeSeriesDataObserverService
{
}