diff --git a/data/RemoteData/RemoteDataBase/DAO/User.cs b/data/RemoteData/RemoteDataBase/DAO/User.cs index 7f48693..c99a1c9 100755 --- a/data/RemoteData/RemoteDataBase/DAO/User.cs +++ b/data/RemoteData/RemoteDataBase/DAO/User.cs @@ -8,7 +8,6 @@ namespace presence.data.RemoteData.RemoteDataBase.DAO public class UserDao { public required string FIO {get; set; } - public Guid UserGuid { get; set; } public int UserId { get; set; } public required int GroupId {get; set;} public GroupDao Group {get; set;} diff --git a/data/bin/Debug/net8.0/data.dll b/data/bin/Debug/net8.0/data.dll index 2e18b67..ea4ce75 100644 Binary files a/data/bin/Debug/net8.0/data.dll and b/data/bin/Debug/net8.0/data.dll differ diff --git a/data/bin/Debug/net8.0/data.pdb b/data/bin/Debug/net8.0/data.pdb index 0864644..1baf166 100644 Binary files a/data/bin/Debug/net8.0/data.pdb and b/data/bin/Debug/net8.0/data.pdb differ diff --git a/data/obj/Debug/net8.0/data.AssemblyInfo.cs b/data/obj/Debug/net8.0/data.AssemblyInfo.cs index b21bbce..f77db53 100644 --- a/data/obj/Debug/net8.0/data.AssemblyInfo.cs +++ b/data/obj/Debug/net8.0/data.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("data")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4bdc422ce8c208f21ae34f3d9f1cc61a98a48a3c")] [assembly: System.Reflection.AssemblyProductAttribute("data")] [assembly: System.Reflection.AssemblyTitleAttribute("data")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/data/obj/Debug/net8.0/data.AssemblyInfoInputs.cache b/data/obj/Debug/net8.0/data.AssemblyInfoInputs.cache index 26b3a26..558245e 100644 --- a/data/obj/Debug/net8.0/data.AssemblyInfoInputs.cache +++ b/data/obj/Debug/net8.0/data.AssemblyInfoInputs.cache @@ -1 +1 @@ -6741393a5fe1cc20988265f6fd0e8bdd33ee4b9cc7b9e110a41e548fdd825a94 +f31721b3835e5b512a8546f19c261266dec727598bee64acedc7558f74f5abd0 diff --git a/data/obj/Debug/net8.0/data.dll b/data/obj/Debug/net8.0/data.dll index 2e18b67..ea4ce75 100644 Binary files a/data/obj/Debug/net8.0/data.dll and b/data/obj/Debug/net8.0/data.dll differ diff --git a/data/obj/Debug/net8.0/data.pdb b/data/obj/Debug/net8.0/data.pdb index 0864644..1baf166 100644 Binary files a/data/obj/Debug/net8.0/data.pdb and b/data/obj/Debug/net8.0/data.pdb differ diff --git a/data/obj/Debug/net8.0/ref/data.dll b/data/obj/Debug/net8.0/ref/data.dll index 2495a21..591bcb0 100644 Binary files a/data/obj/Debug/net8.0/ref/data.dll and b/data/obj/Debug/net8.0/ref/data.dll differ diff --git a/data/obj/Debug/net8.0/refint/data.dll b/data/obj/Debug/net8.0/refint/data.dll index 2495a21..591bcb0 100644 Binary files a/data/obj/Debug/net8.0/refint/data.dll and b/data/obj/Debug/net8.0/refint/data.dll differ diff --git a/domain/Models/ResponseModels/UserResponse.cs b/domain/Models/ResponseModels/UserResponse.cs index 4943a93..d6bc8f3 100644 --- a/domain/Models/ResponseModels/UserResponse.cs +++ b/domain/Models/ResponseModels/UserResponse.cs @@ -7,6 +7,8 @@ namespace domain.Models.ResponseModels { public class UserResponse { - + public required string FIO {get; set; } + public int Id {get; set;} + public required GroupResponse Group {get; set;} } } \ No newline at end of file diff --git a/domain/Models/User.cs b/domain/Models/User.cs index d0a24da..84b85b9 100755 --- a/domain/Models/User.cs +++ b/domain/Models/User.cs @@ -8,7 +8,7 @@ namespace presence.domain.Models { public class User{ public required string FIO {get; set; } - public Guid Guid {get; set;} + public int Id {get; set;} public required Group GroupId {get; set;} } } \ No newline at end of file diff --git a/domain/UseCase/PresenceUseCase.cs b/domain/UseCase/PresenceUseCase.cs index 7e800bf..ead220e 100755 --- a/domain/UseCase/PresenceUseCase.cs +++ b/domain/UseCase/PresenceUseCase.cs @@ -32,7 +32,7 @@ namespace presence.domain.UseCase .Where(x => users.Any(user => user.UserId == x.UserId)) .Select(presence => new Presence{ User = new User{ - Guid = presence.UserGuid, + Id = presence.UserId, GroupId = new Group{Id = groupId, Name = _groupRepository.GetGroupById(groupId).Name}, FIO = users.First(user => user.UserId == presence.UserId).FIO, }, @@ -50,7 +50,7 @@ namespace presence.domain.UseCase .Where(x => users.Any(user => user.UserId == x.UserId && x.Date == date)) .Select(presence => new Presence{ User = new User{ - Guid = presence.UserGuid, + Id = presence.UserId, GroupId = new Group{Id = groupId, Name = _groupRepository.GetGroupById(groupId).Name}, FIO = users.First(user => user.UserId == presence.UserId).FIO, }, @@ -74,7 +74,7 @@ namespace presence.domain.UseCase foreach (var user in users) { Presence pres = new Presence{ClassNumber = i, Date = date, - User = new User{Guid = user.UserGuid, + User = new User{Id = user.UserId, FIO = user.FIO, GroupId = new Group{Id = groupId, Name = _groupRepository.GetGroupById(groupId).Name}}}; diff --git a/domain/UseCase/UserUseCase.cs b/domain/UseCase/UserUseCase.cs index 172bdba..6e09932 100755 --- a/domain/UseCase/UserUseCase.cs +++ b/domain/UseCase/UserUseCase.cs @@ -1,3 +1,4 @@ +using domain.Models.ResponseModels; using presence.data.LocalData.Entity; using presence.data.RemoteData.RemoteDataBase.DAO; using presence.data.Repository; @@ -25,14 +26,14 @@ namespace presence.domain.UseCase private List GetAllGroups() => _repositoryGroupImpl.GetAllGroup() .Select(it => new Group { Id = it.Id, Name = it.Name}).ToList(); - public List GetAllUsers() => _repositoryUserImpl.GetAllUser() + public List GetAllUsers() => _repositoryUserImpl.GetAllUser() .Join(_repositoryGroupImpl.GetAllGroup(), user => user.GroupId, group => group.Id, (user, group) => - new User { FIO = user.FIO, - Guid = user.UserGuid, - GroupId = new Group{Id = group.Id, Name = group.Name}} + new UserResponse { FIO = user.FIO, + Id = user.UserId, + Group = new GroupResponse{Id = group.Id, Name = group.Name}} ).ToList(); @@ -48,7 +49,7 @@ namespace presence.domain.UseCase return new User { FIO = _repositoryUserImpl.GetUserById(userId).FIO, - Guid = _repositoryUserImpl.GetUserById(userId).UserGuid, + Id = _repositoryUserImpl.GetUserById(userId).UserId, GroupId = new Group { Id = _repositoryUserImpl.GetUserById(userId).GroupId, Name = _repositoryGroupImpl.GetGroupById(userId).Name } }; } diff --git a/domain/bin/Debug/net8.0/data.dll b/domain/bin/Debug/net8.0/data.dll index 2e18b67..ea4ce75 100644 Binary files a/domain/bin/Debug/net8.0/data.dll and b/domain/bin/Debug/net8.0/data.dll differ diff --git a/domain/bin/Debug/net8.0/data.pdb b/domain/bin/Debug/net8.0/data.pdb index 0864644..1baf166 100644 Binary files a/domain/bin/Debug/net8.0/data.pdb and b/domain/bin/Debug/net8.0/data.pdb differ diff --git a/domain/bin/Debug/net8.0/domain.dll b/domain/bin/Debug/net8.0/domain.dll index 80b5251..d2996b8 100644 Binary files a/domain/bin/Debug/net8.0/domain.dll and b/domain/bin/Debug/net8.0/domain.dll differ diff --git a/domain/bin/Debug/net8.0/domain.pdb b/domain/bin/Debug/net8.0/domain.pdb index a704173..12479d7 100644 Binary files a/domain/bin/Debug/net8.0/domain.pdb and b/domain/bin/Debug/net8.0/domain.pdb differ diff --git a/domain/obj/Debug/net8.0/domain.AssemblyInfo.cs b/domain/obj/Debug/net8.0/domain.AssemblyInfo.cs index 996ffe7..1310460 100644 --- a/domain/obj/Debug/net8.0/domain.AssemblyInfo.cs +++ b/domain/obj/Debug/net8.0/domain.AssemblyInfo.cs @@ -13,10 +13,10 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("domain")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4bdc422ce8c208f21ae34f3d9f1cc61a98a48a3c")] [assembly: System.Reflection.AssemblyProductAttribute("domain")] [assembly: System.Reflection.AssemblyTitleAttribute("domain")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] -// Generated by the MSBuild WriteCodeFragment class. +// Создано классом WriteCodeFragment MSBuild. diff --git a/domain/obj/Debug/net8.0/domain.AssemblyInfoInputs.cache b/domain/obj/Debug/net8.0/domain.AssemblyInfoInputs.cache index 191d5d4..64f7b25 100644 --- a/domain/obj/Debug/net8.0/domain.AssemblyInfoInputs.cache +++ b/domain/obj/Debug/net8.0/domain.AssemblyInfoInputs.cache @@ -1 +1 @@ -50afef9105125301dd1c05ea9fb1e5f605a3f79c6aca753bbf0156749546e4dd +a093ba0bf5d64479b23b12bae8cbb0ec7eeab3342133eaa4fe9b892857454774 diff --git a/domain/obj/Debug/net8.0/domain.csproj.AssemblyReference.cache b/domain/obj/Debug/net8.0/domain.csproj.AssemblyReference.cache index 0a00e53..9c16d17 100644 Binary files a/domain/obj/Debug/net8.0/domain.csproj.AssemblyReference.cache and b/domain/obj/Debug/net8.0/domain.csproj.AssemblyReference.cache differ diff --git a/domain/obj/Debug/net8.0/domain.csproj.CoreCompileInputs.cache b/domain/obj/Debug/net8.0/domain.csproj.CoreCompileInputs.cache index dc6359a..886305c 100644 --- a/domain/obj/Debug/net8.0/domain.csproj.CoreCompileInputs.cache +++ b/domain/obj/Debug/net8.0/domain.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -1b5f775f605de28ca409be1a9c13a6df3b2f5c3132bcb56f78dabcfec73e7ace +a9b24df1a9b756a44c00b9ae5110f480b03594c888c3659dbb3f3845f84a2ce4 diff --git a/domain/obj/Debug/net8.0/domain.dll b/domain/obj/Debug/net8.0/domain.dll index 80b5251..d2996b8 100644 Binary files a/domain/obj/Debug/net8.0/domain.dll and b/domain/obj/Debug/net8.0/domain.dll differ diff --git a/domain/obj/Debug/net8.0/domain.pdb b/domain/obj/Debug/net8.0/domain.pdb index a704173..12479d7 100644 Binary files a/domain/obj/Debug/net8.0/domain.pdb and b/domain/obj/Debug/net8.0/domain.pdb differ diff --git a/domain/obj/Debug/net8.0/ref/domain.dll b/domain/obj/Debug/net8.0/ref/domain.dll index 62638c8..3f5251a 100644 Binary files a/domain/obj/Debug/net8.0/ref/domain.dll and b/domain/obj/Debug/net8.0/ref/domain.dll differ diff --git a/domain/obj/Debug/net8.0/refint/domain.dll b/domain/obj/Debug/net8.0/refint/domain.dll index 62638c8..3f5251a 100644 Binary files a/domain/obj/Debug/net8.0/refint/domain.dll and b/domain/obj/Debug/net8.0/refint/domain.dll differ diff --git a/presence_api/Controllers/GroupController/GroupController.cs b/presence_api/Controllers/GroupController/GroupController.cs index 7978172..3e296f8 100644 --- a/presence_api/Controllers/GroupController/GroupController.cs +++ b/presence_api/Controllers/GroupController/GroupController.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; -using presence.data.RemoteData.RemoteDataBase.DAO; using presence.domain.Models; using presence.domain.UseCase; diff --git a/presence_api/Controllers/UserController/UserController.cs b/presence_api/Controllers/UserController/UserController.cs new file mode 100644 index 0000000..2d9963c --- /dev/null +++ b/presence_api/Controllers/UserController/UserController.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using presence.domain.Models; +using presence.domain.UseCase; + +namespace presence_api.Controllers.UserController; + +[ApiController] +[Route("api/[controller]")] +public class UserController: ControllerBase + { + private readonly UserUseCase _userUseCase; + + public UserController(UserUseCase userUseCase) + { + _userUseCase = userUseCase; + } + + [HttpGet] + public ActionResult> GetAllUser() + { + return Ok(_userUseCase.GetAllUsers()); + } + } \ No newline at end of file diff --git a/presence_api/Program.cs b/presence_api/Program.cs index 98a249a..87ab170 100644 --- a/presence_api/Program.cs +++ b/presence_api/Program.cs @@ -9,6 +9,7 @@ builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.ConfigureGroup(); +builder.Services.ConfigureUser(); var app = builder.Build(); diff --git a/presence_api/ServiceExtensions/ServiceExtensions.cs b/presence_api/ServiceExtensions/ServiceExtensions.cs index b67a22a..a53c769 100644 --- a/presence_api/ServiceExtensions/ServiceExtensions.cs +++ b/presence_api/ServiceExtensions/ServiceExtensions.cs @@ -15,5 +15,12 @@ namespace presence_api.ServiceExtensions .AddScoped() .AddScoped(); } + + public static void ConfigureUser(this IServiceCollection services) + { + services + .AddScoped() + .AddScoped(); + } } } \ No newline at end of file diff --git a/presence_api/bin/Debug/net8.0/data.dll b/presence_api/bin/Debug/net8.0/data.dll index 2e18b67..ea4ce75 100644 Binary files a/presence_api/bin/Debug/net8.0/data.dll and b/presence_api/bin/Debug/net8.0/data.dll differ diff --git a/presence_api/bin/Debug/net8.0/data.pdb b/presence_api/bin/Debug/net8.0/data.pdb index 0864644..1baf166 100644 Binary files a/presence_api/bin/Debug/net8.0/data.pdb and b/presence_api/bin/Debug/net8.0/data.pdb differ diff --git a/presence_api/bin/Debug/net8.0/domain.dll b/presence_api/bin/Debug/net8.0/domain.dll index 80b5251..d2996b8 100644 Binary files a/presence_api/bin/Debug/net8.0/domain.dll and b/presence_api/bin/Debug/net8.0/domain.dll differ diff --git a/presence_api/bin/Debug/net8.0/domain.pdb b/presence_api/bin/Debug/net8.0/domain.pdb index a704173..12479d7 100644 Binary files a/presence_api/bin/Debug/net8.0/domain.pdb and b/presence_api/bin/Debug/net8.0/domain.pdb differ diff --git a/presence_api/bin/Debug/net8.0/presence_api.dll b/presence_api/bin/Debug/net8.0/presence_api.dll index e092be6..09c561f 100644 Binary files a/presence_api/bin/Debug/net8.0/presence_api.dll and b/presence_api/bin/Debug/net8.0/presence_api.dll differ diff --git a/presence_api/bin/Debug/net8.0/presence_api.pdb b/presence_api/bin/Debug/net8.0/presence_api.pdb index 22b28bc..cf2fd1a 100644 Binary files a/presence_api/bin/Debug/net8.0/presence_api.pdb and b/presence_api/bin/Debug/net8.0/presence_api.pdb differ diff --git a/presence_api/obj/Debug/net8.0/presence_api.AssemblyInfo.cs b/presence_api/obj/Debug/net8.0/presence_api.AssemblyInfo.cs index 5adf725..b7394c0 100644 --- a/presence_api/obj/Debug/net8.0/presence_api.AssemblyInfo.cs +++ b/presence_api/obj/Debug/net8.0/presence_api.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("presence_api")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4bdc422ce8c208f21ae34f3d9f1cc61a98a48a3c")] [assembly: System.Reflection.AssemblyProductAttribute("presence_api")] [assembly: System.Reflection.AssemblyTitleAttribute("presence_api")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/presence_api/obj/Debug/net8.0/presence_api.AssemblyInfoInputs.cache b/presence_api/obj/Debug/net8.0/presence_api.AssemblyInfoInputs.cache index e992c49..497a24b 100644 --- a/presence_api/obj/Debug/net8.0/presence_api.AssemblyInfoInputs.cache +++ b/presence_api/obj/Debug/net8.0/presence_api.AssemblyInfoInputs.cache @@ -1 +1 @@ -1f62ae9533a734c74ec1f7ca641bc5e1622b77bd7c65110c6691cbb61403c74b +d346aa73c391eb0ef182af766d6332e886a863e9a1d1a8b4618c0041ef8db1f6 diff --git a/presence_api/obj/Debug/net8.0/presence_api.csproj.AssemblyReference.cache b/presence_api/obj/Debug/net8.0/presence_api.csproj.AssemblyReference.cache index f944b3b..5766755 100644 Binary files a/presence_api/obj/Debug/net8.0/presence_api.csproj.AssemblyReference.cache and b/presence_api/obj/Debug/net8.0/presence_api.csproj.AssemblyReference.cache differ diff --git a/presence_api/obj/Debug/net8.0/presence_api.csproj.CoreCompileInputs.cache b/presence_api/obj/Debug/net8.0/presence_api.csproj.CoreCompileInputs.cache index b3a1559..f60c0d8 100644 --- a/presence_api/obj/Debug/net8.0/presence_api.csproj.CoreCompileInputs.cache +++ b/presence_api/obj/Debug/net8.0/presence_api.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -4152a8bc96237f2bf065859d8e800c5b4c5df2743d3a00d9b60e07b905443a33 +6c572403d26fc1fb9b48c0e23b3616f42e8d5076d149940e6b0f5e2bd64da14b diff --git a/presence_api/obj/Debug/net8.0/presence_api.dll b/presence_api/obj/Debug/net8.0/presence_api.dll index e092be6..09c561f 100644 Binary files a/presence_api/obj/Debug/net8.0/presence_api.dll and b/presence_api/obj/Debug/net8.0/presence_api.dll differ diff --git a/presence_api/obj/Debug/net8.0/presence_api.pdb b/presence_api/obj/Debug/net8.0/presence_api.pdb index 22b28bc..cf2fd1a 100644 Binary files a/presence_api/obj/Debug/net8.0/presence_api.pdb and b/presence_api/obj/Debug/net8.0/presence_api.pdb differ diff --git a/presence_api/obj/Debug/net8.0/ref/presence_api.dll b/presence_api/obj/Debug/net8.0/ref/presence_api.dll index 155b429..d61729c 100644 Binary files a/presence_api/obj/Debug/net8.0/ref/presence_api.dll and b/presence_api/obj/Debug/net8.0/ref/presence_api.dll differ diff --git a/presence_api/obj/Debug/net8.0/refint/presence_api.dll b/presence_api/obj/Debug/net8.0/refint/presence_api.dll index 155b429..d61729c 100644 Binary files a/presence_api/obj/Debug/net8.0/refint/presence_api.dll and b/presence_api/obj/Debug/net8.0/refint/presence_api.dll differ diff --git a/ui/UserConsole.cs b/ui/UserConsole.cs index a4c4ec9..cfa8b8e 100755 --- a/ui/UserConsole.cs +++ b/ui/UserConsole.cs @@ -26,7 +26,7 @@ namespace presence.ui StringBuilder userOutput = new StringBuilder(); foreach (var user in _userUseCase.GetAllUsers()) { - userOutput.AppendLine($"{user.Guid}\t{user.FIO}\t{user.GroupId}"); + userOutput.AppendLine($"{user.Id}\t{user.FIO}\t{user.Group}"); } Console.WriteLine(userOutput); } @@ -34,7 +34,7 @@ namespace presence.ui public void GetUserById(int userId) { StringBuilder userOutput = new StringBuilder(); var user = _userUseCase.GetUserById(userId); - userOutput.AppendLine($"{user.Guid}\t{user.FIO}\t{user.GroupId}"); + userOutput.AppendLine($"{user.Id}\t{user.FIO}\t{user.GroupId}"); Console.WriteLine(userOutput); }