From 5998d71562696bec75da53b04a57207ff136d6c5 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Thu, 31 Oct 2024 15:01:12 +0500 Subject: [PATCH] Add project files. --- Persistence.sln | 25 +++++ Persistence/ClassDiagram.cd | 71 ++++++++++++++ Persistence/Persistence.csproj | 9 ++ .../AbstractChangeLogRepository.cs | 54 +++++++++++ .../AbstractTimeSeriesDataRepository.cs | 14 +++ .../Repositories/IChangeLogRepository.cs | 95 +++++++++++++++++++ Persistence/Repositories/ISyncRepository.cs | 16 ++++ .../Repositories/ITimeSeriesDataRepository.cs | 10 ++ Persistence/Services/ArchiveService.cs | 4 + Persistence/Services/IArchiveService.cs | 4 + .../ITimeSeriesDataObserverService.cs | 4 + .../Services/TimeSeriesDataObserverService.cs | 4 + 12 files changed, 310 insertions(+) create mode 100644 Persistence.sln create mode 100644 Persistence/ClassDiagram.cd create mode 100644 Persistence/Persistence.csproj create mode 100644 Persistence/Repositories/AbstractChangeLogRepository.cs create mode 100644 Persistence/Repositories/AbstractTimeSeriesDataRepository.cs create mode 100644 Persistence/Repositories/IChangeLogRepository.cs create mode 100644 Persistence/Repositories/ISyncRepository.cs create mode 100644 Persistence/Repositories/ITimeSeriesDataRepository.cs create mode 100644 Persistence/Services/ArchiveService.cs create mode 100644 Persistence/Services/IArchiveService.cs create mode 100644 Persistence/Services/ITimeSeriesDataObserverService.cs create mode 100644 Persistence/Services/TimeSeriesDataObserverService.cs diff --git a/Persistence.sln b/Persistence.sln new file mode 100644 index 0000000..ea65a82 --- /dev/null +++ b/Persistence.sln @@ -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 diff --git a/Persistence/ClassDiagram.cd b/Persistence/ClassDiagram.cd new file mode 100644 index 0000000..4a6aa87 --- /dev/null +++ b/Persistence/ClassDiagram.cd @@ -0,0 +1,71 @@ + + + + + + ACCAAAAAAAAABAAQAAAABAAAAAACAAAgAAAAAABAAAE= + Repositories\AbstractChangeLogRepository.cs + + + + + + + AAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Repositories\AbstractTimeSeriesDataRepository.cs + + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Services\ArchiveService.cs + + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Services\TimeSeriesDataObserverService.cs + + + + + + + ACCAAAAAAAAABAAAAAAABAAAAAACAAAgAAAAAABAAAE= + Repositories\IChangeLogRepository.cs + + + + + + AAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Repositories\ISyncRepository.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Repositories\ITimeSeriesDataRepository.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Services\IArchiveService.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Services\ITimeSeriesDataObserverService.cs + + + + \ No newline at end of file diff --git a/Persistence/Persistence.csproj b/Persistence/Persistence.csproj new file mode 100644 index 0000000..fa71b7a --- /dev/null +++ b/Persistence/Persistence.csproj @@ -0,0 +1,9 @@ + + + + net8.0 + enable + enable + + + diff --git a/Persistence/Repositories/AbstractChangeLogRepository.cs b/Persistence/Repositories/AbstractChangeLogRepository.cs new file mode 100644 index 0000000..fa68b20 --- /dev/null +++ b/Persistence/Repositories/AbstractChangeLogRepository.cs @@ -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 : IChangeLogRepository +{ + public Task Clear(int idUser, TRequest request, CancellationToken token) + { + throw new NotImplementedException(); + } + + public Task ClearAndInsertRange(int idUser, TRequest request, IEnumerable dtos, CancellationToken token) + { + throw new NotImplementedException(); + } + + public Task> GetCurrent(TRequest request, CancellationToken token) + { + throw new NotImplementedException(); + } + + public Task> GetDatesChange(TRequest request, CancellationToken token) + { + throw new NotImplementedException(); + } + + public Task> GetGtDate(DateTimeOffset date, CancellationToken token) + { + throw new NotImplementedException(); + } + + public Task InsertRange(int idUser, IEnumerable dtos, CancellationToken token) + { + throw new NotImplementedException(); + } + + public Task MarkAsDeleted(int idUser, IEnumerable ids, CancellationToken token) + { + throw new NotImplementedException(); + } + + public Task UpdateOrInsertRange(int idUser, IEnumerable dtos, CancellationToken token) + { + throw new NotImplementedException(); + } + + public Task UpdateRange(int idUser, IEnumerable dtos, CancellationToken token) + { + throw new NotImplementedException(); + } +} diff --git a/Persistence/Repositories/AbstractTimeSeriesDataRepository.cs b/Persistence/Repositories/AbstractTimeSeriesDataRepository.cs new file mode 100644 index 0000000..92a1ccf --- /dev/null +++ b/Persistence/Repositories/AbstractTimeSeriesDataRepository.cs @@ -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 : ITimeSeriesDataRepository +{ + public Task> GetGtDate(DateTimeOffset date, CancellationToken token) + { + throw new NotImplementedException(); + } +} diff --git a/Persistence/Repositories/IChangeLogRepository.cs b/Persistence/Repositories/IChangeLogRepository.cs new file mode 100644 index 0000000..dc2aade --- /dev/null +++ b/Persistence/Repositories/IChangeLogRepository.cs @@ -0,0 +1,95 @@ +namespace Persistence.Repositories; + +/// +/// +/// +/// +public interface IChangeLogRepository : ISyncRepository +{ + /// + /// Добавление записей + /// + /// пользователь, который добавляет + /// + /// + /// + Task InsertRange(int idUser, IEnumerable dtos, CancellationToken token); + + /// + /// Редактирование записей + /// + /// пользователь, который редактирует + /// + /// + /// + Task UpdateRange(int idUser, IEnumerable dtos, CancellationToken token); + + /// + /// Добавляет Dto у которых id == 0, изменяет dto у которых id != 0 + /// + /// пользователь, который редактирует или добавляет + /// + /// + /// + Task UpdateOrInsertRange(int idUser, IEnumerable dtos, CancellationToken token); + + /// + /// Помечает записи как удаленные + /// + /// пользователь, который чистит + /// Фильтр по свойствам конкретной сущности + /// + /// + Task Clear(int idUser, TRequest request, CancellationToken token); + + /// + /// Очистить и добавить новые + /// + /// + /// + /// + /// + /// + Task ClearAndInsertRange(int idUser, TRequest request, IEnumerable dtos, CancellationToken token); + + /// + /// Пометить записи как удаленные + /// + /// + /// + /// + /// + Task MarkAsDeleted(int idUser, IEnumerable ids, CancellationToken token); + + /// + /// Получение дат изменений записей + /// + /// + /// + /// + Task> GetDatesChange(TRequest request, CancellationToken token); + + /// + /// Получение измененных записей за определенную дату + /// + /// + /// Фильтр по дате. Если null - вернет все записи, без привязки к дате + /// + /// + //Task>> GetChangeLogForDate(TRequest request, DateOnly? date, CancellationToken token); + + /// + /// Получение текущих сейчас записей по параметрам + /// + /// + /// + /// + Task> GetCurrent(TRequest request, CancellationToken token); + + /// + /// Получение объекта, реализующего интерфейс IChangeLogRepositoryBuilder + /// для последующих вызовов методов фильтрации по запросам + /// + /// + //IChangeLogQueryBuilder GetQueryBuilder(ChangeLogRequest request); +} diff --git a/Persistence/Repositories/ISyncRepository.cs b/Persistence/Repositories/ISyncRepository.cs new file mode 100644 index 0000000..6e320f9 --- /dev/null +++ b/Persistence/Repositories/ISyncRepository.cs @@ -0,0 +1,16 @@ +namespace Persistence.Repositories; + +/// +/// +/// +/// +public interface ISyncRepository +{ + /// + /// + /// + /// + /// + /// + Task> GetGtDate(DateTimeOffset date, CancellationToken token); +} diff --git a/Persistence/Repositories/ITimeSeriesDataRepository.cs b/Persistence/Repositories/ITimeSeriesDataRepository.cs new file mode 100644 index 0000000..c246366 --- /dev/null +++ b/Persistence/Repositories/ITimeSeriesDataRepository.cs @@ -0,0 +1,10 @@ +namespace Persistence.Repositories; + +/// +/// +/// +/// +public interface ITimeSeriesDataRepository : ISyncRepository +{ + +} diff --git a/Persistence/Services/ArchiveService.cs b/Persistence/Services/ArchiveService.cs new file mode 100644 index 0000000..34c48c2 --- /dev/null +++ b/Persistence/Services/ArchiveService.cs @@ -0,0 +1,4 @@ +namespace Persistence.Services; +public abstract class ArchiveService : IArchiveService +{ +} diff --git a/Persistence/Services/IArchiveService.cs b/Persistence/Services/IArchiveService.cs new file mode 100644 index 0000000..83c0cd9 --- /dev/null +++ b/Persistence/Services/IArchiveService.cs @@ -0,0 +1,4 @@ +namespace Persistence.Services; +internal interface IArchiveService +{ +} diff --git a/Persistence/Services/ITimeSeriesDataObserverService.cs b/Persistence/Services/ITimeSeriesDataObserverService.cs new file mode 100644 index 0000000..0e0a2c0 --- /dev/null +++ b/Persistence/Services/ITimeSeriesDataObserverService.cs @@ -0,0 +1,4 @@ +namespace Persistence.Services; +public interface ITimeSeriesDataObserverService +{ +} diff --git a/Persistence/Services/TimeSeriesDataObserverService.cs b/Persistence/Services/TimeSeriesDataObserverService.cs new file mode 100644 index 0000000..7785928 --- /dev/null +++ b/Persistence/Services/TimeSeriesDataObserverService.cs @@ -0,0 +1,4 @@ +namespace Persistence.Services; +public abstract class TimeSeriesDataObserverService : ITimeSeriesDataObserverService +{ +}