diff --git a/Presence.Api/Controllers/GroupController.cs b/Presence.Api/Controllers/GroupController.cs new file mode 100644 index 0000000..2902cdf --- /dev/null +++ b/Presence.Api/Controllers/GroupController.cs @@ -0,0 +1,36 @@ +using domain.Service; +using domain.UseCase; +using Microsoft.AspNetCore.Mvc; +using Presence.Api.Response; + +namespace Presence.Api.Controllers +{ + [ApiController] + [Route("api/[contrtoller]")] + public class GroupController: ControllerBase + { + private readonly IGroupUseCase _groupService; + + public GroupController(IGroupUseCase groupService) { + _groupService = groupService; + } + + [HttpGet("/group")] + public ActionResult GetAllGroups() { + + var result = _groupService + .GetGroupsWithStudents() + .Select(group => new GroupResponse { + Id = group.Id, + Name = group.Name, + Users = group.Users?.Select( + user => new UserResponse { + Guid = user.Guid, + Name = user.Name, + }).Take(10).ToList() + }).ToList(); + return Ok(result); + + } + } +} diff --git a/Presence.Api/Controllers/WeatherForecastController.cs b/Presence.Api/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..4ad6679 --- /dev/null +++ b/Presence.Api/Controllers/WeatherForecastController.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Mvc; + +namespace Presence.Api.Controllers +{ + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } + } +} diff --git a/Presence.Api/Extensions/ServiceCollectionsExtension.cs b/Presence.Api/Extensions/ServiceCollectionsExtension.cs new file mode 100644 index 0000000..94fd830 --- /dev/null +++ b/Presence.Api/Extensions/ServiceCollectionsExtension.cs @@ -0,0 +1,22 @@ +using data; +using data.Repository; +using domain.Service; +using domain.UseCase; +using Presence.Api.Controllers; + +namespace Presence.Api.Extensions +{ + public static class ServiceCollectionsExtension + { + public static void AddCommonServices(this IServiceCollection services) { + + services + .AddDbContext() + .AddScoped() + .AddScoped() + .AddScoped(); + + + } + } +} diff --git a/Presence.Api/Presence.Api.csproj b/Presence.Api/Presence.Api.csproj new file mode 100644 index 0000000..d89fa7f --- /dev/null +++ b/Presence.Api/Presence.Api.csproj @@ -0,0 +1,21 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + + + + + diff --git a/Presence.Api/Presence.Api.http b/Presence.Api/Presence.Api.http new file mode 100644 index 0000000..151d369 --- /dev/null +++ b/Presence.Api/Presence.Api.http @@ -0,0 +1,6 @@ +@Presence.Api_HostAddress = http://localhost:5137 + +GET {{Presence.Api_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/Presence.Api/Program.cs b/Presence.Api/Program.cs new file mode 100644 index 0000000..b063bcc --- /dev/null +++ b/Presence.Api/Program.cs @@ -0,0 +1,28 @@ +using Presence.Api.Extensions; + +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. +builder.Services.AddCommonServices(); +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/Presence.Api/Properties/launchSettings.json b/Presence.Api/Properties/launchSettings.json new file mode 100644 index 0000000..3ae2428 --- /dev/null +++ b/Presence.Api/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:59027", + "sslPort": 44338 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5137", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7100;http://localhost:5137", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/Presence.Api/Response/GroupResponse.cs b/Presence.Api/Response/GroupResponse.cs new file mode 100644 index 0000000..30ae626 --- /dev/null +++ b/Presence.Api/Response/GroupResponse.cs @@ -0,0 +1,10 @@ +namespace Presence.Api.Response +{ + public class GroupResponse + { + public int Id { get; set; } + public string Name { get; set; } + public IEnumerable? Users { get; set; } = null; + + } +} diff --git a/Presence.Api/Response/UserResponse.cs b/Presence.Api/Response/UserResponse.cs new file mode 100644 index 0000000..0fcf43d --- /dev/null +++ b/Presence.Api/Response/UserResponse.cs @@ -0,0 +1,9 @@ +namespace Presence.Api.Response +{ + public class UserResponse + { + public Guid Guid { get; set; } + public string Name { get; set; } + } +} + \ No newline at end of file diff --git a/Presence.Api/WeatherForecast.cs b/Presence.Api/WeatherForecast.cs new file mode 100644 index 0000000..86ff197 --- /dev/null +++ b/Presence.Api/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace Presence.Api +{ + public class WeatherForecast + { + public DateOnly Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} diff --git a/Presence.Api/appsettings.Development.json b/Presence.Api/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/Presence.Api/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/Presence.Api/appsettings.json b/Presence.Api/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/Presence.Api/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/Presence.Desktop/App.axaml b/Presence.Desktop/App.axaml new file mode 100644 index 0000000..eea6afa --- /dev/null +++ b/Presence.Desktop/App.axaml @@ -0,0 +1,15 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Presence.Desktop/App.axaml.cs b/Presence.Desktop/App.axaml.cs new file mode 100644 index 0000000..2640ca7 --- /dev/null +++ b/Presence.Desktop/App.axaml.cs @@ -0,0 +1,37 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Markup.Xaml; +using Microsoft.Extensions.DependencyInjection; +using Presence.Desktop.DI; +using Presence.Desktop.ViewModels; +using Presence.Desktop.Views; + +namespace Presence.Desktop +{ + public partial class App : Application + { + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + var serviceCollection = new ServiceCollection(); + serviceCollection.AddCommonService(); + var services = serviceCollection.BuildServiceProvider(); + var mainViewModel = services.GetRequiredService(); + + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + desktop.MainWindow = new MainWindow + { + DataContext = mainViewModel, + }; + } + + base.OnFrameworkInitializationCompleted(); + } + + } +} \ No newline at end of file diff --git a/Presence.Desktop/Assets/avalonia-logo.ico b/Presence.Desktop/Assets/avalonia-logo.ico new file mode 100644 index 0000000..da8d49f Binary files /dev/null and b/Presence.Desktop/Assets/avalonia-logo.ico differ diff --git a/Presence.Desktop/DI/ServiceColletionExtensions.cs b/Presence.Desktop/DI/ServiceColletionExtensions.cs new file mode 100644 index 0000000..340bc24 --- /dev/null +++ b/Presence.Desktop/DI/ServiceColletionExtensions.cs @@ -0,0 +1,26 @@ +using data; +using data.Repository; +using domain.Service; +using domain.UseCase; +using Microsoft.Extensions.DependencyInjection; +using Presence.Desktop.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace Presence.Desktop.DI +{ + public static class ServiceColletionExtensions + { + public static void AddCommonService(this IServiceCollection collection) { + collection + .AddDbContext() + .AddSingleton() + .AddTransient() + .AddTransient(); + } + } +} diff --git a/Presence.Desktop/Presence.Desktop.csproj b/Presence.Desktop/Presence.Desktop.csproj new file mode 100644 index 0000000..92a908c --- /dev/null +++ b/Presence.Desktop/Presence.Desktop.csproj @@ -0,0 +1,34 @@ + + + WinExe + net8.0 + enable + true + app.manifest + true + + + + + + + + + + + + + + + None + All + + + + + + + + + + diff --git a/Presence.Desktop/Program.cs b/Presence.Desktop/Program.cs new file mode 100644 index 0000000..9d4a474 --- /dev/null +++ b/Presence.Desktop/Program.cs @@ -0,0 +1,24 @@ +using Avalonia; +using Avalonia.ReactiveUI; +using System; + +namespace Presence.Desktop +{ + internal sealed class Program + { + // Initialization code. Don't use any Avalonia, third-party APIs or any + // SynchronizationContext-reliant code before AppMain is called: things aren't initialized + // yet and stuff might break. + [STAThread] + public static void Main(string[] args) => BuildAvaloniaApp() + .StartWithClassicDesktopLifetime(args); + + // Avalonia configuration, don't remove; also used by visual designer. + public static AppBuilder BuildAvaloniaApp() + => AppBuilder.Configure() + .UsePlatformDetect() + .WithInterFont() + .LogToTrace() + .UseReactiveUI(); + } +} diff --git a/Presence.Desktop/ViewLocator.cs b/Presence.Desktop/ViewLocator.cs new file mode 100644 index 0000000..74b8a57 --- /dev/null +++ b/Presence.Desktop/ViewLocator.cs @@ -0,0 +1,32 @@ +using Avalonia.Controls; +using Avalonia.Controls.Templates; +using Presence.Desktop.ViewModels; +using System; + +namespace Presence.Desktop +{ + public class ViewLocator : IDataTemplate + { + + public Control? Build(object? param) + { + if (param is null) + return null; + + var name = param.GetType().FullName!.Replace("ViewModel", "View", StringComparison.Ordinal); + var type = Type.GetType(name); + + if (type != null) + { + return (Control)Activator.CreateInstance(type)!; + } + + return new TextBlock { Text = "Not Found: " + name }; + } + + public bool Match(object? data) + { + return data is ViewModelBase; + } + } +} diff --git a/Presence.Desktop/ViewModels/MainWindowViewModel.cs b/Presence.Desktop/ViewModels/MainWindowViewModel.cs new file mode 100644 index 0000000..801aa69 --- /dev/null +++ b/Presence.Desktop/ViewModels/MainWindowViewModel.cs @@ -0,0 +1,13 @@ +using domain.UseCase; + +namespace Presence.Desktop.ViewModels +{ + public class MainWindowViewModel : ViewModelBase + { + private readonly IGroupUseCase _groupService; + public MainWindowViewModel(IGroupUseCase groupUseCase) { + _groupService = groupUseCase; + } + public string Greeting { get; } = "Welcome to Avalonia!"; + } +} diff --git a/Presence.Desktop/ViewModels/ViewModelBase.cs b/Presence.Desktop/ViewModels/ViewModelBase.cs new file mode 100644 index 0000000..66c82c5 --- /dev/null +++ b/Presence.Desktop/ViewModels/ViewModelBase.cs @@ -0,0 +1,8 @@ +using ReactiveUI; + +namespace Presence.Desktop.ViewModels +{ + public class ViewModelBase : ReactiveObject + { + } +} diff --git a/Presence.Desktop/Views/MainWindow.axaml b/Presence.Desktop/Views/MainWindow.axaml new file mode 100644 index 0000000..96fe971 --- /dev/null +++ b/Presence.Desktop/Views/MainWindow.axaml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/Presence.Desktop/Views/MainWindow.axaml.cs b/Presence.Desktop/Views/MainWindow.axaml.cs new file mode 100644 index 0000000..2619e70 --- /dev/null +++ b/Presence.Desktop/Views/MainWindow.axaml.cs @@ -0,0 +1,12 @@ +using Avalonia.Controls; + +namespace Presence.Desktop.Views +{ + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/Presence.Desktop/app.manifest b/Presence.Desktop/app.manifest new file mode 100644 index 0000000..9c877cb --- /dev/null +++ b/Presence.Desktop/app.manifest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/console_ui/GroupUI.cs b/console_ui/GroupUI.cs new file mode 100644 index 0000000..def82db --- /dev/null +++ b/console_ui/GroupUI.cs @@ -0,0 +1,40 @@ +using domain.Request; +using domain.Service; +using domain.UseCase; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace console_ui +{ + class GroupUI + { + private readonly IGroupUseCase _groupService; + public GroupUI(IGroupUseCase groupService) + { + _groupService = groupService; + } + + public void AddGroup() { + Console.WriteLine("Введите имя группы"); + _groupService.AddGroup(new AddGroupRequest { Name = Console.ReadLine() }); + } + public void AddGroupWithStudents() { + Console.WriteLine("Введите имя группы"); + AddGroupRequest addGroupRequest = new AddGroupRequest { Name = Console.ReadLine()}; + List addStudentRequests = new List() { + new AddStudentRequest{StudentName = "123" }, + new AddStudentRequest{StudentName = "312" }, + new AddStudentRequest{StudentName = "222" }, + new AddStudentRequest{StudentName = "444" }, + }; + AddGroupWithStudentsRequest addGroupWithStudents = new AddGroupWithStudentsRequest { + addGroupRequest = addGroupRequest, + AddStudentRequests = addStudentRequests + }; + _groupService.AddGroupWithSutdents(addGroupWithStudents); + } + } +} diff --git a/console_ui/Program.cs b/console_ui/Program.cs index 3751555..2248b8c 100644 --- a/console_ui/Program.cs +++ b/console_ui/Program.cs @@ -1,2 +1,31 @@ -// See https://aka.ms/new-console-template for more information -Console.WriteLine("Hello, World!"); +using console_ui; +using data; +using data.Repository; +using domain.Service; +using domain.UseCase; +using Microsoft.Extensions.DependencyInjection; + +void printAllGroups(IGroupRepository groupRepository) +{ + foreach (var item in groupRepository.getAllGroup()) + { + Console.WriteLine($"{item.Id} {item.Name}"); + } +} + +IServiceCollection serviceCollection = new ServiceCollection(); + +serviceCollection + .AddDbContext() + .AddSingleton() + .AddSingleton() + .AddSingleton(); + + +var serivceProvider = serviceCollection.BuildServiceProvider(); + +var groupUi = serivceProvider.GetService(); + +groupUi?.AddGroup(); + + diff --git a/data/RemoteDatabaseContext.cs b/data/RemoteDatabaseContext.cs index 1347e32..2e74c25 100644 --- a/data/RemoteDatabaseContext.cs +++ b/data/RemoteDatabaseContext.cs @@ -15,9 +15,9 @@ namespace data optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Password=123;Username=postgres;Database=presence"); } - DbSet groups { get;set;} + public DbSet groups { get;set;} - DbSet users { get;set;} + public DbSet users { get;set;} protected override void OnModelCreating(ModelBuilder modelBuilder) { diff --git a/data/Repository/IGroupRepository.cs b/data/Repository/IGroupRepository.cs new file mode 100644 index 0000000..b430e37 --- /dev/null +++ b/data/Repository/IGroupRepository.cs @@ -0,0 +1,17 @@ +using data.DAO; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace data.Repository +{ + public interface IGroupRepository + { + public IEnumerable getAllGroup(); + public bool addGroup(GroupDAO group); + + public bool addGroupWithStudents(GroupDAO groupDAO, IEnumerable userDAOs); + } +} diff --git a/data/Repository/SQLGroupRepository.cs b/data/Repository/SQLGroupRepository.cs new file mode 100644 index 0000000..a9eaffe --- /dev/null +++ b/data/Repository/SQLGroupRepository.cs @@ -0,0 +1,50 @@ +using data.DAO; +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace data.Repository +{ + public class SQLGroupRepository : IGroupRepository + { + private readonly RemoteDatabaseContext _dbContext; + public SQLGroupRepository(RemoteDatabaseContext remoteDatabaseContext) { + _dbContext = remoteDatabaseContext; + } + public bool addGroup(GroupDAO group) + { + _dbContext.groups.Add(group); + return _dbContext.SaveChanges() > 1; + } + + public bool addGroupWithStudents(GroupDAO groupDAO, IEnumerable userDAOs) + { + using var transaction = _dbContext.Database.BeginTransaction(); + try { + _dbContext.groups.Add(groupDAO); + _dbContext.SaveChanges(); + foreach (var item in userDAOs) + { + item.Group = groupDAO; + _dbContext.users.Add(item); + } + _dbContext.SaveChanges(); + transaction.Commit(); + return true; + } + catch (Exception ex) { + transaction.Rollback(); + + } + return false; + } + + public IEnumerable getAllGroup() + { + return _dbContext.groups.Include(group => group.Users).ToList(); + } + } +} diff --git a/domain/Class1.cs b/domain/Class1.cs deleted file mode 100644 index 21c3090..0000000 --- a/domain/Class1.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace domain; - -public class Class1 -{ - -} diff --git a/domain/Entity/GroupEntity.cs b/domain/Entity/GroupEntity.cs new file mode 100644 index 0000000..0751b78 --- /dev/null +++ b/domain/Entity/GroupEntity.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace domain.Entity +{ + public class GroupEntity + { + public int Id { get; set; } + public string Name { get; set; } + public IEnumerable? Users { get; set; } = null; + } +} diff --git a/domain/Entity/UserEntity.cs b/domain/Entity/UserEntity.cs new file mode 100644 index 0000000..a6c3e7e --- /dev/null +++ b/domain/Entity/UserEntity.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace domain.Entity +{ + public class UserEntity + { + public Guid Guid { get; set; } + public string Name { get; set; } + public GroupEntity Group { get; set; } + } +} diff --git a/domain/Request/AddGroupRequest.cs b/domain/Request/AddGroupRequest.cs new file mode 100644 index 0000000..b9c1b2a --- /dev/null +++ b/domain/Request/AddGroupRequest.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace domain.Request +{ + public class AddGroupRequest + { + public string Name { get; set; } + } +} diff --git a/domain/Request/AddGroupWithStudent.cs b/domain/Request/AddGroupWithStudent.cs new file mode 100644 index 0000000..34ab1a4 --- /dev/null +++ b/domain/Request/AddGroupWithStudent.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace domain.Request +{ + public class AddGroupWithStudentsRequest + { + public AddGroupRequest addGroupRequest { get; set; } + public IEnumerable AddStudentRequests { get; set; } + } +} diff --git a/domain/Request/AddStudentRequest.cs b/domain/Request/AddStudentRequest.cs new file mode 100644 index 0000000..e75c61a --- /dev/null +++ b/domain/Request/AddStudentRequest.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace domain.Request +{ + public class AddStudentRequest + { + public string StudentName { get; set; } + } +} diff --git a/domain/Service/GroupService.cs b/domain/Service/GroupService.cs new file mode 100644 index 0000000..3a456dc --- /dev/null +++ b/domain/Service/GroupService.cs @@ -0,0 +1,59 @@ +using data.DAO; +using data.Repository; +using domain.Entity; +using domain.Request; +using domain.UseCase; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace domain.Service +{ + public class GroupService : IGroupUseCase + { + private readonly IGroupRepository _groupRepository; + public GroupService(IGroupRepository groupRepository) + { + _groupRepository = groupRepository; + } + public void AddGroup(AddGroupRequest addGroupRequest) + { + _groupRepository.addGroup(new GroupDAO { Name = addGroupRequest.Name }); + } + + + + public void AddGroupWithSutdents(AddGroupWithStudentsRequest addGroupWithStudents) + { + GroupDAO groupDAO = new GroupDAO { Name = addGroupWithStudents.addGroupRequest.Name }; + List users = addGroupWithStudents + .AddStudentRequests + .Select(it => new UserDAO { Name = it.StudentName }) + .ToList(); + _groupRepository.addGroupWithStudents(groupDAO, users); + } + + public IEnumerable GetGroupsWithStudents() + { + return _groupRepository.getAllGroup().Select( + group => new GroupEntity + { + Id = group.Id, + Name = group.Name, + Users = group.Users.Select( + user => new UserEntity + { + Guid = user.Guid, + Name = user.Name, + Group = new GroupEntity + { + Id = group.Id, + Name = group.Name, + } + }).ToList() + }).ToList(); + } + } +} diff --git a/domain/UseCase/IGroupUseCase.cs b/domain/UseCase/IGroupUseCase.cs new file mode 100644 index 0000000..3c12149 --- /dev/null +++ b/domain/UseCase/IGroupUseCase.cs @@ -0,0 +1,17 @@ +using domain.Entity; +using domain.Request; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace domain.UseCase +{ + public interface IGroupUseCase + { + public IEnumerable GetGroupsWithStudents(); + public void AddGroup(AddGroupRequest addGroupRequest); + public void AddGroupWithSutdents(AddGroupWithStudentsRequest addGroupWithStudents); + } +} diff --git a/domain/domain.csproj b/domain/domain.csproj index 8d40d4a..efd3166 100644 --- a/domain/domain.csproj +++ b/domain/domain.csproj @@ -4,6 +4,10 @@ + + + + net8.0 enable diff --git a/presnce.sln b/presnce.sln index 5c98574..8ff12bc 100644 --- a/presnce.sln +++ b/presnce.sln @@ -3,31 +3,28 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "data", "data\data.csproj", "{FFE39EC0-DDC4-4670-A991-075ADF2B4C95}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "data", "data\data.csproj", "{FFE39EC0-DDC4-4670-A991-075ADF2B4C95}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "domain", "domain\domain.csproj", "{633650E7-0BAB-49D7-B72A-64A5D5A22E26}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ui", "ui\ui.csproj", "{2CDB8D72-14C6-47D8-9DA0-852E72FE1663}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ui", "ui\ui.csproj", "{2CDB8D72-14C6-47D8-9DA0-852E72FE1663}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "console_ui", "console_ui\console_ui.csproj", "{1DEBFFB8-8F9B-4E2D-881C-A65AE0A206C3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "console_ui", "console_ui\console_ui.csproj", "{1DEBFFB8-8F9B-4E2D-881C-A65AE0A206C3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "domain", "domain\domain.csproj", "{8B7BA538-FFE9-4A67-A48B-0ECC957B2315}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Presence.Desktop", "Presence.Desktop\Presence.Desktop.csproj", "{48DA7873-9A3C-458C-8D52-F9156A3E66A6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Presence.Api", "Presence.Api\Presence.Api.csproj", "{EC8CE801-1EEE-4AC1-808D-BF39A8C20ED9}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {FFE39EC0-DDC4-4670-A991-075ADF2B4C95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FFE39EC0-DDC4-4670-A991-075ADF2B4C95}.Debug|Any CPU.Build.0 = Debug|Any CPU {FFE39EC0-DDC4-4670-A991-075ADF2B4C95}.Release|Any CPU.ActiveCfg = Release|Any CPU {FFE39EC0-DDC4-4670-A991-075ADF2B4C95}.Release|Any CPU.Build.0 = Release|Any CPU - {633650E7-0BAB-49D7-B72A-64A5D5A22E26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {633650E7-0BAB-49D7-B72A-64A5D5A22E26}.Debug|Any CPU.Build.0 = Debug|Any CPU - {633650E7-0BAB-49D7-B72A-64A5D5A22E26}.Release|Any CPU.ActiveCfg = Release|Any CPU - {633650E7-0BAB-49D7-B72A-64A5D5A22E26}.Release|Any CPU.Build.0 = Release|Any CPU {2CDB8D72-14C6-47D8-9DA0-852E72FE1663}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2CDB8D72-14C6-47D8-9DA0-852E72FE1663}.Debug|Any CPU.Build.0 = Debug|Any CPU {2CDB8D72-14C6-47D8-9DA0-852E72FE1663}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -36,5 +33,23 @@ Global {1DEBFFB8-8F9B-4E2D-881C-A65AE0A206C3}.Debug|Any CPU.Build.0 = Debug|Any CPU {1DEBFFB8-8F9B-4E2D-881C-A65AE0A206C3}.Release|Any CPU.ActiveCfg = Release|Any CPU {1DEBFFB8-8F9B-4E2D-881C-A65AE0A206C3}.Release|Any CPU.Build.0 = Release|Any CPU + {8B7BA538-FFE9-4A67-A48B-0ECC957B2315}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8B7BA538-FFE9-4A67-A48B-0ECC957B2315}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8B7BA538-FFE9-4A67-A48B-0ECC957B2315}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8B7BA538-FFE9-4A67-A48B-0ECC957B2315}.Release|Any CPU.Build.0 = Release|Any CPU + {48DA7873-9A3C-458C-8D52-F9156A3E66A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {48DA7873-9A3C-458C-8D52-F9156A3E66A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {48DA7873-9A3C-458C-8D52-F9156A3E66A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {48DA7873-9A3C-458C-8D52-F9156A3E66A6}.Release|Any CPU.Build.0 = Release|Any CPU + {EC8CE801-1EEE-4AC1-808D-BF39A8C20ED9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EC8CE801-1EEE-4AC1-808D-BF39A8C20ED9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EC8CE801-1EEE-4AC1-808D-BF39A8C20ED9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EC8CE801-1EEE-4AC1-808D-BF39A8C20ED9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {013CA6C5-A281-4520-BCE1-70ACD7E0196A} EndGlobalSection EndGlobal