a little of debuging
This commit is contained in:
parent
7d03600cac
commit
427bb6d163
@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("console_ui")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5b98b0036758c0bfbfd050b258dbaf603f2669f2")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7d03600cac4088e592e3a84368946b3e313cc8b5")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("console_ui")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("console_ui")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
@ -1 +1 @@
|
||||
b49b12c1eb209457e0c1d0e3edaa7ba0ff70b6f92d0e9721fc4a71fd5a16073d
|
||||
6ad1ce5ea61b754a82503202c636b3fa3b325dace303f66d8b4958f60658bbb7
|
||||
|
Binary file not shown.
@ -12,7 +12,7 @@ using presence.data.RemoteData.RemoteDataBase;
|
||||
namespace data.Migrations
|
||||
{
|
||||
[DbContext(typeof(RemoteDataBaseContext))]
|
||||
[Migration("20241114213726_InitialCreate")]
|
||||
[Migration("20241119121248_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
/// <inheritdoc />
|
||||
@ -62,9 +62,6 @@ namespace data.Migrations
|
||||
b.Property<bool>("IsAttendence")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("UserGuid")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
@ -90,9 +87,6 @@ namespace data.Migrations
|
||||
b.Property<int>("GroupId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<Guid>("UserGuid")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("UserId");
|
||||
|
||||
b.HasIndex("GroupId");
|
@ -32,7 +32,6 @@ namespace data.Migrations
|
||||
UserId = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
FIO = table.Column<string>(type: "text", nullable: false),
|
||||
UserGuid = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
GroupId = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
@ -55,7 +54,6 @@ namespace data.Migrations
|
||||
Date = table.Column<DateOnly>(type: "date", nullable: false),
|
||||
ClassNumber = table.Column<int>(type: "integer", nullable: false),
|
||||
IsAttendence = table.Column<bool>(type: "boolean", nullable: false),
|
||||
UserGuid = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
UserId = table.Column<int>(type: "integer", nullable: false),
|
||||
GroupId = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
@ -59,9 +59,6 @@ namespace data.Migrations
|
||||
b.Property<bool>("IsAttendence")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("UserGuid")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
@ -87,9 +84,6 @@ namespace data.Migrations
|
||||
b.Property<int>("GroupId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<Guid>("UserGuid")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("UserId");
|
||||
|
||||
b.HasIndex("GroupId");
|
||||
|
@ -11,7 +11,6 @@ namespace presence.data.RemoteData.RemoteDataBase.DAO
|
||||
public DateOnly Date {get; set;}
|
||||
public int ClassNumber {get; set;}
|
||||
public bool IsAttendence {get; set;} = true;
|
||||
public Guid UserGuid {get; set;}
|
||||
public int UserId {get; set;}
|
||||
public UserDao User {get; set;}
|
||||
public int GroupId {get; set;}
|
||||
|
@ -21,13 +21,14 @@ namespace data.Repository
|
||||
public bool AddStudents(GroupDao group, List<string> students)
|
||||
{
|
||||
_remoteDataBaseContext.Groups.Add(group);
|
||||
_remoteDataBaseContext.SaveChanges();
|
||||
foreach (string student in students)
|
||||
{
|
||||
var user = new UserDao
|
||||
{
|
||||
FIO = student,
|
||||
GroupId = group.Id,
|
||||
Group = _remoteDataBaseContext.Groups.Where(x => x.Id == group.Id).FirstOrDefault()
|
||||
Group = _remoteDataBaseContext.Groups.Where(x => x.Id == group.Id).FirstOrDefault(),
|
||||
};
|
||||
_remoteDataBaseContext.Users.Add(user);
|
||||
}
|
||||
@ -35,21 +36,6 @@ namespace data.Repository
|
||||
return true;
|
||||
}
|
||||
|
||||
public void DeleteUserFromGroup(int userId, int groupId)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void DeleteGroup(int groupId)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void ClearPresence()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public IEnumerable<GroupDao> GetAllGroupsWithStudents()
|
||||
{
|
||||
return _remoteDataBaseContext.Groups.Select(x => new GroupDao
|
||||
|
Binary file not shown.
Binary file not shown.
@ -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+8ef372052b678424c7aa0641185bc80a86633fd3")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7d03600cac4088e592e3a84368946b3e313cc8b5")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("data")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("data")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
@ -1 +1 @@
|
||||
24a878335b95e62669ffd03f1fc8ae7961ca2aeb2b77b5a0cc8714c45febe0a6
|
||||
731b1d5c69b5572fabec0fbf95abad126efb155dcf8719a9eebf3ca961eb9311
|
||||
|
@ -1 +1 @@
|
||||
8eca5ecb6d779046df6e1bf2012302fb656c15233d139f1b56f144cbd823ea78
|
||||
a21506b9097c7cce01fc449026dd9bd6129fa7118e8947174bed36605e7fb801
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -37,6 +37,10 @@ namespace domain.UseCase
|
||||
|
||||
public UserResponse GetStudentInfo(int userId)
|
||||
{
|
||||
|
||||
var studentInfo = _adminRepository.GetStudentInfo(userId);
|
||||
if (studentInfo == null) return null;
|
||||
|
||||
UserResponse user= new UserResponse{
|
||||
Id = userId,
|
||||
FIO = _adminRepository.GetStudentInfo(userId).FIO,
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -13,7 +13,7 @@ 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+8ef372052b678424c7aa0641185bc80a86633fd3")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7d03600cac4088e592e3a84368946b3e313cc8b5")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("domain")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("domain")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
@ -1 +1 @@
|
||||
2be1454f305b332ed3dfd12d83b5bd32519cfeb34730e08d6bc1129099d63430
|
||||
0245376b560f5cb2e4a470a5144535facc90ed6189da3440a9addc1c5ff980f7
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -52,8 +52,19 @@ public class AdminController: ControllerBase
|
||||
}
|
||||
|
||||
[HttpGet("~/GetStudentInfo")]
|
||||
public ActionResult<UserResponse> GetStudentInfo([FromQuery] int userId)
|
||||
public ActionResult<UserResponse?> GetStudentInfo([FromQuery] int userId)
|
||||
{
|
||||
return _adminUseCase.GetStudentInfo(userId);
|
||||
if (userId <= 0)
|
||||
{
|
||||
return BadRequest("Некорректный идентификатор пользователя.");
|
||||
}
|
||||
|
||||
var studentInfo = _adminUseCase.GetStudentInfo(userId);
|
||||
if (studentInfo == null)
|
||||
{
|
||||
return NotFound("Студент не найден.");
|
||||
}
|
||||
|
||||
return Ok(studentInfo);
|
||||
}
|
||||
}
|
@ -2,6 +2,8 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using data.Repository;
|
||||
using domain.UseCase;
|
||||
using presence.data.Repository;
|
||||
using presence.domain.UseCase;
|
||||
|
||||
@ -36,9 +38,11 @@ namespace presence_api.ServiceExtensions
|
||||
.AddScoped<IUserRepository, SQLUserRepositoryImpl>()
|
||||
.AddScoped<IGroupRepository, SQLGroupRepositoryImpl>()
|
||||
.AddScoped<IPresenceRepository, SQLPresenceRepositoryImpl>()
|
||||
.AddScoped<IAdminRepository, AdminRepositoryImp>()
|
||||
.AddScoped<UserUseCase>()
|
||||
.AddScoped<GroupUseCase>()
|
||||
.AddScoped<PresenceUseCase>();
|
||||
.AddScoped<PresenceUseCase>()
|
||||
.AddScoped<AdminUseCase>();
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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+8ef372052b678424c7aa0641185bc80a86633fd3")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7d03600cac4088e592e3a84368946b3e313cc8b5")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("presence_api")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("presence_api")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
@ -1 +1 @@
|
||||
d71e0c1c402bb5f7999f22a103739c4472d550306d274e226a12195f88ae957b
|
||||
798a76f8e4e88ed691b932584ec55b49cd4295dad39d90d41b25f766a324819e
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("ui")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5b98b0036758c0bfbfd050b258dbaf603f2669f2")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7d03600cac4088e592e3a84368946b3e313cc8b5")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("ui")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("ui")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
@ -1 +1 @@
|
||||
aae41bb0bff218b6d819a8588d8a08693e0dd4ef657786bcb45f29aa7e6facd9
|
||||
d777f0bc903b8628182786e327f34a1218980e149c2424c39e1b85b062853bcd
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user