omg
This commit is contained in:
parent
63b8e26c16
commit
c804d8ce82
7
Demo.sln
7
Demo.sln
@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.11.35312.102
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo", "Demo\Demo.csproj", "{983820F6-FF31-4B3A-8593-831BC3904E80}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo", "Demo\Demo.csproj", "{983820F6-FF31-4B3A-8593-831BC3904E80}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{21AE5A7C-0B77-4766-AC1E-94A8E52F1ED5}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@ -19,6 +21,9 @@ Global
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{983820F6-FF31-4B3A-8593-831BC3904E80} = {21AE5A7C-0B77-4766-AC1E-94A8E52F1ED5}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {4F43A963-447C-4FCB-BB78-8D315EC0F1D6}
|
||||
EndGlobalSection
|
||||
|
10
Demo/Data/Exceptions/GroupNotFoundException.cs
Normal file
10
Demo/Data/Exceptions/GroupNotFoundException.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Demo.Data.Exceptions
|
||||
{
|
||||
public class GroupNotFoundException : RepositoryException
|
||||
{
|
||||
public GroupNotFoundException(int groupId)
|
||||
: base($"Ошибка: группа с идентификатором {groupId} не найдена. Проверьте, правильный ли ID.") { }
|
||||
}
|
||||
}
|
9
Demo/Data/Exceptions/RepositoryException.cs
Normal file
9
Demo/Data/Exceptions/RepositoryException.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace Demo.Data.Exceptions
|
||||
{
|
||||
public class RepositoryException : Exception
|
||||
{
|
||||
public RepositoryException(string message) : base(message) { }
|
||||
}
|
||||
}
|
10
Demo/Data/Exceptions/UserNotFoundException.cs
Normal file
10
Demo/Data/Exceptions/UserNotFoundException.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Demo.Data.Exceptions
|
||||
{
|
||||
public class UserNotFoundException : RepositoryException
|
||||
{
|
||||
public UserNotFoundException(Guid userGuid)
|
||||
: base($"Ошибка: пользователь с GUID {userGuid} не найден. Проверьте правильность введенного идентификатора.") { }
|
||||
}
|
||||
}
|
@ -1,17 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.domain.Models
|
||||
public class PresenceLocalEntity
|
||||
{
|
||||
internal class PresenceLocalEntity
|
||||
{
|
||||
public required Guid UserGuid { get; set; }
|
||||
public bool IsAttedance { get; set; } = true;
|
||||
public required DateOnly Date { get; set; }
|
||||
|
||||
public required int LessonNumber { get; set; }
|
||||
}
|
||||
public Guid UserGuid { get; set; } // Заменить int на Guid
|
||||
public int GroupId { get; set; }
|
||||
public int LessonNumber { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
public bool IsAttedance { get; set; }
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ namespace Demo.domain.Models
|
||||
{
|
||||
public class UserLocalEnity : IEquatable<UserLocalEnity>
|
||||
{
|
||||
|
||||
public required string FIO { get; set; }
|
||||
public Guid Guid { get; set; }
|
||||
|
||||
|
@ -27,5 +27,10 @@ namespace Demo.Data.LocalData
|
||||
new UserLocalEnity{Guid=Guid.Parse("efcc1473-c116-4244-b3f7-f2341a5c3003"), FIO = "RandomFio4", GroupID = 2 },
|
||||
new UserLocalEnity{Guid=Guid.Parse("60640fb3-ace2-4cad-81d5-a0a58bc2dbbd"), FIO = "RandomFio5", GroupID = 3 },
|
||||
};
|
||||
|
||||
public static List<PresenceLocalEntity> presences => new List<PresenceLocalEntity>
|
||||
{
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
15
Demo/Data/RemoteData/RemoteDataBase/DAO/Group.cs
Normal file
15
Demo/Data/RemoteData/RemoteDataBase/DAO/Group.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.Data.RemoteData.RemoteDataBase.DAO
|
||||
{
|
||||
public class GroupDao
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public required string Name { get; set; }
|
||||
public virtual IEnumerable<UserDao> Users { get; set; }
|
||||
}
|
||||
}
|
17
Demo/Data/RemoteData/RemoteDataBase/DAO/Presence.cs
Normal file
17
Demo/Data/RemoteData/RemoteDataBase/DAO/Presence.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.Data.RemoteData.RemoteDataBase.DAO
|
||||
{
|
||||
public class PresenceDao
|
||||
{
|
||||
public Guid UserGuid { get; set; }
|
||||
public bool IsAttedance { get; set; } = true;
|
||||
public DateOnly Date { get; set; }
|
||||
public int LessonNumber { get; set; }
|
||||
public virtual UserDao UserDao { get; set; }
|
||||
}
|
||||
}
|
19
Demo/Data/RemoteData/RemoteDataBase/DAO/User.cs
Normal file
19
Demo/Data/RemoteData/RemoteDataBase/DAO/User.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.Data.RemoteData.RemoteDataBase.DAO
|
||||
{
|
||||
public class UserDao
|
||||
{
|
||||
public string FIO { get; set; }
|
||||
public Guid Guid { get; set; }
|
||||
|
||||
public int GroupID { get; set; }
|
||||
|
||||
public virtual GroupDao Group { get; set; }
|
||||
public virtual IEnumerable<PresenceDao> Presences { get; set; }
|
||||
}
|
||||
}
|
61
Demo/Data/RemoteData/RemoteDataBase/RemoteDatabaseContext.cs
Normal file
61
Demo/Data/RemoteData/RemoteDataBase/RemoteDatabaseContext.cs
Normal file
@ -0,0 +1,61 @@
|
||||
using Demo.Data.RemoteData.RemoteDataBase.DAO;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.Data.RemoteData.RemoteDataBase
|
||||
{
|
||||
public class RemoteDatabaseContext : DbContext
|
||||
{
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
optionsBuilder.UseNpgsql("Host=45.67.56.214;" +
|
||||
"Port=5421;" +
|
||||
"Username=user10;" +
|
||||
"Database=user10;" +
|
||||
"Password=FY1rOnvu");
|
||||
}
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
// Настройка ключа и генерации GroupDao
|
||||
modelBuilder.Entity<GroupDao>()
|
||||
.HasKey(group => group.Id); // Устанавливаем Id как первичный ключ
|
||||
modelBuilder.Entity<GroupDao>()
|
||||
.Property(group => group.Id)
|
||||
.ValueGeneratedOnAdd(); // Указываем, что Id будет автоматически генерироваться при добавлении
|
||||
|
||||
// Настройка ключа и генерации UserDao
|
||||
modelBuilder.Entity<UserDao>()
|
||||
.HasKey(user => user.Guid); // Устанавливаем Guid как первичный ключ
|
||||
modelBuilder.Entity<UserDao>()
|
||||
.Property(user => user.Guid)
|
||||
.ValueGeneratedOnAdd(); // Указываем, что Guid будет автоматически генерироваться при добавлении
|
||||
|
||||
// Настройка составного ключа PresenceDao
|
||||
modelBuilder.Entity<PresenceDao>()
|
||||
.HasKey(presense => new // Определяем составной ключ
|
||||
{
|
||||
presense.UserGuid,
|
||||
presense.Date,
|
||||
presense.IsAttedance,
|
||||
presense.LessonNumber
|
||||
});
|
||||
|
||||
// Настройка связи между UserDao и PresenceDao
|
||||
modelBuilder.Entity<PresenceDao>()
|
||||
.HasOne(p => p.UserDao) // Указываем, что PresenceDao имеет одну связь с UserDao
|
||||
.WithMany() // Указываем, что у UserDao может быть много записей PresenceDao
|
||||
.HasForeignKey(p => p.UserGuid) // Указываем внешний ключ UserGuid
|
||||
.OnDelete(DeleteBehavior.Cascade); // Указываем поведение при удалении (удаление связанных записей)
|
||||
}
|
||||
|
||||
// Определение наборов данных для каждой сущности
|
||||
public DbSet<GroupDao> Groups { get; set; } // Набор данных для GroupDao
|
||||
public DbSet<UserDao> Users { get; set; } // Набор данных для UserDao
|
||||
public DbSet<PresenceDao> PresenceDaos { get; set; } // Набор данных для PresenceDao
|
||||
}
|
||||
}
|
@ -1,15 +1,60 @@
|
||||
using Demo.Data.LocalData;
|
||||
using Demo.Data.Exceptions;
|
||||
using Demo.Data.LocalData;
|
||||
using Demo.Data.RemoteData.RemoteDataBase.DAO;
|
||||
using Demo.Data.Repository;
|
||||
using Demo.domain.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.Data.Repository
|
||||
public class GroupRepositoryImpl : IGroupRepository
|
||||
{
|
||||
public class GroupRepositoryImpl
|
||||
private List<GroupLocalEntity> _groups = LocalStaticData.groups;
|
||||
|
||||
// Метод получения группы по id
|
||||
public GroupLocalEntity? GetGroupById(int groupId)
|
||||
{
|
||||
public List<GroupLocalEntity> GetAllGroups() => LocalStaticData.groups;
|
||||
// Ищем первую группу с заданным идентификатором
|
||||
return _groups.FirstOrDefault(g => g.Id == groupId);
|
||||
}
|
||||
|
||||
// Метод получения всех групп
|
||||
public List<GroupLocalEntity> GetAllGroup() => _groups; // Возвращаем весь список групп
|
||||
|
||||
// Метод добавления группы
|
||||
public bool AddGroup(GroupLocalEntity group)
|
||||
{
|
||||
// Проверяем, существует ли группа с таким же id
|
||||
if (_groups.Any(g => g.Id == group.Id))
|
||||
return false; // Если существует, возвращаем false
|
||||
|
||||
// Устанавливаем новый Id для группы (максимальный Id + 1 или 1, если список пуст)
|
||||
group.Id = _groups.Any() ? _groups.Max(g => g.Id) + 1 : 1;
|
||||
_groups.Add(group); // Добавляем группу в список
|
||||
return true; // Возвращаем true, если добавление прошло успешно
|
||||
}
|
||||
|
||||
// Метод обновления существующей группы по id
|
||||
public bool UpdateGroupById(int groupID, GroupLocalEntity updatedGroup)
|
||||
{
|
||||
// Получаем существующую группу по id
|
||||
var existingGroup = GetGroupById(groupID);
|
||||
if (existingGroup == null)
|
||||
return false; // Если группа не найдена, возвращаем false
|
||||
|
||||
// Обновляем имя существующей группы
|
||||
existingGroup.Name = updatedGroup.Name;
|
||||
return true; // Возвращаем true, если обновление прошло успешно
|
||||
}
|
||||
|
||||
// Метод удаления группы по id
|
||||
public bool RemoveGroupById(int groupID)
|
||||
{
|
||||
// Вывод существующей группу по id
|
||||
var existingGroup = GetGroupById(groupID);
|
||||
if (existingGroup == null)
|
||||
return false; // Если группа не найдена, возвращаем false
|
||||
|
||||
_groups.Remove(existingGroup); // Удаляем группу
|
||||
return true; // Возвращаем true, если удаление прошло успешно
|
||||
}
|
||||
}
|
||||
|
19
Demo/Data/Repository/IGroupRepository.cs
Normal file
19
Demo/Data/Repository/IGroupRepository.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using Demo.Data.RemoteData.RemoteDataBase.DAO;
|
||||
using Demo.domain.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.Data.Repository
|
||||
{
|
||||
public interface IGroupRepository
|
||||
{
|
||||
List<GroupLocalEntity> GetAllGroup();
|
||||
bool RemoveGroupById(int groupID);
|
||||
bool UpdateGroupById(int groupID, GroupLocalEntity updatedGroup);
|
||||
GroupLocalEntity GetGroupById(int groupID);
|
||||
bool AddGroup(GroupLocalEntity newGroup);
|
||||
}
|
||||
}
|
24
Demo/Data/Repository/IPresenceRepository.cs
Normal file
24
Demo/Data/Repository/IPresenceRepository.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using Demo.Data.RemoteData.RemoteDataBase.DAO;
|
||||
using Demo.domain.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Demo.Data.Repository
|
||||
{
|
||||
public interface IPresenceRepository
|
||||
{
|
||||
public interface IPresenceRepository
|
||||
{
|
||||
void SavePresence(List<PresenceLocalEntity> presences);
|
||||
List<PresenceLocalEntity> GetPresenceByGroup(int groupId);
|
||||
List<PresenceLocalEntity> GetPresenceByGroupAndDate(int groupId, DateTime date);
|
||||
DateOnly? GetLastDateByGroupId(int groupId);
|
||||
public GroupPresenceSummary GetGeneralPresenceForGroup(int groupId);
|
||||
bool UpdateAttention(Guid UserGuid, int groupId, int firstLesson, int lastLesson, DateOnly date, bool isAttendance);
|
||||
|
||||
void MarkUserAsAbsent(Guid userGuid, int firstLessonNumber, int lastLessonNumber);
|
||||
void AddPresence(PresenceLocalEntity presence);
|
||||
List<PresenceDao> GetAttendanceByGroup(int groupId);
|
||||
}
|
||||
}
|
||||
}
|
16
Demo/Data/Repository/IUserRepository.cs
Normal file
16
Demo/Data/Repository/IUserRepository.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using Demo.Data.RemoteData.RemoteDataBase.DAO;
|
||||
using Demo.domain.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Demo.Data.Repository
|
||||
{
|
||||
public interface IUserRepository
|
||||
{
|
||||
IEnumerable<UserLocalEnity> GetAllUsers { get; }
|
||||
bool RemoveUserByGuid(Guid userGuid);
|
||||
bool RemoveUserById(int userId); // Новый метод для удаления пользователя по ID
|
||||
UserLocalEnity? UpdateUser(UserLocalEnity user);
|
||||
List<UserDao> GetUserNames();
|
||||
}
|
||||
}
|
79
Demo/Data/Repository/PresenceRepositoryImpl.cs
Normal file
79
Demo/Data/Repository/PresenceRepositoryImpl.cs
Normal file
@ -0,0 +1,79 @@
|
||||
using Demo.Data.RemoteData.RemoteDataBase.DAO;
|
||||
using Demo.domain.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Demo.Data.Repository
|
||||
{
|
||||
public class PresenceRepositoryImpl : IPresenceRepository
|
||||
{
|
||||
private readonly List<PresenceLocalEntity> _presences = new List<PresenceLocalEntity>();
|
||||
|
||||
// Метод сохранения информации о присутствии
|
||||
public void SavePresence(List<PresenceLocalEntity> presences)
|
||||
{
|
||||
foreach (var presence in presences)
|
||||
{
|
||||
// Ищем существующую запись о присутствии по дате, пользователю и номеру урока
|
||||
var existing = _presences.FirstOrDefault(p =>
|
||||
p.Date == presence.Date &&
|
||||
p.UserGuid == presence.UserGuid &&
|
||||
p.LessonNumber == presence.LessonNumber);
|
||||
|
||||
// Если запись не найдена, добавляем новую
|
||||
if (existing == null)
|
||||
{
|
||||
_presences.Add(presence);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Если запись найдена, обновляем статус присутствия
|
||||
existing.IsAttedance = presence.IsAttedance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Метод добавления новой записи о присутствии
|
||||
public void AddPresence(PresenceLocalEntity presence)
|
||||
{
|
||||
// Проверяем, что объект не равен null
|
||||
if (presence == null) throw new ArgumentNullException(nameof(presence));
|
||||
|
||||
// Добавляем новую запись
|
||||
_presences.Add(presence);
|
||||
}
|
||||
|
||||
// Метод получения записей о присутствии по id группы
|
||||
public List<PresenceLocalEntity> GetPresenceByGroup(int groupId)
|
||||
{
|
||||
// Фильтруем записи по id группы и возвращаем их в виде списка
|
||||
return _presences.Where(p => p.GroupId == groupId).ToList();
|
||||
}
|
||||
|
||||
// Метод получения записей о присутствии по id группы и дате
|
||||
public List<PresenceLocalEntity> GetPresenceByGroupAndDate(int groupId, DateTime date)
|
||||
{
|
||||
// Фильтруем записи по id группы и дате, возвращая их в список
|
||||
return _presences.Where(p => p.GroupId == groupId && p.Date.Date == date.Date).ToList();
|
||||
}
|
||||
|
||||
// Метод для пометки пользователя как отсутствующего
|
||||
public void MarkUserAsAbsent(Guid userGuid, int firstLessonNumber, int lastLessonNumber)
|
||||
{
|
||||
// Проходим по всем урокам
|
||||
foreach (var lesson in Enumerable.Range(firstLessonNumber, lastLessonNumber - firstLessonNumber + 1))
|
||||
{
|
||||
// Ищем запись о присутствии пользователя на текущем уроке
|
||||
var presence = _presences.FirstOrDefault(p => p.UserGuid == userGuid && p.LessonNumber == lesson);
|
||||
|
||||
// Если запись не найдена, помечаем ее как отсутствующую
|
||||
if (presence != null)
|
||||
{
|
||||
// Помечаем отсутствующего
|
||||
presence.IsAttedance = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
87
Demo/Data/Repository/SQLGroupRepositoryImpl.cs
Normal file
87
Demo/Data/Repository/SQLGroupRepositoryImpl.cs
Normal file
@ -0,0 +1,87 @@
|
||||
using Demo.Data.Exceptions;
|
||||
using Demo.Data.LocalData;
|
||||
using Demo.Data.RemoteData.RemoteDataBase;
|
||||
using Demo.Data.RemoteData.RemoteDataBase.DAO;
|
||||
using Demo.Data.Repository;
|
||||
using Demo.domain.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public class SQLGroupRepositoryImpl : IGroupRepository
|
||||
{
|
||||
private readonly RemoteDatabaseContext _remoteDatabaseContext;
|
||||
|
||||
public SQLGroupRepositoryImpl(RemoteDatabaseContext remoteDatabaseContext)
|
||||
{
|
||||
_remoteDatabaseContext = remoteDatabaseContext;
|
||||
}
|
||||
|
||||
// Метод получения группы по id
|
||||
public GroupLocalEntity? GetGroupById(int groupId)
|
||||
{
|
||||
// Ищем группу в бд по id
|
||||
var groupDao = _remoteDatabaseContext.Groups.FirstOrDefault(g => g.Id == groupId);
|
||||
|
||||
// Если группа найдена, создаем и возвращаем объект GroupLocalEntity
|
||||
return groupDao != null ? new GroupLocalEntity { Id = groupDao.Id, Name = groupDao.Name } : null;
|
||||
}
|
||||
|
||||
// Метод получения всех групп
|
||||
public List<GroupLocalEntity> GetAllGroup()
|
||||
{
|
||||
// Получаем все группы из бд и преобразуем их в список объектов GroupLocalEntity
|
||||
return _remoteDatabaseContext.Groups.Select(group => new GroupLocalEntity
|
||||
{
|
||||
Id = group.Id,
|
||||
Name = group.Name
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
// Метод добавления новой группы
|
||||
public bool AddGroup(GroupLocalEntity group)
|
||||
{
|
||||
// Проверяем, существует ли уже группа с таким id
|
||||
if (_remoteDatabaseContext.Groups.Any(g => g.Id == group.Id))
|
||||
return false; // Если существует, возвращаем false
|
||||
|
||||
// Создаем объект GroupDao и добавляем его в бд
|
||||
var groupDao = new GroupDao { Id = group.Id, Name = group.Name };
|
||||
_remoteDatabaseContext.Groups.Add(groupDao);
|
||||
|
||||
// Сохраняем изменения в бд
|
||||
_remoteDatabaseContext.SaveChanges();
|
||||
return true; // Возвращаем true, если группа добавлена
|
||||
}
|
||||
|
||||
// Метод обновления существующей группы
|
||||
public bool UpdateGroupById(int groupID, GroupLocalEntity updatedGroup)
|
||||
{
|
||||
// Ищем группу по ее id
|
||||
var existingGroup = _remoteDatabaseContext.Groups.FirstOrDefault(g => g.Id == groupID);
|
||||
|
||||
// Если группа не найдена, возвращаем false
|
||||
if (existingGroup == null)
|
||||
return false;
|
||||
|
||||
// Обновляем имя группы и сохраняем изменения
|
||||
existingGroup.Name = updatedGroup.Name;
|
||||
_remoteDatabaseContext.SaveChanges();
|
||||
return true; // Возвращаем true, если группа обновлена
|
||||
}
|
||||
|
||||
// Метод удаления группы по id
|
||||
public bool RemoveGroupById(int groupID)
|
||||
{
|
||||
// Ищем группу по заданному id
|
||||
var existingGroup = _remoteDatabaseContext.Groups.FirstOrDefault(g => g.Id == groupID);
|
||||
|
||||
// Группа не найдена, возвращаем false
|
||||
if (existingGroup == null)
|
||||
return false;
|
||||
|
||||
// Удаляем группу из бд
|
||||
_remoteDatabaseContext.Groups.Remove(existingGroup);
|
||||
_remoteDatabaseContext.SaveChanges();
|
||||
return true; // Возвращаем true, если группа удалена
|
||||
}
|
||||
}
|
107
Demo/Data/Repository/SQLPresenceRepositoryImpl.cs
Normal file
107
Demo/Data/Repository/SQLPresenceRepositoryImpl.cs
Normal file
@ -0,0 +1,107 @@
|
||||
using Demo.Data.RemoteData.RemoteDataBase;
|
||||
using Demo.Data.RemoteData.RemoteDataBase.DAO;
|
||||
using Demo.domain.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Demo.Data.Repository
|
||||
{
|
||||
public class SQLPresenceRepositoryImpl : IPresenceRepository
|
||||
{
|
||||
private readonly RemoteDatabaseContext _remoteDatabaseContext;
|
||||
|
||||
public SQLPresenceRepositoryImpl(RemoteDatabaseContext remoteDatabaseContext)
|
||||
{
|
||||
_remoteDatabaseContext = remoteDatabaseContext;
|
||||
}
|
||||
public void SavePresence(List<PresenceLocalEntity> presences)
|
||||
{
|
||||
_remoteDatabaseContext.PresenceDaos.AddRange(presences.Select(it => new PresenceDao
|
||||
{
|
||||
Date = DateOnly.FromDateTime(it.Date), // преобразуем в DateOnly
|
||||
IsAttedance = it.IsAttedance, // статус посещаемости
|
||||
LessonNumber = it.LessonNumber, // номер урока
|
||||
UserGuid = it.UserGuid // уникальный id пользователя
|
||||
}));
|
||||
|
||||
// Сохраняем изменения в бд
|
||||
_remoteDatabaseContext.SaveChanges();
|
||||
}
|
||||
|
||||
// Метод добавления присутствия в бд
|
||||
public void AddPresence(PresenceLocalEntity presence)
|
||||
{
|
||||
// Проверяем, что переданный объект не равен null
|
||||
if (presence == null) throw new ArgumentNullException(nameof(presence));
|
||||
|
||||
// Создаем новый объект PresenceDao и заполняем его данными
|
||||
var newPresence = new PresenceDao
|
||||
{
|
||||
Date = DateOnly.FromDateTime(presence.Date), // преобразуем в DateOnly
|
||||
UserGuid = presence.UserGuid, // уникальный id пользователя
|
||||
LessonNumber = presence.LessonNumber, // номер урока
|
||||
IsAttedance = presence.IsAttedance // статус посещаемости
|
||||
};
|
||||
|
||||
// Добавляем новое присутствие
|
||||
_remoteDatabaseContext.PresenceDaos.Add(newPresence);
|
||||
|
||||
// Сохраняем изменения в бд
|
||||
_remoteDatabaseContext.SaveChanges();
|
||||
}
|
||||
|
||||
// Метод получения списка присутствий по id группы
|
||||
public List<PresenceLocalEntity> GetPresenceByGroup(int groupId)
|
||||
{
|
||||
return _remoteDatabaseContext.PresenceDaos
|
||||
.Where(p => p.UserDao != null && p.UserDao.GroupID == groupId) // Проверка на null
|
||||
.Select(p => new PresenceLocalEntity
|
||||
{
|
||||
Date = p.Date.ToDateTime(TimeOnly.MinValue), //преобразуем обратно в DateTime
|
||||
UserGuid = p.UserGuid, // уникальный id пользователя
|
||||
LessonNumber = p.LessonNumber, // номер урока
|
||||
IsAttedance = p.IsAttedance // статус посещаемости
|
||||
})
|
||||
.ToList(); // Преобразуем результат в список
|
||||
}
|
||||
|
||||
// Метод получения присутствий по id группы и дате
|
||||
public List<PresenceLocalEntity> GetPresenceByGroupAndDate(int groupId, DateTime date)
|
||||
{
|
||||
return _remoteDatabaseContext.PresenceDaos
|
||||
.Where(p => p.UserDao != null && p.UserDao.GroupID == groupId && p.Date == DateOnly.FromDateTime(date))
|
||||
.Select(p => new PresenceLocalEntity
|
||||
{
|
||||
Date = p.Date.ToDateTime(TimeOnly.MinValue), // преобразуем в DateTime
|
||||
UserGuid = p.UserGuid, // уникальный id пользователя
|
||||
LessonNumber = p.LessonNumber, // номер урока
|
||||
IsAttedance = p.IsAttedance // статус посещаемости
|
||||
})
|
||||
.ToList(); // Преобразуем результат в список
|
||||
}
|
||||
|
||||
// Метод пометки пользователя как отсутствующего
|
||||
public void MarkUserAsAbsent(Guid userGuid, int groupId, int firstLessonNumber, int lastLessonNumber)
|
||||
{
|
||||
// Проходим по всем номерам уроков
|
||||
foreach (var lesson in Enumerable.Range(firstLessonNumber, lastLessonNumber - firstLessonNumber + 1))
|
||||
{
|
||||
// Ищем присутствие пользователя по его id и номеру урока
|
||||
var presence = _remoteDatabaseContext.PresenceDaos.FirstOrDefault(p =>
|
||||
p.UserGuid == userGuid &&
|
||||
p.UserDao != null && p.UserDao.GroupID == groupId && // Проверка на null
|
||||
p.LessonNumber == lesson);
|
||||
|
||||
// Если присутствие не найдено, помечаем его как отсутствующее
|
||||
if (presence != null)
|
||||
{
|
||||
presence.IsAttedance = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Сохраняем изменения в базе данных после обновления статуса присутствия
|
||||
_remoteDatabaseContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
}
|
85
Demo/Data/Repository/SQLUserRepositoryImpl.cs
Normal file
85
Demo/Data/Repository/SQLUserRepositoryImpl.cs
Normal file
@ -0,0 +1,85 @@
|
||||
using Demo.Data.Exceptions;
|
||||
using Demo.Data.RemoteData.RemoteDataBase;
|
||||
using Demo.Data.RemoteData.RemoteDataBase.DAO;
|
||||
using Demo.domain.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Demo.Data.Repository
|
||||
{
|
||||
public class SQLUserRepositoryImpl : IUserRepository
|
||||
{
|
||||
private readonly RemoteDatabaseContext _remoteDatabaseContext;
|
||||
public SQLUserRepositoryImpl(RemoteDatabaseContext remoteDatabaseContext)
|
||||
{
|
||||
_remoteDatabaseContext = remoteDatabaseContext;
|
||||
}
|
||||
|
||||
// Свойство для получения всех пользователей в виде списка
|
||||
public IEnumerable<UserLocalEnity> GetAllUsers => _remoteDatabaseContext.Users
|
||||
.Select(u => new UserLocalEnity
|
||||
{
|
||||
Guid = u.Guid,
|
||||
FIO = u.FIO,
|
||||
GroupID = u.GroupID
|
||||
})
|
||||
.ToList(); // Преобразуем результат в список
|
||||
|
||||
// Метод удаления пользователя по id
|
||||
public bool RemoveUserByGuid(Guid userGuid)
|
||||
{
|
||||
// Ищем пользователя в бд по его id
|
||||
var user = _remoteDatabaseContext.Users.FirstOrDefault(u => u.Guid == userGuid);
|
||||
|
||||
// Если пользователь не найден
|
||||
if (user == null) throw new UserNotFoundException(userGuid);
|
||||
|
||||
// Удаляем пользователя
|
||||
_remoteDatabaseContext.Users.Remove(user);
|
||||
|
||||
// Сохраняем изменения в бд
|
||||
_remoteDatabaseContext.SaveChanges();
|
||||
|
||||
return true; // если удаление прошло, возвращаем true
|
||||
}
|
||||
|
||||
// Метод обновления информации о пользователе
|
||||
public UserLocalEnity? UpdateUser(UserLocalEnity user)
|
||||
{
|
||||
// Ищем пользователя по id
|
||||
var existingUser = _remoteDatabaseContext.Users.FirstOrDefault(u => u.Guid == user.Guid);
|
||||
|
||||
// Если пользователь не найден
|
||||
if (existingUser == null) throw new UserNotFoundException(user.Guid);
|
||||
|
||||
// Обновляем информацию о пользователе
|
||||
existingUser.FIO = user.FIO; // Обновляем ФИО
|
||||
existingUser.GroupID = user.GroupID; // Обновляем id группы
|
||||
|
||||
// Сохраняем изменения в бд
|
||||
_remoteDatabaseContext.SaveChanges();
|
||||
|
||||
// Возвращаем обновленный объект UserLocalEnity
|
||||
return new UserLocalEnity
|
||||
{
|
||||
Guid = existingUser.Guid,
|
||||
FIO = existingUser.FIO,
|
||||
GroupID = existingUser.GroupID
|
||||
};
|
||||
}
|
||||
|
||||
// Метод получения всех пользователей в виде DAO
|
||||
public IEnumerable<RemoteData.RemoteDataBase.DAO.UserDao> GetAllUsersDao =>
|
||||
_remoteDatabaseContext.Users.ToList(); // Возвращаем список пользователей
|
||||
|
||||
// Метод получения списка пользователей с их ФИО и id
|
||||
public List<UserDao> GetUserNames()
|
||||
{
|
||||
// Запрос пользователей и создание списка объектов UserDao с их GUID и ФИО
|
||||
return _remoteDatabaseContext.Users
|
||||
.Select(u => new UserDao { Guid = u.Guid, FIO = u.FIO })
|
||||
.ToList(); // Преобразуем результат в список
|
||||
}
|
||||
}
|
||||
}
|
@ -1,47 +1,66 @@
|
||||
using Demo.Data.LocalData;
|
||||
using Demo.Data.Exceptions;
|
||||
using Demo.Data.LocalData;
|
||||
using Demo.Data.RemoteData.RemoteDataBase.DAO;
|
||||
using Demo.domain.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.Data.Repository
|
||||
{
|
||||
public class UserRepositoryImpl
|
||||
public class UserRepositoryImpl : IUserRepository
|
||||
{
|
||||
public UserRepositoryImpl() {
|
||||
private List<UserLocalEnity> _users;
|
||||
|
||||
GetAllUsers = LocalStaticData.users;
|
||||
public UserRepositoryImpl()
|
||||
{
|
||||
_users = LocalStaticData.users;
|
||||
}
|
||||
public List<UserLocalEnity> GetAllUsers
|
||||
{ get; set; }
|
||||
public IEnumerable<UserLocalEnity> GetAllUsers => _users;
|
||||
|
||||
// Метод удаления пользователя по Guid
|
||||
public bool RemoveUserByGuid(Guid userGuid)
|
||||
{
|
||||
UserLocalEnity? userLocal = GetAllUsers
|
||||
.Where(x => x.Guid == userGuid).FirstOrDefault();
|
||||
if (userLocal == null) return false;
|
||||
// Ищем пользователя в списке по его Guid
|
||||
var user = _users.FirstOrDefault(u => u.Guid == userGuid);
|
||||
|
||||
return GetAllUsers.Remove(userLocal);
|
||||
// Если пользователь не найден
|
||||
if (user == null) throw new UserNotFoundException(userGuid);
|
||||
|
||||
// Удаляем пользователя
|
||||
_users.Remove(user);
|
||||
|
||||
return true; // Если удаление прошло, возврашаем true
|
||||
}
|
||||
|
||||
public UserLocalEnity? GetUserByGuid(Guid userGuid) {
|
||||
UserLocalEnity? userLocal = GetAllUsers
|
||||
.Where(x => x.Guid == userGuid).FirstOrDefault();
|
||||
if (userLocal == null) return null;
|
||||
// Метод обновления информации о пользователе
|
||||
public UserLocalEnity? UpdateUser(UserLocalEnity user)
|
||||
{
|
||||
// Ищем пользователя по его Guid
|
||||
var existingUser = _users.FirstOrDefault(u => u.Guid == user.Guid);
|
||||
|
||||
return userLocal;
|
||||
// Если пользователь не найден
|
||||
if (existingUser == null) throw new UserNotFoundException(user.Guid);
|
||||
|
||||
// Обновляем информацию о пользователе
|
||||
existingUser.FIO = user.FIO;
|
||||
existingUser.GroupID = user.GroupID;
|
||||
|
||||
// Возвращаем обновленный объект UserLocalEnity
|
||||
return existingUser;
|
||||
}
|
||||
|
||||
public UserLocalEnity? UpdateUser(UserLocalEnity userUpdateLocalEnity) {
|
||||
UserLocalEnity? userLocal = GetAllUsers
|
||||
.Where(x => x.Guid == userUpdateLocalEnity.Guid).FirstOrDefault();
|
||||
if (userLocal == null) return null;
|
||||
userLocal.FIO = userUpdateLocalEnity.FIO;
|
||||
userLocal.GroupID = userUpdateLocalEnity.GroupID;
|
||||
return userLocal;
|
||||
|
||||
// Метод получения списка пользователей с их ФИО и Guid
|
||||
public List<UserDao> GetUserNames()
|
||||
{
|
||||
// Запрашиваем пользователей и создаем список объектов UserDao с их GUID и ФИО
|
||||
return _users
|
||||
.Select(u => new UserDao
|
||||
{
|
||||
Guid = u.Guid, // Уникальный идентификатор пользователя
|
||||
FIO = u.FIO // ФИО пользователя
|
||||
})
|
||||
.ToList(); // Преобразуем результат в список
|
||||
}
|
||||
}
|
||||
}
|
@ -8,7 +8,19 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Data\RemoteData\" />
|
||||
<PackageReference Include="ClosedXML" Version="0.104.2" />
|
||||
<PackageReference Include="DocumentFormat.OpenXml" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.10">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.10" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Data\RemoteData\RemoteApi\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -10,8 +10,9 @@ namespace Demo.domain.Models
|
||||
{
|
||||
|
||||
public required User User { get; set; }
|
||||
public required int GroupId { get; set; }
|
||||
public bool IsAttedance { get; set; } = true;
|
||||
public required DateOnly Date { get; set; }
|
||||
public required DateTime Date { get; set; }
|
||||
|
||||
public required int LessonNumber { get; set; }
|
||||
}
|
||||
|
5
Demo/Domain/Models/ResponseModels/GroupResponse.cs
Normal file
5
Demo/Domain/Models/ResponseModels/GroupResponse.cs
Normal file
@ -0,0 +1,5 @@
|
||||
public class GroupResponse
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
@ -10,7 +10,6 @@ namespace Demo.domain.Models
|
||||
{
|
||||
public required string FIO { get; set; }
|
||||
public Guid Guid { get; set; }
|
||||
|
||||
public required Group Group { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,51 +1,127 @@
|
||||
using Demo.Data.LocalData;
|
||||
using Demo.Data.Repository;
|
||||
using Demo.domain.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.Domain.UseCase
|
||||
{
|
||||
// Класс, представляющий бизнес-логику для работы с группами
|
||||
public class GroupUseCase
|
||||
{
|
||||
private List<GroupLocalEntity> _groups = LocalStaticData.groups;
|
||||
// Репозиторий для работы с группами (интерфейс)
|
||||
private readonly IGroupRepository _repositoryGroupImpl;
|
||||
|
||||
public List<GroupLocalEntity> GetAllGroups() => _groups;
|
||||
|
||||
public void AddGroup(GroupLocalEntity group)
|
||||
// Конструктор, принимающий репозиторий в качестве зависимости
|
||||
public GroupUseCase(IGroupRepository repositoryGroupImpl)
|
||||
{
|
||||
group.Id = _groups.Any() ? _groups.Max(g => g.Id) + 1 : 1;
|
||||
_groups.Add(group);
|
||||
_repositoryGroupImpl = repositoryGroupImpl;
|
||||
}
|
||||
|
||||
public void UpdateGroup(GroupLocalEntity group)
|
||||
// Метод для проверки существования группы по ее ID
|
||||
private GroupLocalEntity ValidateGroupExistence(int groupId)
|
||||
{
|
||||
var existingGroup = _groups.FirstOrDefault(g => g.Id == group.Id);
|
||||
if (existingGroup != null)
|
||||
{
|
||||
existingGroup.Name = group.Name;
|
||||
}
|
||||
}
|
||||
public void RenameGroup(int groupId, string newName)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(newName))
|
||||
{
|
||||
throw new ArgumentException("Новое имя группы не может быть пустым", nameof(newName));
|
||||
}
|
||||
// Получение группы по ID
|
||||
var existingGroup = _repositoryGroupImpl.GetAllGroup()
|
||||
.FirstOrDefault(g => g.Id == groupId);
|
||||
|
||||
var existingGroup = _groups.FirstOrDefault(g => g.Id == groupId);
|
||||
// Если группа не найдена
|
||||
if (existingGroup == null)
|
||||
{
|
||||
throw new KeyNotFoundException($"Группа с ID {groupId} не найдена.");
|
||||
}
|
||||
existingGroup.Name = newName;
|
||||
throw new ArgumentException("Группа не найдена.");
|
||||
}
|
||||
|
||||
// Возвращение существующей группы
|
||||
return new GroupLocalEntity
|
||||
{
|
||||
Id = existingGroup.Id,
|
||||
Name = existingGroup.Name
|
||||
};
|
||||
}
|
||||
|
||||
// Метод получения всех групп
|
||||
public List<Group> GetAllGroups()
|
||||
{
|
||||
// Получение всех групп и преобразование их в список объектов Group
|
||||
return _repositoryGroupImpl.GetAllGroup()
|
||||
.Select(it => new Group { Id = it.Id, Name = it.Name })
|
||||
.ToList();
|
||||
}
|
||||
|
||||
// Метод для поиска группы по ID
|
||||
public Group FindGroupById(int groupId)
|
||||
{
|
||||
// Ищем группу в списке всех групп
|
||||
var group = GetAllGroups().FirstOrDefault(g => g.Id == groupId);
|
||||
|
||||
// Если группа не найдена
|
||||
if (group == null)
|
||||
{
|
||||
throw new ArgumentException("Группа не найдена.");
|
||||
}
|
||||
|
||||
return group; // Возвращение найденной группы
|
||||
}
|
||||
|
||||
// Метод добавления новой группы
|
||||
public void AddGroup(string groupName)
|
||||
{
|
||||
// Определяем новый ID для группы
|
||||
var newId = _repositoryGroupImpl.GetAllGroup().Any()
|
||||
? _repositoryGroupImpl.GetAllGroup().Max(g => g.Id) + 1
|
||||
: 1;
|
||||
|
||||
// Создаем новую группу
|
||||
GroupLocalEntity newGroup = new GroupLocalEntity
|
||||
{
|
||||
Id = newId,
|
||||
Name = groupName
|
||||
};
|
||||
|
||||
// Добавление группы в репозиторий
|
||||
_repositoryGroupImpl.AddGroup(newGroup);
|
||||
}
|
||||
|
||||
// Метод удаления группы по ID
|
||||
public void RemoveGroupById(int groupId)
|
||||
{
|
||||
// Проверяем существование группы
|
||||
var existingGroup = ValidateGroupExistence(groupId);
|
||||
|
||||
// Получаем все группы для удаления
|
||||
List<Group> _groups = GetAllGroups();
|
||||
|
||||
// Находим группу по ID и удаляем ее из репозитория
|
||||
var groupToRemove = _groups.FirstOrDefault(g => g.Id == existingGroup.Id);
|
||||
if (groupToRemove != null)
|
||||
{
|
||||
_groups.Remove(groupToRemove); // Удаляем группу из списка (если нужно)
|
||||
_repositoryGroupImpl.RemoveGroupById(existingGroup.Id); // Удаляем из репозитория
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Группа не найдена."); // Если есть ошибки
|
||||
}
|
||||
}
|
||||
|
||||
// Метод изменения названия группы
|
||||
public bool UpdateGroup(int groupId, string newGroupName)
|
||||
{
|
||||
// Проверяем существование группы по ID
|
||||
var existingGroup = _repositoryGroupImpl.GetAllGroup()
|
||||
.FirstOrDefault(g => g.Id == groupId);
|
||||
|
||||
// Если группа не найдена, возвращаем false
|
||||
if (existingGroup == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Обновляем название группы
|
||||
existingGroup.Name = newGroupName;
|
||||
|
||||
// Сохраняем изменения в репозитории
|
||||
_repositoryGroupImpl.UpdateGroupById(existingGroup.Id, existingGroup);
|
||||
|
||||
return true; // Успешное обновление
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
172
Demo/Domain/UseCase/UseCaseGeneratePresence.cs
Normal file
172
Demo/Domain/UseCase/UseCaseGeneratePresence.cs
Normal file
@ -0,0 +1,172 @@
|
||||
using Demo.Data.Repository;
|
||||
using Demo.domain.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.Domain.UseCase
|
||||
{
|
||||
public class UseCaseGeneratePresence
|
||||
{
|
||||
public readonly IUserRepository _userRepository;
|
||||
public readonly IPresenceRepository _presenceRepository;
|
||||
private readonly IGroupRepository _groupRepository;
|
||||
|
||||
public UseCaseGeneratePresence(IUserRepository userRepository, IPresenceRepository presenceRepository, IGroupRepository groupRepository)
|
||||
{
|
||||
_userRepository = userRepository;
|
||||
_presenceRepository = presenceRepository;
|
||||
_groupRepository = groupRepository;
|
||||
}
|
||||
|
||||
public List<PresenceLocalEntity> GetPresenceByGroupAndDate(int groupId, DateTime date)
|
||||
{
|
||||
return _presenceRepository.GetPresenceByGroupAndDate(groupId, date);
|
||||
}
|
||||
|
||||
|
||||
public void GeneratePresenceForDay(int firstLesson, int lastLesson, int groupId, DateTime currentDate)
|
||||
{
|
||||
// Проверка существования группы
|
||||
var groupExists = _groupRepository.GetAllGroup().Any(g => g.Id == groupId);
|
||||
if (!groupExists)
|
||||
{
|
||||
throw new ArgumentException($"Группа с ID {groupId} не существует.");
|
||||
}
|
||||
|
||||
var users = _userRepository.GetAllUsers.Where(u => u.GroupID == groupId).ToList();
|
||||
List<PresenceLocalEntity> presences = new List<PresenceLocalEntity>();
|
||||
for (int lessonNumber = firstLesson; lessonNumber <= lastLesson; lessonNumber++)
|
||||
{
|
||||
foreach (var user in users)
|
||||
{
|
||||
presences.Add(new PresenceLocalEntity
|
||||
{
|
||||
UserGuid = user.Guid,
|
||||
Date = currentDate,
|
||||
LessonNumber = lessonNumber,
|
||||
IsAttedance = true
|
||||
});
|
||||
}
|
||||
}
|
||||
_presenceRepository.SavePresence(presences);
|
||||
}
|
||||
|
||||
public void GeneratePresenceForWeek(int firstLesson, int lastLesson, int groupId, DateTime startTime)
|
||||
{
|
||||
// Проверка существования группы
|
||||
var groupExists = _groupRepository.GetAllGroup().Any(g => g.Id == groupId);
|
||||
if (!groupExists)
|
||||
{
|
||||
throw new ArgumentException($"Группа с ID {groupId} не существует.");
|
||||
}
|
||||
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
DateTime currentTime = startTime.AddDays(i);
|
||||
GeneratePresenceForDay(firstLesson, lastLesson, groupId, currentTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void MarkUserAsAbsent(Guid userGuid, int groupId, int firstLesson, int lastLesson, DateTime date)
|
||||
{
|
||||
var presences = _presenceRepository.GetPresenceByGroupAndDate(groupId, date);
|
||||
foreach (var presence in presences.Where(p => p.UserGuid == userGuid && p.LessonNumber >= firstLesson && p.LessonNumber <= lastLesson))
|
||||
{
|
||||
presence.IsAttedance = false;
|
||||
}
|
||||
_presenceRepository.SavePresence(presences);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<PresenceLocalEntity> GetAllPresenceByGroup(int groupId)
|
||||
{
|
||||
return _presenceRepository.GetPresenceByGroup(groupId);
|
||||
}
|
||||
|
||||
public GroupPresenceSummary GetGeneralPresenceForGroup(int groupId)
|
||||
{
|
||||
return _presenceRepository.GetGeneralPresenceForGroup(groupId);
|
||||
}
|
||||
public class UseCaseGeneratePresence
|
||||
{
|
||||
public readonly IUserRepository _userRepository;
|
||||
public readonly IPresenceRepository _presenceRepository;
|
||||
private readonly IGroupRepository _groupRepository;
|
||||
|
||||
public UseCaseGeneratePresence(IUserRepository userRepository, IPresenceRepository presenceRepository, IGroupRepository groupRepository)
|
||||
{
|
||||
_userRepository = userRepository;
|
||||
_presenceRepository = presenceRepository;
|
||||
_groupRepository = groupRepository;
|
||||
}
|
||||
|
||||
public List<PresenceLocalEntity> GetPresenceByGroupAndDate(int groupId, DateTime date)
|
||||
{
|
||||
return _presenceRepository.GetPresenceByGroupAndDate(groupId, date);
|
||||
}
|
||||
|
||||
|
||||
public void GeneratePresenceForDay(int firstLesson, int lastLesson, int groupId, DateTime currentDate)
|
||||
{
|
||||
// Проверка существования группы
|
||||
var groupExists = _groupRepository.GetAllGroup().Any(g => g.Id == groupId);
|
||||
if (!groupExists)
|
||||
{
|
||||
throw new ArgumentException($"Группа с ID {groupId} не существует.");
|
||||
}
|
||||
|
||||
var users = _userRepository.GetAllUsers.Where(u => u.GroupID == groupId).ToList();
|
||||
List<PresenceLocalEntity> presences = new List<PresenceLocalEntity>();
|
||||
for (int lessonNumber = firstLesson; lessonNumber <= lastLesson; lessonNumber++)
|
||||
{
|
||||
foreach (var user in users)
|
||||
{
|
||||
presences.Add(new PresenceLocalEntity
|
||||
{
|
||||
UserGuid = user.Guid,
|
||||
Date = currentDate,
|
||||
LessonNumber = lessonNumber,
|
||||
IsAttedance = true
|
||||
});
|
||||
}
|
||||
}
|
||||
_presenceRepository.SavePresence(presences);
|
||||
}
|
||||
|
||||
public void GeneratePresenceForWeek(int firstLesson, int lastLesson, int groupId, DateTime startTime)
|
||||
{
|
||||
// Проверка существования группы
|
||||
var groupExists = _groupRepository.GetAllGroup().Any(g => g.Id == groupId);
|
||||
if (!groupExists)
|
||||
{
|
||||
throw new ArgumentException($"Группа с ID {groupId} не существует.");
|
||||
}
|
||||
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
DateTime currentTime = startTime.AddDays(i);
|
||||
GeneratePresenceForDay(firstLesson, lastLesson, groupId, currentTime);
|
||||
}
|
||||
}
|
||||
|
||||
public void MarkUserAsAbsent(Guid userGuid, int groupId, int firstLesson, int lastLesson, DateTime date)
|
||||
{
|
||||
var presences = _presenceRepository.GetPresenceByGroupAndDate(groupId, date);
|
||||
foreach (var presence in presences.Where(p => p.UserGuid == userGuid && p.LessonNumber >= firstLesson && p.LessonNumber <= lastLesson))
|
||||
{
|
||||
presence.IsAttedance = false;
|
||||
}
|
||||
_presenceRepository.SavePresence(presences);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,28 +1,60 @@
|
||||
using Demo.Data.Repository;
|
||||
using Demo.Data.Exceptions;
|
||||
using Demo.Data.Repository;
|
||||
using Demo.domain.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.Domain.UseCase
|
||||
{
|
||||
public class UserUseCase
|
||||
{
|
||||
private UserRepositoryImpl _repositoryUserImpl;
|
||||
private GroupRepositoryImpl _repositoryGroupImpl;
|
||||
private readonly IUserRepository _repositoryUserImpl;
|
||||
private readonly IGroupRepository _repositoryGroupImpl;
|
||||
|
||||
public UserUseCase(UserRepositoryImpl repositoryImpl, GroupRepositoryImpl repositoryGroupImpl)
|
||||
public UserUseCase(IUserRepository repositoryImpl, IGroupRepository repositoryGroupImpl)
|
||||
{
|
||||
_repositoryUserImpl = repositoryImpl;
|
||||
_repositoryGroupImpl = repositoryGroupImpl;
|
||||
}
|
||||
|
||||
public List<Group> GetAllGroups() => _repositoryGroupImpl.GetAllGroups()
|
||||
.Select(it => new Group { Id = it.Id, Name = it.Name }).ToList();
|
||||
// Приватный метод для валидации ФИО пользователя
|
||||
private void ValidateUserFIO(string fio)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(fio))
|
||||
{
|
||||
throw new ArgumentException("ФИО не может быть пустым.");
|
||||
}
|
||||
}
|
||||
|
||||
// Приватный метод для валидации существования пользователя по ID
|
||||
private UserLocalEnity ValidateUserExistence(Guid userGuid)
|
||||
{
|
||||
var user = _repositoryUserImpl.GetAllUsers
|
||||
.FirstOrDefault(u => u.Guid == userGuid);
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
throw new Exception("Пользователь не найден.");
|
||||
}
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
// Приватный метод для валидации существования группы по ID
|
||||
private GroupLocalEntity ValidateGroupExistence(int groupId)
|
||||
{
|
||||
var group = _repositoryGroupImpl.GetAllGroup()
|
||||
.FirstOrDefault(g => g.Id == groupId);
|
||||
|
||||
if (group == null)
|
||||
{
|
||||
throw new Exception("Группа не найдена.");
|
||||
}
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
// Вывести всех пользователей
|
||||
public List<User> GetAllUsers() => _repositoryUserImpl.GetAllUsers
|
||||
.Join(_repositoryGroupImpl.GetAllGroups(),
|
||||
.Join(_repositoryGroupImpl.GetAllGroup(),
|
||||
user => user.GroupID,
|
||||
group => group.Id,
|
||||
(user, group) =>
|
||||
@ -31,35 +63,73 @@ namespace Demo.Domain.UseCase
|
||||
FIO = user.FIO,
|
||||
Guid = user.Guid,
|
||||
Group = new Group { Id = group.Id, Name = group.Name }
|
||||
}
|
||||
).ToList();
|
||||
}).ToList();
|
||||
|
||||
public bool RemoveUserByGuid(Guid userGuid)
|
||||
// Удалить пользователя по id
|
||||
public bool RemoveUserById(int userId)
|
||||
{
|
||||
return _repositoryUserImpl.RemoveUserByGuid(userGuid);
|
||||
try
|
||||
{
|
||||
return _repositoryUserImpl.RemoveUserById( userId);
|
||||
}
|
||||
catch (UserNotFoundException ex)
|
||||
{
|
||||
Console.WriteLine($"Ошибка: {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
catch (RepositoryException ex)
|
||||
{
|
||||
Console.WriteLine($"Ошибка в репозитории: {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Обновить пользователя по guid
|
||||
public User UpdateUser(User user)
|
||||
{
|
||||
UserLocalEnity userLocalEnity = new UserLocalEnity { FIO = user.FIO, GroupID = user.Group.Id, Guid = user.Guid };
|
||||
ValidateUserFIO(user.FIO);
|
||||
ValidateGroupExistence(user.Group.Id);
|
||||
|
||||
UserLocalEnity userLocalEnity = new UserLocalEnity
|
||||
{
|
||||
FIO = user.FIO,
|
||||
GroupID = user.Group.Id,
|
||||
Guid = user.Guid
|
||||
};
|
||||
|
||||
UserLocalEnity? result = _repositoryUserImpl.UpdateUser(userLocalEnity);
|
||||
if (result == null) throw new Exception("");
|
||||
Group? group = GetAllGroups().FirstOrDefault(it => it.Id == result!.GroupID);
|
||||
if (group == null) throw new Exception("");
|
||||
return new User { FIO = user.FIO, Guid = user.Guid, Group = group };
|
||||
}
|
||||
public User FindUserByGuid(Guid userGuid)
|
||||
{
|
||||
Dictionary<Guid, User> users = new Dictionary<Guid, User>();
|
||||
|
||||
if (users.ContainsKey(userGuid))
|
||||
if (result == null)
|
||||
{
|
||||
return users[userGuid];
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
throw new Exception("Ошибка при обновлении пользователя.");
|
||||
}
|
||||
|
||||
var groupEntity = ValidateGroupExistence(result.GroupID);
|
||||
|
||||
return new User
|
||||
{
|
||||
FIO = result.FIO,
|
||||
Guid = result.Guid,
|
||||
Group = new Group
|
||||
{
|
||||
Id = groupEntity.Id,
|
||||
Name = groupEntity.Name
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Найти пользователя по id
|
||||
public User FindUserById(Guid userGuid)
|
||||
{
|
||||
var user = ValidateUserExistence(userGuid);
|
||||
var group = ValidateGroupExistence(user.GroupID);
|
||||
|
||||
return new User
|
||||
{
|
||||
FIO = user.FIO,
|
||||
Guid = user.Guid,
|
||||
Group = new Group { Id = group.Id, Name = group.Name }
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
121
Demo/Migrations/20241031104311_InitialCreate.Designer.cs
generated
Normal file
121
Demo/Migrations/20241031104311_InitialCreate.Designer.cs
generated
Normal file
@ -0,0 +1,121 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Demo.Data.RemoteData.RemoteDataBase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Demo.Migrations
|
||||
{
|
||||
[DbContext(typeof(RemoteDatabaseContext))]
|
||||
[Migration("20241031104311_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.10")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Demo.Data.RemoteData.RemoteDataBase.DAO.GroupDao", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Demo.Data.RemoteData.RemoteDataBase.DAO.PresenceDao", b =>
|
||||
{
|
||||
b.Property<Guid>("UserGuid")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateOnly>("Date")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<bool>("IsAttedance")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("LessonNumber")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("GroupId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<Guid>("UserDaoGuid")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("UserGuid", "Date", "IsAttedance", "LessonNumber");
|
||||
|
||||
b.HasIndex("UserDaoGuid");
|
||||
|
||||
b.ToTable("PresenceDaos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Demo.Data.RemoteData.RemoteDataBase.DAO.UserDao", b =>
|
||||
{
|
||||
b.Property<Guid>("Guid")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("FIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("GroupID")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Guid");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Demo.Data.RemoteData.RemoteDataBase.DAO.PresenceDao", b =>
|
||||
{
|
||||
b.HasOne("Demo.Data.RemoteData.RemoteDataBase.DAO.UserDao", "UserDao")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserDaoGuid")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("UserDao");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Demo.Data.RemoteData.RemoteDataBase.DAO.UserDao", b =>
|
||||
{
|
||||
b.HasOne("Demo.Data.RemoteData.RemoteDataBase.DAO.GroupDao", "Group")
|
||||
.WithMany("Users")
|
||||
.HasForeignKey("GroupID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Group");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Demo.Data.RemoteData.RemoteDataBase.DAO.GroupDao", b =>
|
||||
{
|
||||
b.Navigation("Users");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
93
Demo/Migrations/20241031104311_InitialCreate.cs
Normal file
93
Demo/Migrations/20241031104311_InitialCreate.cs
Normal file
@ -0,0 +1,93 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Demo.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialCreate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Groups",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Name = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Groups", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Users",
|
||||
columns: table => new
|
||||
{
|
||||
Guid = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
FIO = table.Column<string>(type: "text", nullable: false),
|
||||
GroupID = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Users", x => x.Guid);
|
||||
table.ForeignKey(
|
||||
name: "FK_Users_Groups_GroupID",
|
||||
column: x => x.GroupID,
|
||||
principalTable: "Groups",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PresenceDaos",
|
||||
columns: table => new
|
||||
{
|
||||
UserGuid = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
IsAttedance = table.Column<bool>(type: "boolean", nullable: false),
|
||||
Date = table.Column<DateOnly>(type: "date", nullable: false),
|
||||
LessonNumber = table.Column<int>(type: "integer", nullable: false),
|
||||
UserDaoGuid = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
GroupId = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PresenceDaos", x => new { x.UserGuid, x.Date, x.IsAttedance, x.LessonNumber });
|
||||
table.ForeignKey(
|
||||
name: "FK_PresenceDaos_Users_UserDaoGuid",
|
||||
column: x => x.UserDaoGuid,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Guid",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PresenceDaos_UserDaoGuid",
|
||||
table: "PresenceDaos",
|
||||
column: "UserDaoGuid");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Users_GroupID",
|
||||
table: "Users",
|
||||
column: "GroupID");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "PresenceDaos");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Users");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Groups");
|
||||
}
|
||||
}
|
||||
}
|
118
Demo/Migrations/RemoteDatabaseContextModelSnapshot.cs
Normal file
118
Demo/Migrations/RemoteDatabaseContextModelSnapshot.cs
Normal file
@ -0,0 +1,118 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Demo.Data.RemoteData.RemoteDataBase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Demo.Migrations
|
||||
{
|
||||
[DbContext(typeof(RemoteDatabaseContext))]
|
||||
partial class RemoteDatabaseContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.10")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Demo.Data.RemoteData.RemoteDataBase.DAO.GroupDao", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Demo.Data.RemoteData.RemoteDataBase.DAO.PresenceDao", b =>
|
||||
{
|
||||
b.Property<Guid>("UserGuid")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateOnly>("Date")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<bool>("IsAttedance")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("LessonNumber")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("GroupId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<Guid>("UserDaoGuid")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("UserGuid", "Date", "IsAttedance", "LessonNumber");
|
||||
|
||||
b.HasIndex("UserDaoGuid");
|
||||
|
||||
b.ToTable("PresenceDaos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Demo.Data.RemoteData.RemoteDataBase.DAO.UserDao", b =>
|
||||
{
|
||||
b.Property<Guid>("Guid")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("FIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("GroupID")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Guid");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Demo.Data.RemoteData.RemoteDataBase.DAO.PresenceDao", b =>
|
||||
{
|
||||
b.HasOne("Demo.Data.RemoteData.RemoteDataBase.DAO.UserDao", "UserDao")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserDaoGuid")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("UserDao");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Demo.Data.RemoteData.RemoteDataBase.DAO.UserDao", b =>
|
||||
{
|
||||
b.HasOne("Demo.Data.RemoteData.RemoteDataBase.DAO.GroupDao", "Group")
|
||||
.WithMany("Users")
|
||||
.HasForeignKey("GroupID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Group");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Demo.Data.RemoteData.RemoteDataBase.DAO.GroupDao", b =>
|
||||
{
|
||||
b.Navigation("Users");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +1,31 @@
|
||||
|
||||
using Demo.Data.RemoteData.RemoteDataBase;
|
||||
using Demo.Data.Repository;
|
||||
using Demo.Domain.UseCase;
|
||||
using Demo.UI;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
GroupRepositoryImpl groupRepositoryImpl = new GroupRepositoryImpl();
|
||||
UserRepositoryImpl userRepositoryImpl = new UserRepositoryImpl();
|
||||
UserUseCase userUseCase = new UserUseCase(userRepositoryImpl, groupRepositoryImpl);
|
||||
// Создаем экземпляр репозиториев
|
||||
|
||||
MainMenuUI mainMenuUI = new MainMenuUI(userUseCase);
|
||||
IServiceCollection services = new ServiceCollection();
|
||||
|
||||
services
|
||||
.AddDbContext<RemoteDatabaseContext>()
|
||||
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
|
||||
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
|
||||
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
|
||||
.AddSingleton<UserUseCase>()
|
||||
.AddSingleton<GroupUseCase>()
|
||||
.AddSingleton<UseCaseGeneratePresence>()
|
||||
.AddSingleton<GroupConsoleUI>()
|
||||
.AddSingleton<PresenceConsole>()
|
||||
.AddSingleton<MainMenuUI>();
|
||||
|
||||
|
||||
|
||||
|
||||
var serviceProvider = services.BuildServiceProvider();
|
||||
// Создаем пользовательский интерфейс
|
||||
MainMenuUI mainMenuUI = serviceProvider.GetService<MainMenuUI>();
|
||||
|
||||
// Выводим главное меню
|
||||
mainMenuUI.DisplayMenu();
|
@ -1,44 +1,64 @@
|
||||
using Demo.domain.Models;
|
||||
using Demo.Domain.UseCase;
|
||||
using Demo.Domain.UseCase;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.UI
|
||||
{
|
||||
public class GroupConsole
|
||||
public class GroupConsoleUI
|
||||
{
|
||||
|
||||
|
||||
internal class GroupConsoleUI
|
||||
{
|
||||
GroupUseCase _groupUseCase;
|
||||
private readonly GroupUseCase _groupUseCase;
|
||||
|
||||
public GroupConsoleUI(GroupUseCase groupUseCase)
|
||||
{
|
||||
_groupUseCase = groupUseCase;
|
||||
}
|
||||
|
||||
public void FindGroupById(int IdGroup)
|
||||
{
|
||||
_groupUseCase.FindGroupById(IdGroup);
|
||||
}
|
||||
|
||||
public void AllGroups()
|
||||
// Метод для отображения всех групп
|
||||
public void DisplayAllGroups()
|
||||
{
|
||||
foreach (var Group in _groupUseCase.GetAllGroups())
|
||||
Console.WriteLine("Список всех групп ===");
|
||||
StringBuilder groupOutput = new StringBuilder();
|
||||
|
||||
foreach (var group in _groupUseCase.GetAllGroups())
|
||||
{
|
||||
Console.WriteLine($"{Group.Id}\t{Group.Name}");
|
||||
groupOutput.AppendLine($"{group.Id}\t{group.Name}");
|
||||
}
|
||||
|
||||
Console.WriteLine(groupOutput);
|
||||
Console.WriteLine(" ");
|
||||
}
|
||||
|
||||
// Метод добавления группы
|
||||
public void AddGroup(string groupName)
|
||||
{
|
||||
try
|
||||
{
|
||||
_groupUseCase.AddGroup(groupName);
|
||||
Console.WriteLine($"Группа {groupName} добавлена");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Ошибка: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateGroup(int groupId, GroupLocalEntity updatedGroup)
|
||||
public void RemoveGroup(string groupIdStr)
|
||||
{
|
||||
if (updatedGroup == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(updatedGroup), "Обновленная группа не может быть null");
|
||||
int groupId = int.Parse(groupIdStr);
|
||||
_groupUseCase.RemoveGroupById(groupId);
|
||||
Console.WriteLine($"Группа с ID {groupId} удалена");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// Метод обновления названия группы
|
||||
public void UpdateGroupName(int groupId, string newGroupName)
|
||||
{
|
||||
_groupUseCase.UpdateGroup(groupId, newGroupName);
|
||||
Console.WriteLine($"Название группы с ID {groupId} изменено на {newGroupName}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,66 +1,207 @@
|
||||
using Demo.Domain.UseCase;
|
||||
|
||||
using Demo.domain.Models;
|
||||
using Demo.Domain.UseCase;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.UI
|
||||
{
|
||||
public class MainMenuUI
|
||||
{
|
||||
private UserConsoleUI _userConsoleUI;
|
||||
private readonly UserConsoleUI _userConsoleUI;
|
||||
private readonly GroupConsoleUI _groupConsoleUI;
|
||||
private readonly PresenceConsole _presenceConsoleUI;
|
||||
|
||||
public MainMenuUI(UserUseCase userUseCase)
|
||||
public MainMenuUI(UserUseCase userUseCase, GroupUseCase groupUseCase, UseCaseGeneratePresence presenceUseCase)
|
||||
{
|
||||
_userConsoleUI = new UserConsoleUI(userUseCase);
|
||||
DisplayMenu();
|
||||
_groupConsoleUI = new GroupConsoleUI(groupUseCase);
|
||||
_presenceConsoleUI = new PresenceConsole(presenceUseCase);
|
||||
}
|
||||
|
||||
private void DisplayMenu()
|
||||
public void DisplayMenu()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
Console.Clear();
|
||||
Console.WriteLine("Главное меню:");
|
||||
Console.WriteLine("1. Показать всех пользователей");
|
||||
Console.WriteLine("2. Удалить пользователя по GUID");
|
||||
Console.WriteLine("0. Выход");
|
||||
Console.WriteLine("Меню");
|
||||
|
||||
string choice = Console.ReadLine();
|
||||
|
||||
switch (choice)
|
||||
Console.WriteLine();
|
||||
|
||||
|
||||
Console.WriteLine("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
|
||||
Console.WriteLine("1) Вывести список всех пользователей");
|
||||
Console.WriteLine("2) Вывод всех групп");
|
||||
Console.WriteLine("3) Обновить данные пользователя по ID");
|
||||
Console.WriteLine("4) Найти пользователя по ID");
|
||||
Console.WriteLine("5) Вывести список всех групп");
|
||||
Console.WriteLine("6) Создать новую группу");
|
||||
Console.WriteLine("7) Удалить группу по ID");
|
||||
Console.WriteLine("8) Изменить название группы");
|
||||
Console.WriteLine("9) Найти группу по ID");
|
||||
Console.WriteLine("10) Сгенерировать посещаемость на текущий день");
|
||||
Console.WriteLine("11) Сгенерировать посещаемость на текущую неделю");
|
||||
Console.WriteLine("12) Вывести посещаемость всех пользователей");
|
||||
Console.WriteLine("13) Отметить пользователя как отсутствующего");
|
||||
|
||||
Console.WriteLine("0) Выход из программы");
|
||||
|
||||
|
||||
Console.Write("\nВведите команду: ");
|
||||
string comand = Console.ReadLine();
|
||||
Console.WriteLine();
|
||||
|
||||
switch (comand)
|
||||
{
|
||||
case "1":
|
||||
// Вывод всех пользователей
|
||||
_userConsoleUI.DisplayAllUsers();
|
||||
break;
|
||||
|
||||
case "2":
|
||||
RemoveUser();
|
||||
// Вывод всех групп
|
||||
_groupConsoleUI.DisplayAllGroups();
|
||||
break;
|
||||
case "0":
|
||||
return;
|
||||
default:
|
||||
Console.WriteLine("Неверный выбор, попробуйте снова.");
|
||||
break;
|
||||
}
|
||||
|
||||
Console.WriteLine("Нажмите любую клавишу для продолжения...");
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveUser()
|
||||
case "3":
|
||||
// Обновление пользователя по ID
|
||||
Console.Write("Введите ID пользователя для обновления: ");
|
||||
string updateGuidInput = Console.ReadLine();
|
||||
if (Guid.TryParse(updateGuidInput, out Guid updateUserGuid))
|
||||
{
|
||||
Console.Write("Введите GUID пользователя для удаления: ");
|
||||
string input = Console.ReadLine();
|
||||
|
||||
if (Guid.TryParse(input, out Guid userGuid))
|
||||
{
|
||||
_userConsoleUI.RemoveUserByGuid(userGuid);
|
||||
_userConsoleUI.UpdateUserById(updateUserGuid);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Неверный формат GUID. Пожалуйста, попробуйте еще раз.");
|
||||
Console.WriteLine("Неверный формат ID");
|
||||
}
|
||||
break;
|
||||
|
||||
case "4":
|
||||
// Поиск пользователя по id
|
||||
Console.Write("Введите ID пользователя для поиска: ");
|
||||
string findGuidInput = Console.ReadLine();
|
||||
if (Guid.TryParse(findGuidInput, out Guid findUserGuid))
|
||||
{
|
||||
_userConsoleUI.FindUserById(findUserGuid);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Неверный формат ID");
|
||||
}
|
||||
break;
|
||||
|
||||
case "5":
|
||||
// Удалить пользователя по id
|
||||
Console.Write("Введите ID пользователя для удаления: ");
|
||||
string inputGuid = Console.ReadLine();
|
||||
if (Guid.TryParse(inputGuid, out Guid userGuid))
|
||||
{
|
||||
_userConsoleUI.RemoveUserById(userGuid);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Неверный формат ID");
|
||||
}
|
||||
break;
|
||||
|
||||
case "6":
|
||||
// Добавление новой группы
|
||||
Console.Write("Введите название новой группы: ");
|
||||
string newGroupName = Console.ReadLine();
|
||||
_groupConsoleUI.AddGroup(newGroupName);
|
||||
break;
|
||||
|
||||
case "7":
|
||||
// Удаление группы
|
||||
Console.Write("Введите ID группы для удаления: ");
|
||||
string groupIdForDelete = Console.ReadLine();
|
||||
_groupConsoleUI.RemoveGroup(groupIdForDelete);
|
||||
break;
|
||||
|
||||
case "8":
|
||||
// Изменение названия группы
|
||||
Console.Write("Введите ID группы для изменения: ");
|
||||
if (int.TryParse(Console.ReadLine(), out int groupId))
|
||||
{
|
||||
Console.Write("Введите новое название группы: ");
|
||||
string newName = Console.ReadLine();
|
||||
_groupConsoleUI.UpdateGroupName(groupId, newName);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Неверный формат ID группы");
|
||||
}
|
||||
break;
|
||||
|
||||
case "9":
|
||||
// Поиск группы
|
||||
Console.Write("Введите ID группы для поиска : ");
|
||||
if (int.TryParse(Console.ReadLine(), out int IdGroup))
|
||||
{
|
||||
_groupConsoleUI.FindGroupById(IdGroup);
|
||||
}
|
||||
break;
|
||||
|
||||
case "10":
|
||||
// Генерация посещаемости на день
|
||||
Console.Write("Введите номер первого занятия: ");
|
||||
int firstLesson = int.Parse(Console.ReadLine());
|
||||
Console.Write("Введите номер последнего занятия: ");
|
||||
int lastLesson = int.Parse(Console.ReadLine());
|
||||
Console.Write("Введите ID группы: ");
|
||||
int groupIdForPresence = int.Parse(Console.ReadLine());
|
||||
|
||||
_presenceConsoleUI.GeneratePresenceForDay(DateTime.Now, groupIdForPresence, firstLesson, lastLesson);
|
||||
Console.WriteLine("Посещаемость на день сгенерирована.");
|
||||
break;
|
||||
|
||||
case "11":
|
||||
// Генерация посещаемости на неделю
|
||||
Console.Write("Введите номер первого занятия: ");
|
||||
int firstLessonForWeek = int.Parse(Console.ReadLine());
|
||||
Console.Write("Введите номер последнего занятия: ");
|
||||
int lastLessonForWeek = int.Parse(Console.ReadLine());
|
||||
Console.Write("Введите ID группы: ");
|
||||
int groupIdForWeekPresence = int.Parse(Console.ReadLine());
|
||||
|
||||
_presenceConsoleUI.GeneratePresenceForWeek(DateTime.Now, groupIdForWeekPresence, firstLessonForWeek, lastLessonForWeek);
|
||||
Console.WriteLine("Посещаемость на неделю сгенерирована.");
|
||||
break;
|
||||
|
||||
case "12":
|
||||
// Отображение посещаемости
|
||||
Console.Write("Введите дату в формате гггг-мм-дд): ");
|
||||
DateTime date = DateTime.Parse(Console.ReadLine());
|
||||
Console.Write("Введите ID группы: ");
|
||||
int groupForPresenceView = int.Parse(Console.ReadLine());
|
||||
|
||||
_presenceConsoleUI.DisplayPresence(date, groupForPresenceView);
|
||||
break;
|
||||
|
||||
case "13":
|
||||
// Отметить пользователя как отсутствующего
|
||||
Console.Write("Введите ID пользователя: ");
|
||||
userGuid = Guid.Parse(Console.ReadLine());
|
||||
Console.Write("Введите номер первого занятия: ");
|
||||
int firstAbsLesson = int.Parse(Console.ReadLine());
|
||||
Console.Write("Введите номер последнего занятия: ");
|
||||
int lastAbsLesson = int.Parse(Console.ReadLine());
|
||||
Console.Write("Введите ID группы: ");
|
||||
int absGroupId = int.Parse(Console.ReadLine());
|
||||
|
||||
_presenceConsoleUI.MarkUserAbsent(DateTime.Now, absGroupId, userGuid, firstAbsLesson, lastAbsLesson);
|
||||
Console.WriteLine("Пользователь отмечен как отсутствующий.");
|
||||
break;
|
||||
|
||||
case "0":
|
||||
Console.WriteLine("Выйти");
|
||||
return;
|
||||
|
||||
default:
|
||||
Console.WriteLine("Неверно, повторите еще раз");
|
||||
break;
|
||||
}
|
||||
Console.WriteLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
149
Demo/UI/PresenceConsole.cs
Normal file
149
Demo/UI/PresenceConsole.cs
Normal file
@ -0,0 +1,149 @@
|
||||
using Demo.domain.Models;
|
||||
using Demo.Domain.UseCase;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Demo.UI
|
||||
{
|
||||
public class PresenceConsole
|
||||
{
|
||||
private readonly UseCaseGeneratePresence _presenceUseCase;
|
||||
|
||||
public PresenceConsole(UseCaseGeneratePresence presenceUseCase)
|
||||
{
|
||||
_presenceUseCase = presenceUseCase;
|
||||
}
|
||||
|
||||
// Метод для генерации посещаемости на день
|
||||
public void GeneratePresenceForDay(DateTime date, int groupId, int firstLesson, int lastLesson)
|
||||
{
|
||||
try
|
||||
{
|
||||
_presenceUseCase.GeneratePresenceDaily(firstLesson, lastLesson, groupId, date);
|
||||
Console.WriteLine("Посещаемость на день успешно сгенерирована.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Ошибка при генерации посещаемости: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Метод для генерации посещаемости на неделю
|
||||
public void GeneratePresenceForWeek(DateTime date, int groupId, int firstLesson, int lastLesson)
|
||||
{
|
||||
try
|
||||
{
|
||||
_presenceUseCase.GenerateWeeklyPresence(firstLesson, lastLesson, groupId, date);
|
||||
Console.WriteLine("Посещаемость на неделю успешно сгенерирована.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Ошибка при генерации посещаемости: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Метод для отображения посещаемости на конкретную дату и группу
|
||||
public void DisplayPresence(DateTime date, int groupId)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<PresenceLocalEntity> presences = _presenceUseCase.GetPresenceByDateAndGroup(groupId, date);
|
||||
|
||||
if (presences == null || presences.Count == 0)
|
||||
{
|
||||
Console.WriteLine("Нет данных о посещаемости на выбранную дату.");
|
||||
return;
|
||||
}
|
||||
|
||||
Console.WriteLine($"\n Посещаемость на {date:dd.MM.yyyy} ");
|
||||
Console.WriteLine("-----------------------------------------------------");
|
||||
|
||||
// Сохраняем номер занятия для сравнения
|
||||
int previousLessonNumber = -1;
|
||||
|
||||
foreach (var presence in presences)
|
||||
{
|
||||
// Проверяем, изменился ли номер занятия
|
||||
if (previousLessonNumber != presence.LessonNumber)
|
||||
{
|
||||
Console.WriteLine("-----------------------------------------------------");
|
||||
Console.WriteLine($" Занятие: {presence.LessonNumber} ");
|
||||
Console.WriteLine("-----------------------------------------------------");
|
||||
previousLessonNumber = presence.LessonNumber;
|
||||
}
|
||||
|
||||
// Форматируем статус присутствия
|
||||
string status = presence.IsAttedance ? "Присутствует" : "Отсутствует";
|
||||
Console.WriteLine($"Пользователь (ID: {presence.UserGuid}) - Статус: {status}");
|
||||
}
|
||||
|
||||
Console.WriteLine("-----------------------------------------------------");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Ошибка при отображении посещаемости: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void MarkUserAbsent(DateTime date, int groupId, Guid userGuid, int firstLesson, int lastLesson)
|
||||
{
|
||||
_presenceUseCase.MarkUserAbsentForLessons(userGuid, groupId, firstLesson, lastLesson, date);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void DisplayAllPresenceByGroup(int groupId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var presences = _presenceUseCase.GetAllPresenceByGroup(groupId);
|
||||
|
||||
if (presences == null || !presences.Any())
|
||||
{
|
||||
Console.WriteLine($"Нет данных о посещаемости для группы с ID: {groupId}.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Группируем записи посещаемости по дате
|
||||
var groupedPresences = presences.GroupBy(p => p.Date);
|
||||
|
||||
foreach (var group in groupedPresences)
|
||||
{
|
||||
Console.WriteLine("===================================================");
|
||||
Console.WriteLine($" Дата: {group.Key:dd.MM.yyyy} ");
|
||||
Console.WriteLine("===================================================");
|
||||
|
||||
// Сохраняем номер занятия для сравнения
|
||||
int previousLessonNumber = -1;
|
||||
|
||||
foreach (var presence in group)
|
||||
{
|
||||
// Проверяем, изменился ли номер занятия
|
||||
if (previousLessonNumber != presence.LessonNumber)
|
||||
{
|
||||
Console.WriteLine("---------------------------------------------------");
|
||||
Console.WriteLine($" Занятие: {presence.LessonNumber} ");
|
||||
Console.WriteLine("---------------------------------------------------");
|
||||
previousLessonNumber = presence.LessonNumber;
|
||||
}
|
||||
|
||||
// Форматируем статус присутствия
|
||||
string status = presence.IsAttedance ? "✅ Присутствует" : "❌ Отсутствует";
|
||||
Console.WriteLine($"Пользователь (ID: {presence.UserGuid}) - Статус: {status}");
|
||||
}
|
||||
|
||||
Console.WriteLine("---------------------------------------------------");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Ошибка при отображении посещаемости: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -1,53 +1,74 @@
|
||||
using Demo.domain.Models;
|
||||
using Demo.Domain.UseCase;
|
||||
using Demo.Domain.UseCase;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.UI
|
||||
{
|
||||
|
||||
public class UserConsoleUI
|
||||
{
|
||||
UserUseCase _userUseCase;
|
||||
private readonly UserUseCase _userUseCase;
|
||||
|
||||
public UserConsoleUI(UserUseCase userUseCase)
|
||||
{
|
||||
_userUseCase = userUseCase;
|
||||
}
|
||||
|
||||
public void RemoveUserByGuid(Guid guidUser)
|
||||
{
|
||||
|
||||
string del = _userUseCase.RemoveUserByGuid(guidUser) ? "Пользователь удален" : "Пользователь не удален";
|
||||
Console.WriteLine(del);
|
||||
}
|
||||
|
||||
// Метод для отображения всех пользователей
|
||||
public void DisplayAllUsers()
|
||||
{
|
||||
Console.WriteLine("\n=== Список всех пользователей ===");
|
||||
StringBuilder userOutput = new StringBuilder();
|
||||
|
||||
foreach (var user in _userUseCase.GetAllUsers())
|
||||
{
|
||||
userOutput.AppendLine($"{user.Guid}\t{user.FIO}\t{user.Group.Name}");
|
||||
}
|
||||
|
||||
Console.WriteLine(userOutput);
|
||||
Console.WriteLine("===============================\n");
|
||||
}
|
||||
|
||||
public void UpdateUserGuid(Guid guidUser)
|
||||
// Метод для удаления пользователя по ID
|
||||
public void RemoveUserById(Guid userGuid)
|
||||
{
|
||||
var user = _userUseCase.FindUserByGuid(guidUser);
|
||||
string output = _userUseCase.RemoveUserById(userGuid) ? "Пользователь удален" : "Пользователь не найден";
|
||||
Console.WriteLine($"\n{output}\n");
|
||||
}
|
||||
|
||||
// Метод для обновления пользователя по ID
|
||||
public void UpdateUserById(Guid userGuid)
|
||||
{
|
||||
try
|
||||
{
|
||||
var user = _userUseCase.FindUserById(userGuid);
|
||||
|
||||
Console.WriteLine($"Текущие данные: {user.FIO}, {user.Group.Name}");
|
||||
Console.Write("Введите новое ФИО: ");
|
||||
Console.Write("\nВведите новое ФИО: ");
|
||||
string newFIO = Console.ReadLine();
|
||||
|
||||
user.FIO = newFIO;
|
||||
_userUseCase.UpdateUser(user);
|
||||
|
||||
Console.WriteLine("\nПользователь обновлен.\n");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Ошибка: {ex.Message}\n");
|
||||
}
|
||||
}
|
||||
|
||||
public void GetUserByGuid(Guid guidUser)
|
||||
// Метод для поиска пользователя по ID
|
||||
public void FindUserById(Guid userGuid)
|
||||
{
|
||||
var user = _userUseCase.FindUserByGuid(guidUser);
|
||||
Console.WriteLine($"Пользователь найден: {user.Guid}, {user.FIO}, {user.Group.Name}");
|
||||
var user = _userUseCase.FindUserById(userGuid);
|
||||
if (user != null)
|
||||
{
|
||||
Console.WriteLine($"\nПользователь найден: {user.Guid}, {user.FIO}, {user.Group.Name}\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nПользователь не найден.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
BIN
Demo/bin/Debug/net8.0/ClosedXML.Parser.dll
Normal file
BIN
Demo/bin/Debug/net8.0/ClosedXML.Parser.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/ClosedXML.dll
Normal file
BIN
Demo/bin/Debug/net8.0/ClosedXML.dll
Normal file
Binary file not shown.
954
Demo/bin/Debug/net8.0/Demo.deps.json
Normal file
954
Demo/bin/Debug/net8.0/Demo.deps.json
Normal file
@ -0,0 +1,954 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"Demo/1.0.0": {
|
||||
"dependencies": {
|
||||
"ClosedXML": "0.104.1",
|
||||
"Microsoft.EntityFrameworkCore": "8.0.10",
|
||||
"Microsoft.EntityFrameworkCore.Design": "8.0.10",
|
||||
"Microsoft.Extensions.DependencyInjection": "8.0.1",
|
||||
"Npgsql.EntityFrameworkCore.PostgreSQL": "8.0.10"
|
||||
},
|
||||
"runtime": {
|
||||
"Demo.dll": {}
|
||||
}
|
||||
},
|
||||
"ClosedXML/0.104.1": {
|
||||
"dependencies": {
|
||||
"ClosedXML.Parser": "1.2.0",
|
||||
"DocumentFormat.OpenXml": "3.0.1",
|
||||
"ExcelNumberFormat": "1.1.0",
|
||||
"RBush": "3.2.0",
|
||||
"SixLabors.Fonts": "1.0.0",
|
||||
"System.IO.Packaging": "8.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.1/ClosedXML.dll": {
|
||||
"assemblyVersion": "0.104.1.0",
|
||||
"fileVersion": "0.104.1.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ClosedXML.Parser/1.2.0": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.1/ClosedXML.Parser.dll": {
|
||||
"assemblyVersion": "1.0.0.0",
|
||||
"fileVersion": "1.0.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"DocumentFormat.OpenXml/3.0.1": {
|
||||
"dependencies": {
|
||||
"DocumentFormat.OpenXml.Framework": "3.0.1"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/DocumentFormat.OpenXml.dll": {
|
||||
"assemblyVersion": "3.0.1.0",
|
||||
"fileVersion": "3.0.1.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"DocumentFormat.OpenXml.Framework/3.0.1": {
|
||||
"dependencies": {
|
||||
"System.IO.Packaging": "8.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/DocumentFormat.OpenXml.Framework.dll": {
|
||||
"assemblyVersion": "3.0.1.0",
|
||||
"fileVersion": "3.0.1.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ExcelNumberFormat/1.1.0": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/ExcelNumberFormat.dll": {
|
||||
"assemblyVersion": "1.1.0.0",
|
||||
"fileVersion": "1.1.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Humanizer.Core/2.14.1": {
|
||||
"runtime": {
|
||||
"lib/net6.0/Humanizer.dll": {
|
||||
"assemblyVersion": "2.14.0.0",
|
||||
"fileVersion": "2.14.1.48190"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Bcl.AsyncInterfaces/6.0.0": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Analyzers/3.3.3": {},
|
||||
"Microsoft.CodeAnalysis.Common/4.5.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.CodeAnalysis.Analyzers": "3.3.3",
|
||||
"System.Collections.Immutable": "6.0.0",
|
||||
"System.Reflection.Metadata": "6.0.1",
|
||||
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
|
||||
"System.Text.Encoding.CodePages": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netcoreapp3.1/Microsoft.CodeAnalysis.dll": {
|
||||
"assemblyVersion": "4.5.0.0",
|
||||
"fileVersion": "4.500.23.10905"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "cs"
|
||||
},
|
||||
"lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "de"
|
||||
},
|
||||
"lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "es"
|
||||
},
|
||||
"lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "fr"
|
||||
},
|
||||
"lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "it"
|
||||
},
|
||||
"lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "ja"
|
||||
},
|
||||
"lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "ko"
|
||||
},
|
||||
"lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "pl"
|
||||
},
|
||||
"lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "pt-BR"
|
||||
},
|
||||
"lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "ru"
|
||||
},
|
||||
"lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "tr"
|
||||
},
|
||||
"lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
},
|
||||
"lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "zh-Hant"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeAnalysis.CSharp/4.5.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.CodeAnalysis.Common": "4.5.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netcoreapp3.1/Microsoft.CodeAnalysis.CSharp.dll": {
|
||||
"assemblyVersion": "4.5.0.0",
|
||||
"fileVersion": "4.500.23.10905"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "cs"
|
||||
},
|
||||
"lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "de"
|
||||
},
|
||||
"lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "es"
|
||||
},
|
||||
"lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "fr"
|
||||
},
|
||||
"lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "it"
|
||||
},
|
||||
"lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "ja"
|
||||
},
|
||||
"lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "ko"
|
||||
},
|
||||
"lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "pl"
|
||||
},
|
||||
"lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "pt-BR"
|
||||
},
|
||||
"lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "ru"
|
||||
},
|
||||
"lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "tr"
|
||||
},
|
||||
"lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
},
|
||||
"lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "zh-Hant"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeAnalysis.CSharp.Workspaces/4.5.0": {
|
||||
"dependencies": {
|
||||
"Humanizer.Core": "2.14.1",
|
||||
"Microsoft.CodeAnalysis.CSharp": "4.5.0",
|
||||
"Microsoft.CodeAnalysis.Common": "4.5.0",
|
||||
"Microsoft.CodeAnalysis.Workspaces.Common": "4.5.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netcoreapp3.1/Microsoft.CodeAnalysis.CSharp.Workspaces.dll": {
|
||||
"assemblyVersion": "4.5.0.0",
|
||||
"fileVersion": "4.500.23.10905"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "cs"
|
||||
},
|
||||
"lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "de"
|
||||
},
|
||||
"lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "es"
|
||||
},
|
||||
"lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "fr"
|
||||
},
|
||||
"lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "it"
|
||||
},
|
||||
"lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "ja"
|
||||
},
|
||||
"lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "ko"
|
||||
},
|
||||
"lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "pl"
|
||||
},
|
||||
"lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "pt-BR"
|
||||
},
|
||||
"lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "ru"
|
||||
},
|
||||
"lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "tr"
|
||||
},
|
||||
"lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
},
|
||||
"lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "zh-Hant"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Workspaces.Common/4.5.0": {
|
||||
"dependencies": {
|
||||
"Humanizer.Core": "2.14.1",
|
||||
"Microsoft.Bcl.AsyncInterfaces": "6.0.0",
|
||||
"Microsoft.CodeAnalysis.Common": "4.5.0",
|
||||
"System.Composition": "6.0.0",
|
||||
"System.IO.Pipelines": "6.0.3",
|
||||
"System.Threading.Channels": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netcoreapp3.1/Microsoft.CodeAnalysis.Workspaces.dll": {
|
||||
"assemblyVersion": "4.5.0.0",
|
||||
"fileVersion": "4.500.23.10905"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "cs"
|
||||
},
|
||||
"lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "de"
|
||||
},
|
||||
"lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "es"
|
||||
},
|
||||
"lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "fr"
|
||||
},
|
||||
"lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "it"
|
||||
},
|
||||
"lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "ja"
|
||||
},
|
||||
"lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "ko"
|
||||
},
|
||||
"lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "pl"
|
||||
},
|
||||
"lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "pt-BR"
|
||||
},
|
||||
"lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "ru"
|
||||
},
|
||||
"lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "tr"
|
||||
},
|
||||
"lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
},
|
||||
"lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "zh-Hant"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore/8.0.10": {
|
||||
"dependencies": {
|
||||
"Microsoft.EntityFrameworkCore.Abstractions": "8.0.10",
|
||||
"Microsoft.EntityFrameworkCore.Analyzers": "8.0.10",
|
||||
"Microsoft.Extensions.Caching.Memory": "8.0.1",
|
||||
"Microsoft.Extensions.Logging": "8.0.1"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.EntityFrameworkCore.dll": {
|
||||
"assemblyVersion": "8.0.10.0",
|
||||
"fileVersion": "8.0.1024.46708"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Abstractions/8.0.10": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.EntityFrameworkCore.Abstractions.dll": {
|
||||
"assemblyVersion": "8.0.10.0",
|
||||
"fileVersion": "8.0.1024.46708"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Analyzers/8.0.10": {},
|
||||
"Microsoft.EntityFrameworkCore.Design/8.0.10": {
|
||||
"dependencies": {
|
||||
"Humanizer.Core": "2.14.1",
|
||||
"Microsoft.CodeAnalysis.CSharp.Workspaces": "4.5.0",
|
||||
"Microsoft.EntityFrameworkCore.Relational": "8.0.10",
|
||||
"Microsoft.Extensions.DependencyModel": "8.0.2",
|
||||
"Mono.TextTemplating": "2.2.1"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.EntityFrameworkCore.Design.dll": {
|
||||
"assemblyVersion": "8.0.10.0",
|
||||
"fileVersion": "8.0.1024.46708"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Relational/8.0.10": {
|
||||
"dependencies": {
|
||||
"Microsoft.EntityFrameworkCore": "8.0.10",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "8.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.EntityFrameworkCore.Relational.dll": {
|
||||
"assemblyVersion": "8.0.10.0",
|
||||
"fileVersion": "8.0.1024.46708"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Caching.Abstractions/8.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "8.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Caching.Abstractions.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.23.53103"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Caching.Memory/8.0.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Caching.Abstractions": "8.0.0",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "8.0.2",
|
||||
"Microsoft.Extensions.Options": "8.0.2",
|
||||
"Microsoft.Extensions.Primitives": "8.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Caching.Memory.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.1024.46610"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Abstractions/8.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "8.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Configuration.Abstractions.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.23.53103"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection/8.0.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.DependencyInjection.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.1024.46610"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.1024.46610"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyModel/8.0.2": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.DependencyModel.dll": {
|
||||
"assemblyVersion": "8.0.0.2",
|
||||
"fileVersion": "8.0.1024.46610"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging/8.0.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection": "8.0.1",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "8.0.2",
|
||||
"Microsoft.Extensions.Options": "8.0.2"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Logging.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.1024.46610"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions/8.0.2": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.1024.46610"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Options/8.0.2": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2",
|
||||
"Microsoft.Extensions.Primitives": "8.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Options.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.224.6711"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Primitives/8.0.0": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Primitives.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.23.53103"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Mono.TextTemplating/2.2.1": {
|
||||
"dependencies": {
|
||||
"System.CodeDom": "4.4.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Mono.TextTemplating.dll": {
|
||||
"assemblyVersion": "2.2.0.0",
|
||||
"fileVersion": "2.2.1.1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Npgsql/8.0.5": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Logging.Abstractions": "8.0.2"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Npgsql.dll": {
|
||||
"assemblyVersion": "8.0.5.0",
|
||||
"fileVersion": "8.0.5.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Npgsql.EntityFrameworkCore.PostgreSQL/8.0.10": {
|
||||
"dependencies": {
|
||||
"Microsoft.EntityFrameworkCore": "8.0.10",
|
||||
"Microsoft.EntityFrameworkCore.Abstractions": "8.0.10",
|
||||
"Microsoft.EntityFrameworkCore.Relational": "8.0.10",
|
||||
"Npgsql": "8.0.5"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Npgsql.EntityFrameworkCore.PostgreSQL.dll": {
|
||||
"assemblyVersion": "8.0.10.0",
|
||||
"fileVersion": "8.0.10.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"RBush/3.2.0": {
|
||||
"runtime": {
|
||||
"lib/net6.0/RBush.dll": {
|
||||
"assemblyVersion": "3.0.0.0",
|
||||
"fileVersion": "3.2.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"SixLabors.Fonts/1.0.0": {
|
||||
"runtime": {
|
||||
"lib/netcoreapp3.1/SixLabors.Fonts.dll": {
|
||||
"assemblyVersion": "1.0.0.0",
|
||||
"fileVersion": "1.0.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.CodeDom/4.4.0": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.CodeDom.dll": {
|
||||
"assemblyVersion": "4.0.0.0",
|
||||
"fileVersion": "4.6.25519.3"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Collections.Immutable/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
|
||||
}
|
||||
},
|
||||
"System.Composition/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Composition.AttributedModel": "6.0.0",
|
||||
"System.Composition.Convention": "6.0.0",
|
||||
"System.Composition.Hosting": "6.0.0",
|
||||
"System.Composition.Runtime": "6.0.0",
|
||||
"System.Composition.TypedParts": "6.0.0"
|
||||
}
|
||||
},
|
||||
"System.Composition.AttributedModel/6.0.0": {
|
||||
"runtime": {
|
||||
"lib/net6.0/System.Composition.AttributedModel.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Composition.Convention/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Composition.AttributedModel": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net6.0/System.Composition.Convention.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Composition.Hosting/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Composition.Runtime": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net6.0/System.Composition.Hosting.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Composition.Runtime/6.0.0": {
|
||||
"runtime": {
|
||||
"lib/net6.0/System.Composition.Runtime.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Composition.TypedParts/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Composition.AttributedModel": "6.0.0",
|
||||
"System.Composition.Hosting": "6.0.0",
|
||||
"System.Composition.Runtime": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net6.0/System.Composition.TypedParts.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.IO.Packaging/8.0.0": {
|
||||
"runtime": {
|
||||
"lib/net8.0/System.IO.Packaging.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.23.53103"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.IO.Pipelines/6.0.3": {
|
||||
"runtime": {
|
||||
"lib/net6.0/System.IO.Pipelines.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.522.21309"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Reflection.Metadata/6.0.1": {
|
||||
"dependencies": {
|
||||
"System.Collections.Immutable": "6.0.0"
|
||||
}
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe/6.0.0": {},
|
||||
"System.Text.Encoding.CodePages/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
|
||||
}
|
||||
},
|
||||
"System.Threading.Channels/6.0.0": {}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Demo/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"ClosedXML/0.104.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-RVm2fUNWJlBJlg07shrfeWzrHPG5ypI/vARqdUOUbUdaog8yBw8l4IbCHf2MXt0AXtzaZqGNqhFaCAHigCBdfw==",
|
||||
"path": "closedxml/0.104.1",
|
||||
"hashPath": "closedxml.0.104.1.nupkg.sha512"
|
||||
},
|
||||
"ClosedXML.Parser/1.2.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-w+/0tsxABS3lkSH8EUlA7IGme+mq5T/Puf3DbOiTckmSuUpAUO2LK29oXYByCcWkBv6wcRHxgWlQb1lxkwI0Tw==",
|
||||
"path": "closedxml.parser/1.2.0",
|
||||
"hashPath": "closedxml.parser.1.2.0.nupkg.sha512"
|
||||
},
|
||||
"DocumentFormat.OpenXml/3.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-DCK1cwFUJ1FGGyYyo++HWl9H1RkqMWIu+FGOLRy6E4L4y0/HIhlJ7N/n1HKboFfOwKn1cMBRxt1RCuDbIEy5YQ==",
|
||||
"path": "documentformat.openxml/3.0.1",
|
||||
"hashPath": "documentformat.openxml.3.0.1.nupkg.sha512"
|
||||
},
|
||||
"DocumentFormat.OpenXml.Framework/3.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-ifyI7OW7sggz7LQMIAD2aUsY/zVUON9QaHrpZ4MK33iVMeHlTG4uhUE2aLWb31nry+LCs2ALDAwf8OfUJGjgBg==",
|
||||
"path": "documentformat.openxml.framework/3.0.1",
|
||||
"hashPath": "documentformat.openxml.framework.3.0.1.nupkg.sha512"
|
||||
},
|
||||
"ExcelNumberFormat/1.1.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-R3BVHPs9O+RkExbZYTGT0+9HLbi8ZrNij1Yziyw6znd3J7P3uoIR07uwTLGOogtz1p6+0sna66eBoXu7tBiVQA==",
|
||||
"path": "excelnumberformat/1.1.0",
|
||||
"hashPath": "excelnumberformat.1.1.0.nupkg.sha512"
|
||||
},
|
||||
"Humanizer.Core/2.14.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==",
|
||||
"path": "humanizer.core/2.14.1",
|
||||
"hashPath": "humanizer.core.2.14.1.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Bcl.AsyncInterfaces/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==",
|
||||
"path": "microsoft.bcl.asyncinterfaces/6.0.0",
|
||||
"hashPath": "microsoft.bcl.asyncinterfaces.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Analyzers/3.3.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-j/rOZtLMVJjrfLRlAMckJLPW/1rze9MT1yfWqSIbUPGRu1m1P0fuo9PmqapwsmePfGB5PJrudQLvmUOAMF0DqQ==",
|
||||
"path": "microsoft.codeanalysis.analyzers/3.3.3",
|
||||
"hashPath": "microsoft.codeanalysis.analyzers.3.3.3.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Common/4.5.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-lwAbIZNdnY0SUNoDmZHkVUwLO8UyNnyyh1t/4XsbFxi4Ounb3xszIYZaWhyj5ZjyfcwqwmtMbE7fUTVCqQEIdQ==",
|
||||
"path": "microsoft.codeanalysis.common/4.5.0",
|
||||
"hashPath": "microsoft.codeanalysis.common.4.5.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CodeAnalysis.CSharp/4.5.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-cM59oMKAOxvdv76bdmaKPy5hfj+oR+zxikWoueEB7CwTko7mt9sVKZI8Qxlov0C/LuKEG+WQwifepqL3vuTiBQ==",
|
||||
"path": "microsoft.codeanalysis.csharp/4.5.0",
|
||||
"hashPath": "microsoft.codeanalysis.csharp.4.5.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CodeAnalysis.CSharp.Workspaces/4.5.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-h74wTpmGOp4yS4hj+EvNzEiPgg/KVs2wmSfTZ81upJZOtPkJsVkgfsgtxxqmAeapjT/vLKfmYV0bS8n5MNVP+g==",
|
||||
"path": "microsoft.codeanalysis.csharp.workspaces/4.5.0",
|
||||
"hashPath": "microsoft.codeanalysis.csharp.workspaces.4.5.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Workspaces.Common/4.5.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-l4dDRmGELXG72XZaonnOeORyD/T5RpEu5LGHOUIhnv+MmUWDY/m1kWXGwtcgQ5CJ5ynkFiRnIYzTKXYjUs7rbw==",
|
||||
"path": "microsoft.codeanalysis.workspaces.common/4.5.0",
|
||||
"hashPath": "microsoft.codeanalysis.workspaces.common.4.5.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore/8.0.10": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-PPkQdIqfR1nU3n6YgGGDk8G+eaYbaAKM1AzIQtlPNTKf10Osg3N9T+iK9AlnSA/ujsK00flPpFHVfJrbuBFS1A==",
|
||||
"path": "microsoft.entityframeworkcore/8.0.10",
|
||||
"hashPath": "microsoft.entityframeworkcore.8.0.10.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Abstractions/8.0.10": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-FV0QlcX9INY4kAD2o72uPtyOh0nZut2jB11Jf9mNYBtHay8gDLe+x4AbXFwuQg+eSvofjT7naV82e827zGfyMg==",
|
||||
"path": "microsoft.entityframeworkcore.abstractions/8.0.10",
|
||||
"hashPath": "microsoft.entityframeworkcore.abstractions.8.0.10.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Analyzers/8.0.10": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-51KkPIc0EMv/gVXhPIUi6cwJE9Mvh+PLr4Lap4naLcsoGZ0lF2SvOPgUUprwRV3MnN7nyD1XPhT5RJ/p+xFAXw==",
|
||||
"path": "microsoft.entityframeworkcore.analyzers/8.0.10",
|
||||
"hashPath": "microsoft.entityframeworkcore.analyzers.8.0.10.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Design/8.0.10": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-uGNjfKvAsql2KHRqxlK5wHo8mMC60G/FecrFKEjJgeIxtUAbSXGOgKGw/gD9flO5Fzzt1C7uxfIcr6ZsMmFkeg==",
|
||||
"path": "microsoft.entityframeworkcore.design/8.0.10",
|
||||
"hashPath": "microsoft.entityframeworkcore.design.8.0.10.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Relational/8.0.10": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-OefBEE47kGKPRPV3OT+FAW6o5BFgLk2D9EoeWVy7NbOepzUneayLQxbVE098FfedTyMwxvZQoDD9LrvZc3MadA==",
|
||||
"path": "microsoft.entityframeworkcore.relational/8.0.10",
|
||||
"hashPath": "microsoft.entityframeworkcore.relational.8.0.10.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Caching.Abstractions/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-3KuSxeHoNYdxVYfg2IRZCThcrlJ1XJqIXkAWikCsbm5C/bCjv7G0WoKDyuR98Q+T607QT2Zl5GsbGRkENcV2yQ==",
|
||||
"path": "microsoft.extensions.caching.abstractions/8.0.0",
|
||||
"hashPath": "microsoft.extensions.caching.abstractions.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Caching.Memory/8.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-HFDnhYLccngrzyGgHkjEDU5FMLn4MpOsr5ElgsBMC4yx6lJh4jeWO7fHS8+TXPq+dgxCmUa/Trl8svObmwW4QA==",
|
||||
"path": "microsoft.extensions.caching.memory/8.0.1",
|
||||
"hashPath": "microsoft.extensions.caching.memory.8.0.1.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Abstractions/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-3lE/iLSutpgX1CC0NOW70FJoGARRHbyKmG7dc0klnUZ9Dd9hS6N/POPWhKhMLCEuNN5nXEY5agmlFtH562vqhQ==",
|
||||
"path": "microsoft.extensions.configuration.abstractions/8.0.0",
|
||||
"hashPath": "microsoft.extensions.configuration.abstractions.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection/8.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-BmANAnR5Xd4Oqw7yQ75xOAYODybZQRzdeNucg7kS5wWKd2PNnMdYtJ2Vciy0QLylRmv42DGl5+AFL9izA6F1Rw==",
|
||||
"path": "microsoft.extensions.dependencyinjection/8.0.1",
|
||||
"hashPath": "microsoft.extensions.dependencyinjection.8.0.1.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==",
|
||||
"path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2",
|
||||
"hashPath": "microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.DependencyModel/8.0.2": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-mUBDZZRgZrSyFOsJ2qJJ9fXfqd/kXJwf3AiDoqLD9m6TjY5OO/vLNOb9fb4juC0487eq4hcGN/M2Rh/CKS7QYw==",
|
||||
"path": "microsoft.extensions.dependencymodel/8.0.2",
|
||||
"hashPath": "microsoft.extensions.dependencymodel.8.0.2.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Logging/8.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-4x+pzsQEbqxhNf1QYRr5TDkLP9UsLT3A6MdRKDDEgrW7h1ljiEPgTNhKYUhNCCAaVpQECVQ+onA91PTPnIp6Lw==",
|
||||
"path": "microsoft.extensions.logging/8.0.1",
|
||||
"hashPath": "microsoft.extensions.logging.8.0.1.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions/8.0.2": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==",
|
||||
"path": "microsoft.extensions.logging.abstractions/8.0.2",
|
||||
"hashPath": "microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Options/8.0.2": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-dWGKvhFybsaZpGmzkGCbNNwBD1rVlWzrZKANLW/CcbFJpCEceMCGzT7zZwHOGBCbwM0SzBuceMj5HN1LKV1QqA==",
|
||||
"path": "microsoft.extensions.options/8.0.2",
|
||||
"hashPath": "microsoft.extensions.options.8.0.2.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Primitives/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g==",
|
||||
"path": "microsoft.extensions.primitives/8.0.0",
|
||||
"hashPath": "microsoft.extensions.primitives.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"Mono.TextTemplating/2.2.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-KZYeKBET/2Z0gY1WlTAK7+RHTl7GSbtvTLDXEZZojUdAPqpQNDL6tHv7VUpqfX5VEOh+uRGKaZXkuD253nEOBQ==",
|
||||
"path": "mono.texttemplating/2.2.1",
|
||||
"hashPath": "mono.texttemplating.2.2.1.nupkg.sha512"
|
||||
},
|
||||
"Npgsql/8.0.5": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-zRG5V8cyeZLpzJlKzFKjEwkRMYIYnHWJvEor2lWXeccS2E1G2nIWYYhnukB51iz5XsWSVEtqg3AxTWM0QJ6vfg==",
|
||||
"path": "npgsql/8.0.5",
|
||||
"hashPath": "npgsql.8.0.5.nupkg.sha512"
|
||||
},
|
||||
"Npgsql.EntityFrameworkCore.PostgreSQL/8.0.10": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-gFPl9Dmxih7Yi4tZ3bITzZFzbxFMBx04gqTqcjoL2r5VEW+O2TA5UVw/wm/XW26NAJ7sg59Je0+9QrwiZt6MPQ==",
|
||||
"path": "npgsql.entityframeworkcore.postgresql/8.0.10",
|
||||
"hashPath": "npgsql.entityframeworkcore.postgresql.8.0.10.nupkg.sha512"
|
||||
},
|
||||
"RBush/3.2.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-ijGh9N0zZ7JfXk3oQkWCwK8SwSSByexbyh/MjbCjNxOft9eG5ZqKC1vdgiYq78h4IZRFmN4s3JZ/b10Jipud5w==",
|
||||
"path": "rbush/3.2.0",
|
||||
"hashPath": "rbush.3.2.0.nupkg.sha512"
|
||||
},
|
||||
"SixLabors.Fonts/1.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-LFQsCZlV0xlUyXAOMUo5kkSl+8zAQXXbbdwWchtk0B4o7zotZhQsQOcJUELGHdfPfm/xDAsz6hONAuV25bJaAg==",
|
||||
"path": "sixlabors.fonts/1.0.0",
|
||||
"hashPath": "sixlabors.fonts.1.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.CodeDom/4.4.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-2sCCb7doXEwtYAbqzbF/8UAeDRMNmPaQbU2q50Psg1J9KzumyVVCgKQY8s53WIPTufNT0DpSe9QRvVjOzfDWBA==",
|
||||
"path": "system.codedom/4.4.0",
|
||||
"hashPath": "system.codedom.4.4.0.nupkg.sha512"
|
||||
},
|
||||
"System.Collections.Immutable/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-l4zZJ1WU2hqpQQHXz1rvC3etVZN+2DLmQMO79FhOTZHMn8tDRr+WU287sbomD0BETlmKDn0ygUgVy9k5xkkJdA==",
|
||||
"path": "system.collections.immutable/6.0.0",
|
||||
"hashPath": "system.collections.immutable.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Composition/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-d7wMuKQtfsxUa7S13tITC8n1cQzewuhD5iDjZtK2prwFfKVzdYtgrTHgjaV03Zq7feGQ5gkP85tJJntXwInsJA==",
|
||||
"path": "system.composition/6.0.0",
|
||||
"hashPath": "system.composition.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Composition.AttributedModel/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-WK1nSDLByK/4VoC7fkNiFuTVEiperuCN/Hyn+VN30R+W2ijO1d0Z2Qm0ScEl9xkSn1G2MyapJi8xpf4R8WRa/w==",
|
||||
"path": "system.composition.attributedmodel/6.0.0",
|
||||
"hashPath": "system.composition.attributedmodel.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Composition.Convention/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-XYi4lPRdu5bM4JVJ3/UIHAiG6V6lWWUlkhB9ab4IOq0FrRsp0F4wTyV4Dj+Ds+efoXJ3qbLqlvaUozDO7OLeXA==",
|
||||
"path": "system.composition.convention/6.0.0",
|
||||
"hashPath": "system.composition.convention.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Composition.Hosting/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-w/wXjj7kvxuHPLdzZ0PAUt++qJl03t7lENmb2Oev0n3zbxyNULbWBlnd5J5WUMMv15kg5o+/TCZFb6lSwfaUUQ==",
|
||||
"path": "system.composition.hosting/6.0.0",
|
||||
"hashPath": "system.composition.hosting.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Composition.Runtime/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-qkRH/YBaMPTnzxrS5RDk1juvqed4A6HOD/CwRcDGyPpYps1J27waBddiiq1y93jk2ZZ9wuA/kynM+NO0kb3PKg==",
|
||||
"path": "system.composition.runtime/6.0.0",
|
||||
"hashPath": "system.composition.runtime.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Composition.TypedParts/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-iUR1eHrL8Cwd82neQCJ00MpwNIBs4NZgXzrPqx8NJf/k4+mwBO0XCRmHYJT4OLSwDDqh5nBLJWkz5cROnrGhRA==",
|
||||
"path": "system.composition.typedparts/6.0.0",
|
||||
"hashPath": "system.composition.typedparts.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.IO.Packaging/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-8g1V4YRpdGAxFcK8v9OjuMdIOJSpF30Zb1JGicwVZhly3I994WFyBdV6mQEo8d3T+URQe55/M0U0eIH0Hts1bg==",
|
||||
"path": "system.io.packaging/8.0.0",
|
||||
"hashPath": "system.io.packaging.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.IO.Pipelines/6.0.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-ryTgF+iFkpGZY1vRQhfCzX0xTdlV3pyaTTqRu2ETbEv+HlV7O6y7hyQURnghNIXvctl5DuZ//Dpks6HdL/Txgw==",
|
||||
"path": "system.io.pipelines/6.0.3",
|
||||
"hashPath": "system.io.pipelines.6.0.3.nupkg.sha512"
|
||||
},
|
||||
"System.Reflection.Metadata/6.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-III/lNMSn0ZRBuM9m5Cgbiho5j81u0FAEagFX5ta2DKbljZ3T0IpD8j+BIiHQPeKqJppWS9bGEp6JnKnWKze0g==",
|
||||
"path": "system.reflection.metadata/6.0.1",
|
||||
"hashPath": "system.reflection.metadata.6.0.1.nupkg.sha512"
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==",
|
||||
"path": "system.runtime.compilerservices.unsafe/6.0.0",
|
||||
"hashPath": "system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Text.Encoding.CodePages/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-ZFCILZuOvtKPauZ/j/swhvw68ZRi9ATCfvGbk1QfydmcXBkIWecWKn/250UH7rahZ5OoDBaiAudJtPvLwzw85A==",
|
||||
"path": "system.text.encoding.codepages/6.0.0",
|
||||
"hashPath": "system.text.encoding.codepages.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Threading.Channels/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-TY8/9+tI0mNaUMgntOxxaq2ndTkdXqLSxvPmas7XEqOlv9lQtB7wLjYGd756lOaO7Dvb5r/WXhluM+0Xe87v5Q==",
|
||||
"path": "system.threading.channels/6.0.0",
|
||||
"hashPath": "system.threading.channels.6.0.0.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
BIN
Demo/bin/Debug/net8.0/Demo.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Demo.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Demo.exe
Normal file
BIN
Demo/bin/Debug/net8.0/Demo.exe
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Demo.pdb
Normal file
BIN
Demo/bin/Debug/net8.0/Demo.pdb
Normal file
Binary file not shown.
13
Demo/bin/Debug/net8.0/Demo.runtimeconfig.json
Normal file
13
Demo/bin/Debug/net8.0/Demo.runtimeconfig.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net8.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "8.0.0"
|
||||
},
|
||||
"configProperties": {
|
||||
"System.Reflection.NullabilityInfoContext.IsSupported": true,
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
BIN
Demo/bin/Debug/net8.0/DocumentFormat.OpenXml.Framework.dll
Normal file
BIN
Demo/bin/Debug/net8.0/DocumentFormat.OpenXml.Framework.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/DocumentFormat.OpenXml.dll
Normal file
BIN
Demo/bin/Debug/net8.0/DocumentFormat.OpenXml.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/ExcelNumberFormat.dll
Normal file
BIN
Demo/bin/Debug/net8.0/ExcelNumberFormat.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Humanizer.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Humanizer.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Microsoft.Bcl.AsyncInterfaces.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Microsoft.Bcl.AsyncInterfaces.dll
Normal file
Binary file not shown.
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Microsoft.CodeAnalysis.CSharp.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Microsoft.CodeAnalysis.CSharp.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Microsoft.CodeAnalysis.Workspaces.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Microsoft.CodeAnalysis.Workspaces.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Microsoft.CodeAnalysis.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Microsoft.CodeAnalysis.dll
Normal file
Binary file not shown.
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Microsoft.EntityFrameworkCore.Design.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Microsoft.EntityFrameworkCore.Design.dll
Normal file
Binary file not shown.
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Microsoft.EntityFrameworkCore.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Microsoft.EntityFrameworkCore.dll
Normal file
Binary file not shown.
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Microsoft.Extensions.Caching.Memory.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Microsoft.Extensions.Caching.Memory.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Microsoft.Extensions.DependencyModel.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Microsoft.Extensions.DependencyModel.dll
Normal file
Binary file not shown.
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Microsoft.Extensions.Logging.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Microsoft.Extensions.Logging.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Microsoft.Extensions.Options.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Microsoft.Extensions.Options.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Microsoft.Extensions.Primitives.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Microsoft.Extensions.Primitives.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Mono.TextTemplating.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Mono.TextTemplating.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Npgsql.EntityFrameworkCore.PostgreSQL.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Npgsql.EntityFrameworkCore.PostgreSQL.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Npgsql.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Npgsql.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/RBush.dll
Normal file
BIN
Demo/bin/Debug/net8.0/RBush.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/SixLabors.Fonts.dll
Normal file
BIN
Demo/bin/Debug/net8.0/SixLabors.Fonts.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/System.CodeDom.dll
Normal file
BIN
Demo/bin/Debug/net8.0/System.CodeDom.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/System.Composition.AttributedModel.dll
Normal file
BIN
Demo/bin/Debug/net8.0/System.Composition.AttributedModel.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/System.Composition.Convention.dll
Normal file
BIN
Demo/bin/Debug/net8.0/System.Composition.Convention.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/System.Composition.Hosting.dll
Normal file
BIN
Demo/bin/Debug/net8.0/System.Composition.Hosting.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/System.Composition.Runtime.dll
Normal file
BIN
Demo/bin/Debug/net8.0/System.Composition.Runtime.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/System.Composition.TypedParts.dll
Normal file
BIN
Demo/bin/Debug/net8.0/System.Composition.TypedParts.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/System.IO.Packaging.dll
Normal file
BIN
Demo/bin/Debug/net8.0/System.IO.Packaging.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/System.IO.Pipelines.dll
Normal file
BIN
Demo/bin/Debug/net8.0/System.IO.Pipelines.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/cs/Microsoft.CodeAnalysis.resources.dll
Normal file
BIN
Demo/bin/Debug/net8.0/cs/Microsoft.CodeAnalysis.resources.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/de/Microsoft.CodeAnalysis.resources.dll
Normal file
BIN
Demo/bin/Debug/net8.0/de/Microsoft.CodeAnalysis.resources.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/es/Microsoft.CodeAnalysis.resources.dll
Normal file
BIN
Demo/bin/Debug/net8.0/es/Microsoft.CodeAnalysis.resources.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/fr/Microsoft.CodeAnalysis.resources.dll
Normal file
BIN
Demo/bin/Debug/net8.0/fr/Microsoft.CodeAnalysis.resources.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/it/Microsoft.CodeAnalysis.resources.dll
Normal file
BIN
Demo/bin/Debug/net8.0/it/Microsoft.CodeAnalysis.resources.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user