diff --git a/HwProj.Common/HwProj.Repositories.Net8/CrudRepository.cs b/HwProj.Common/HwProj.Repositories.Net8/CrudRepository.cs new file mode 100644 index 000000000..68f29cbc1 --- /dev/null +++ b/HwProj.Common/HwProj.Repositories.Net8/CrudRepository.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using Z.EntityFramework.Plus; + +namespace HwProj.Repositories.Net8; + +public class CrudRepository(DbContext context) : ICrudRepository + where TEntity : class, IEntity + where TKey : IEquatable +{ + protected DbContext Context => context; + + public async Task AddAsync(TEntity item) + { + await context.AddAsync(item); + await context.SaveChangesAsync(); + return item.Id; + } + + public async Task> AddRangeAsync(IEnumerable items) + { + items = items.ToList(); + await context.AddRangeAsync(items); + await context.SaveChangesAsync(); + return items.Select(item => item.Id).ToList(); + } + + public async Task DeleteAsync(TKey id) + { + await context.Set() + .Where(entity => entity.Id.Equals(id)) + .DeleteAsync() + ; + } + + public async Task UpdateAsync(TKey id, Expression> updateFactory) + { + await context.Set() + .Where(entity => entity.Id.Equals(id)) + .UpdateAsync(updateFactory) + ; + } + + public IQueryable GetAll() + { + return context.Set().AsNoTracking(); + } + + public IQueryable FindAll(Expression> predicate) + { + return context.Set().AsNoTracking().Where(predicate); + } + + public async Task GetAsync(TKey id) + { + return await context.FindAsync(id); + } + + public async Task FindAsync(Expression> predicate) + { + return await context.Set().AsNoTracking().FirstOrDefaultAsync(predicate); + } +} diff --git a/HwProj.Common/HwProj.Repositories.Net8/HwProj.Repositories.Net8.csproj b/HwProj.Common/HwProj.Repositories.Net8/HwProj.Repositories.Net8.csproj new file mode 100644 index 000000000..07c4efcd8 --- /dev/null +++ b/HwProj.Common/HwProj.Repositories.Net8/HwProj.Repositories.Net8.csproj @@ -0,0 +1,11 @@ + + + net8.0 + 12 + disable + + + + + + diff --git a/HwProj.Common/HwProj.Repositories.Net8/ICrudRepository.cs b/HwProj.Common/HwProj.Repositories.Net8/ICrudRepository.cs new file mode 100644 index 000000000..3323efcd3 --- /dev/null +++ b/HwProj.Common/HwProj.Repositories.Net8/ICrudRepository.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Threading.Tasks; + +namespace HwProj.Repositories.Net8; + +public interface ICrudRepository + where TEntity : IEntity + where TKey : IEquatable +{ + Task AddAsync(TEntity item); + Task> AddRangeAsync(IEnumerable items); + Task DeleteAsync(TKey id); + Task UpdateAsync(TKey id, Expression> updateFactory); + IQueryable GetAll(); + IQueryable FindAll(Expression> predicate); + Task GetAsync(TKey id); + Task FindAsync(Expression> predicate); +} diff --git a/HwProj.Common/HwProj.Repositories.Net8/IEntity.cs b/HwProj.Common/HwProj.Repositories.Net8/IEntity.cs new file mode 100644 index 000000000..875ce06bf --- /dev/null +++ b/HwProj.Common/HwProj.Repositories.Net8/IEntity.cs @@ -0,0 +1,9 @@ +using System; + +namespace HwProj.Repositories.Net8; + +public interface IEntity + where TKey : IEquatable +{ + TKey Id { get; set; } +} diff --git a/HwProj.CoursesService/HwProj.CoursesService.API/Dockerfile b/HwProj.CoursesService/HwProj.CoursesService.API/Dockerfile index bd5b9df12..418440968 100644 --- a/HwProj.CoursesService/HwProj.CoursesService.API/Dockerfile +++ b/HwProj.CoursesService/HwProj.CoursesService.API/Dockerfile @@ -11,6 +11,7 @@ COPY ["HwProj.Common/HwProj.Repositories/", "HwProj.Common/HwProj.Repositories/" COPY ["HwProj.AuthService/HwProj.AuthService.Client/", "HwProj.AuthService/HwProj.AuthService.Client/"] COPY ["HwProj.ContentService/HwProj.ContentService.Client/", "HwProj.ContentService/HwProj.ContentService.Client/"] COPY ["HwProj.Common/HwProj.HttpUtils/", "HwProj.Common/HwProj.HttpUtils/"] +COPY ["HwProj.NotificationsService/HwProj.NotificationService.Events/", "HwProj.NotificationsService/HwProj.NotificationService.Events/"] WORKDIR "/src/HwProj.CoursesService/HwProj.CoursesService.API" RUN dotnet publish "HwProj.CoursesService.API.csproj" -c Release -o /app/publish diff --git a/HwProj.CoursesService/HwProj.CoursesService.API/HwProj.CoursesService.API.csproj b/HwProj.CoursesService/HwProj.CoursesService.API/HwProj.CoursesService.API.csproj index 66413f409..b3e05e585 100644 --- a/HwProj.CoursesService/HwProj.CoursesService.API/HwProj.CoursesService.API.csproj +++ b/HwProj.CoursesService/HwProj.CoursesService.API/HwProj.CoursesService.API.csproj @@ -26,6 +26,7 @@ + \ No newline at end of file diff --git a/HwProj.CoursesService/HwProj.CoursesService.API/Services/CoursesService.cs b/HwProj.CoursesService/HwProj.CoursesService.API/Services/CoursesService.cs index 3395b290d..4c77eaf0f 100644 --- a/HwProj.CoursesService/HwProj.CoursesService.API/Services/CoursesService.cs +++ b/HwProj.CoursesService/HwProj.CoursesService.API/Services/CoursesService.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Transactions; using System.Threading.Tasks; -using HwProj.CoursesService.API.Events; using HwProj.CoursesService.API.Models; using HwProj.CoursesService.API.Repositories; using HwProj.CoursesService.API.Repositories.Groups; @@ -14,6 +13,7 @@ using HwProj.CoursesService.API.Domains; using HwProj.Models.CoursesService.DTO; using HwProj.Models.Roles; +using HwProj.NotificationService.Events.CoursesService; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Internal; diff --git a/HwProj.CoursesService/HwProj.CoursesService.API/Services/HomeworksService.cs b/HwProj.CoursesService/HwProj.CoursesService.API/Services/HomeworksService.cs index c29083b75..24b2bc843 100644 --- a/HwProj.CoursesService/HwProj.CoursesService.API/Services/HomeworksService.cs +++ b/HwProj.CoursesService/HwProj.CoursesService.API/Services/HomeworksService.cs @@ -4,10 +4,10 @@ using HwProj.CoursesService.API.Models; using HwProj.CoursesService.API.Repositories; using HwProj.EventBus.Client.Interfaces; -using HwProj.CoursesService.API.Events; using HwProj.CoursesService.API.Domains; using HwProj.Models; using HwProj.Models.CoursesService.ViewModels; +using HwProj.NotificationService.Events.CoursesService; namespace HwProj.CoursesService.API.Services { diff --git a/HwProj.CoursesService/HwProj.CoursesService.API/Services/TasksService.cs b/HwProj.CoursesService/HwProj.CoursesService.API/Services/TasksService.cs index e172d6eb4..d6bc08613 100644 --- a/HwProj.CoursesService/HwProj.CoursesService.API/Services/TasksService.cs +++ b/HwProj.CoursesService/HwProj.CoursesService.API/Services/TasksService.cs @@ -1,12 +1,12 @@ using System; using System.Threading.Tasks; -using HwProj.CoursesService.API.Events; using HwProj.CoursesService.API.Models; using HwProj.CoursesService.API.Repositories; using HwProj.EventBus.Client.Interfaces; using HwProj.CoursesService.API.Domains; using System.Linq; using HwProj.Models; +using HwProj.NotificationService.Events.CoursesService; namespace HwProj.CoursesService.API.Services { diff --git a/HwProj.CoursesService/HwProj.CoursesService.API/Events/LecturerAcceptToCourseEvent.cs b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/LecturerAcceptToCourseEvent.cs similarity index 82% rename from HwProj.CoursesService/HwProj.CoursesService.API/Events/LecturerAcceptToCourseEvent.cs rename to HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/LecturerAcceptToCourseEvent.cs index 163af8672..c4970513d 100644 --- a/HwProj.CoursesService/HwProj.CoursesService.API/Events/LecturerAcceptToCourseEvent.cs +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/LecturerAcceptToCourseEvent.cs @@ -1,6 +1,6 @@ using HwProj.EventBus.Client; -namespace HwProj.CoursesService.API.Events +namespace HwProj.NotificationService.Events.CoursesService { public class LecturerAcceptToCourseEvent : Event { diff --git a/HwProj.CoursesService/HwProj.CoursesService.API/Events/LecturerInvitedToCourseEvent.cs b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/LecturerInvitedToCourseEvent.cs similarity index 82% rename from HwProj.CoursesService/HwProj.CoursesService.API/Events/LecturerInvitedToCourseEvent.cs rename to HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/LecturerInvitedToCourseEvent.cs index 31be36694..81ace110d 100644 --- a/HwProj.CoursesService/HwProj.CoursesService.API/Events/LecturerInvitedToCourseEvent.cs +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/LecturerInvitedToCourseEvent.cs @@ -1,6 +1,6 @@ using HwProj.EventBus.Client; -namespace HwProj.CoursesService.API.Events +namespace HwProj.NotificationService.Events.CoursesService { public class LecturerInvitedToCourseEvent : Event { diff --git a/HwProj.CoursesService/HwProj.CoursesService.API/Events/LecturerRejectToCourseEvent.cs b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/LecturerRejectToCourseEvent.cs similarity index 82% rename from HwProj.CoursesService/HwProj.CoursesService.API/Events/LecturerRejectToCourseEvent.cs rename to HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/LecturerRejectToCourseEvent.cs index 9386a6cb1..65e6d05fd 100644 --- a/HwProj.CoursesService/HwProj.CoursesService.API/Events/LecturerRejectToCourseEvent.cs +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/LecturerRejectToCourseEvent.cs @@ -1,6 +1,6 @@ using HwProj.EventBus.Client; -namespace HwProj.CoursesService.API.Events +namespace HwProj.NotificationService.Events.CoursesService { public class LecturerRejectToCourseEvent : Event { diff --git a/HwProj.CoursesService/HwProj.CoursesService.API/Events/NewCourseMateEvent.cs b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/NewCourseMateEvent.cs similarity index 84% rename from HwProj.CoursesService/HwProj.CoursesService.API/Events/NewCourseMateEvent.cs rename to HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/NewCourseMateEvent.cs index 747917731..c96eef9c2 100644 --- a/HwProj.CoursesService/HwProj.CoursesService.API/Events/NewCourseMateEvent.cs +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/NewCourseMateEvent.cs @@ -1,6 +1,6 @@ using HwProj.EventBus.Client; -namespace HwProj.CoursesService.API.Events +namespace HwProj.NotificationService.Events.CoursesService { public class NewCourseMateEvent : Event { diff --git a/HwProj.CoursesService/HwProj.CoursesService.API/Events/NewHomeworkEvent.cs b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/NewHomeworkEvent.cs similarity index 92% rename from HwProj.CoursesService/HwProj.CoursesService.API/Events/NewHomeworkEvent.cs rename to HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/NewHomeworkEvent.cs index 8f6f7bc77..0384087cc 100644 --- a/HwProj.CoursesService/HwProj.CoursesService.API/Events/NewHomeworkEvent.cs +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/NewHomeworkEvent.cs @@ -1,7 +1,7 @@ using System; using HwProj.EventBus.Client; -namespace HwProj.CoursesService.API.Events +namespace HwProj.NotificationService.Events.CoursesService { public class NewHomeworkEvent : Event { diff --git a/HwProj.CoursesService/HwProj.CoursesService.API/Events/NewHomeworkTaskEvent.cs b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/NewHomeworkTaskEvent.cs similarity index 92% rename from HwProj.CoursesService/HwProj.CoursesService.API/Events/NewHomeworkTaskEvent.cs rename to HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/NewHomeworkTaskEvent.cs index 988a48afa..5ea6d0c9c 100644 --- a/HwProj.CoursesService/HwProj.CoursesService.API/Events/NewHomeworkTaskEvent.cs +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/NewHomeworkTaskEvent.cs @@ -1,7 +1,7 @@ using System; using HwProj.EventBus.Client; -namespace HwProj.CoursesService.API.Events +namespace HwProj.NotificationService.Events.CoursesService { public class NewHomeworkTaskEvent : Event { diff --git a/HwProj.CoursesService/HwProj.CoursesService.API/Events/UpdateHomeworkEvent.cs b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/UpdateHomeworkEvent.cs similarity index 90% rename from HwProj.CoursesService/HwProj.CoursesService.API/Events/UpdateHomeworkEvent.cs rename to HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/UpdateHomeworkEvent.cs index a88c68202..283a4a97f 100644 --- a/HwProj.CoursesService/HwProj.CoursesService.API/Events/UpdateHomeworkEvent.cs +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/UpdateHomeworkEvent.cs @@ -1,6 +1,6 @@ using HwProj.EventBus.Client; -namespace HwProj.CoursesService.API.Events +namespace HwProj.NotificationService.Events.CoursesService { public class UpdateHomeworkEvent : Event { diff --git a/HwProj.CoursesService/HwProj.CoursesService.API/Events/UpdateSolutionMaxRatingEvent.cs b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/UpdateSolutionMaxRatingEvent.cs similarity index 88% rename from HwProj.CoursesService/HwProj.CoursesService.API/Events/UpdateSolutionMaxRatingEvent.cs rename to HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/UpdateSolutionMaxRatingEvent.cs index 59f77ce4c..be5540200 100644 --- a/HwProj.CoursesService/HwProj.CoursesService.API/Events/UpdateSolutionMaxRatingEvent.cs +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/UpdateSolutionMaxRatingEvent.cs @@ -1,6 +1,6 @@ using HwProj.EventBus.Client; -namespace HwProj.CoursesService.API.Events +namespace HwProj.NotificationService.Events.CoursesService { public class UpdateSolutionMaxRatingEvent : Event { diff --git a/HwProj.CoursesService/HwProj.CoursesService.API/Events/UpdateTaskMaxRatingEvent.cs b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/UpdateTaskMaxRatingEvent.cs similarity index 91% rename from HwProj.CoursesService/HwProj.CoursesService.API/Events/UpdateTaskMaxRatingEvent.cs rename to HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/UpdateTaskMaxRatingEvent.cs index 055336fdb..1dc11db50 100644 --- a/HwProj.CoursesService/HwProj.CoursesService.API/Events/UpdateTaskMaxRatingEvent.cs +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/CoursesService/UpdateTaskMaxRatingEvent.cs @@ -1,6 +1,6 @@ using HwProj.EventBus.Client; -namespace HwProj.CoursesService.API.Events +namespace HwProj.NotificationService.Events.CoursesService { public class UpdateTaskMaxRatingEvent : Event { diff --git a/HwProj.NotificationsService/HwProj.NotificationService.Events/HwProj.NotificationService.Events.csproj b/HwProj.NotificationsService/HwProj.NotificationService.Events/HwProj.NotificationService.Events.csproj index e377245a3..d6ac9c7a6 100644 --- a/HwProj.NotificationsService/HwProj.NotificationService.Events/HwProj.NotificationService.Events.csproj +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/HwProj.NotificationService.Events.csproj @@ -5,6 +5,7 @@ + diff --git a/HwProj.SolutionsService/HwProj.SolutionsService.API/Events/RateEvent.cs b/HwProj.NotificationsService/HwProj.NotificationService.Events/SolutionsService/RateEvent.cs similarity index 87% rename from HwProj.SolutionsService/HwProj.SolutionsService.API/Events/RateEvent.cs rename to HwProj.NotificationsService/HwProj.NotificationService.Events/SolutionsService/RateEvent.cs index 9a1d88091..7070a418d 100644 --- a/HwProj.SolutionsService/HwProj.SolutionsService.API/Events/RateEvent.cs +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/SolutionsService/RateEvent.cs @@ -2,7 +2,7 @@ using HwProj.Models.CoursesService.ViewModels; using HwProj.Models.SolutionsService; -namespace HwProj.SolutionsService.API.Events +namespace HwProj.NotificationService.Events.SolutionsService { public class RateEvent : Event { diff --git a/HwProj.SolutionsService/HwProj.SolutionsService.API/Events/StudentPassTaskEvent.cs b/HwProj.NotificationsService/HwProj.NotificationService.Events/SolutionsService/StudentPassTaskEvent.cs similarity index 91% rename from HwProj.SolutionsService/HwProj.SolutionsService.API/Events/StudentPassTaskEvent.cs rename to HwProj.NotificationsService/HwProj.NotificationService.Events/SolutionsService/StudentPassTaskEvent.cs index e9798b28d..32e61b916 100644 --- a/HwProj.SolutionsService/HwProj.SolutionsService.API/Events/StudentPassTaskEvent.cs +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/SolutionsService/StudentPassTaskEvent.cs @@ -3,7 +3,7 @@ using HwProj.Models.CoursesService.ViewModels; using HwProj.Models.SolutionsService; -namespace HwProj.SolutionsService.API.Events +namespace HwProj.NotificationService.Events.SolutionsService { public class StudentPassTaskEvent : Event { diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/AutomapperProfile.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/AutomapperProfile.cs index 0395763ee..156acbbfd 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/AutomapperProfile.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/AutomapperProfile.cs @@ -1,5 +1,6 @@ using AutoMapper; using HwProj.Models.NotificationsService; +using HwProj.NotificationsService.API.Models; namespace HwProj.NotificationsService.API { diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/Controllers/NotificationSettingsController.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/Controllers/NotificationSettingsController.cs index 39191817b..adab446f8 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/Controllers/NotificationSettingsController.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/Controllers/NotificationSettingsController.cs @@ -1,6 +1,5 @@ using System.Threading.Tasks; using HwProj.Models.NotificationsService; -using HwProj.NotificationsService.API.Repositories; using HwProj.NotificationsService.API.Services; using Microsoft.AspNetCore.Mvc; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/Dockerfile b/HwProj.NotificationsService/HwProj.NotificationsService.API/Dockerfile index 60c608e06..72caa8fe9 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/Dockerfile +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/Dockerfile @@ -1,15 +1,15 @@ -FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY ["Directory.Build.props", "Directory.Build.props"] COPY ["HwProj.NotificationsService/HwProj.NotificationsService.API/", "HwProj.NotificationsService/HwProj.NotificationsService.API/"] COPY ["HwProj.NotificationsService/HwProj.NotificationService.Events/", "HwProj.NotificationsService/HwProj.NotificationService.Events/"] -COPY ["HwProj.Common/HwProj.Utils/", "HwProj.Common/HwProj.Utils/"] +COPY ["HwProj.Common/HwProj.Common.Net8/", "HwProj.Common/HwProj.Common.Net8/"] COPY ["HwProj.EventBus/HwProj.EventBus.Client/", "HwProj.EventBus/HwProj.EventBus.Client/"] COPY ["HwProj.Common/HwProj.Models/", "HwProj.Common/HwProj.Models/"] COPY ["HwProj.Common/HwProj.Repositories/", "HwProj.Common/HwProj.Repositories/"] -COPY ["HwProj.SolutionsService/HwProj.SolutionsService.API/", "HwProj.SolutionsService/HwProj.SolutionsService.API/"] +COPY ["HwProj.Common/HwProj.Repositories.Net8/", "HwProj.Common/HwProj.Repositories.Net8/"] COPY ["HwProj.SolutionsService/HwProj.SolutionsService.Client/", "HwProj.SolutionsService/HwProj.SolutionsService.Client/"] COPY ["HwProj.Common/HwProj.Exceptions/", "HwProj.Common/HwProj.Exceptions/"] COPY ["HwProj.Common/HwProj.HttpUtils/", "HwProj.Common/HwProj.HttpUtils/"] @@ -22,7 +22,7 @@ COPY ["HwProj.CoursesService/HwProj.CoursesService.API/", "HwProj.CoursesService WORKDIR "/src/HwProj.NotificationsService/HwProj.NotificationsService.API" RUN dotnet publish "HwProj.NotificationsService.API.csproj" -c Release -o /app/publish -FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS final +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final WORKDIR /app COPY --from=build /app/publish . diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/InviteLecturerEventHandler.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/InviteLecturerEventHandler.cs index c65be2085..93eda1db6 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/InviteLecturerEventHandler.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/InviteLecturerEventHandler.cs @@ -1,8 +1,6 @@ using System; using System.Threading.Tasks; -using HwProj.AuthService.Client; using HwProj.EventBus.Client.Interfaces; -using HwProj.Models.NotificationsService; using HwProj.NotificationService.Events.AuthService; using HwProj.NotificationsService.API.Models; using HwProj.NotificationsService.API.Repositories; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/LecturerAcceptToCourseEventHandler.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/LecturerAcceptToCourseEventHandler.cs index 6bf7ad74e..5dbe4875a 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/LecturerAcceptToCourseEventHandler.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/LecturerAcceptToCourseEventHandler.cs @@ -1,9 +1,9 @@ using System; using System.Threading.Tasks; using HwProj.AuthService.Client; -using HwProj.CoursesService.API.Events; using HwProj.EventBus.Client.Interfaces; -using HwProj.Models.NotificationsService; +using HwProj.NotificationService.Events.CoursesService; +using HwProj.NotificationsService.API.Models; using HwProj.NotificationsService.API.Repositories; using HwProj.NotificationsService.API.Services; using Microsoft.Extensions.Configuration; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/LecturerInvitedToCourseEventHandler.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/LecturerInvitedToCourseEventHandler.cs index 12a89627f..db5fc6cc4 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/LecturerInvitedToCourseEventHandler.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/LecturerInvitedToCourseEventHandler.cs @@ -1,8 +1,7 @@ using System; using System.Threading.Tasks; -using HwProj.CoursesService.API.Events; using HwProj.EventBus.Client.Interfaces; -using HwProj.Models.NotificationsService; +using HwProj.NotificationService.Events.CoursesService; using HwProj.NotificationsService.API.Models; using HwProj.NotificationsService.API.Repositories; using HwProj.NotificationsService.API.Services; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/LecturerRejectToCourseEventHandler.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/LecturerRejectToCourseEventHandler.cs index 00e02cdf1..e0eaa682e 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/LecturerRejectToCourseEventHandler.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/LecturerRejectToCourseEventHandler.cs @@ -1,9 +1,9 @@ using System; using System.Threading.Tasks; using HwProj.AuthService.Client; -using HwProj.CoursesService.API.Events; using HwProj.EventBus.Client.Interfaces; -using HwProj.Models.NotificationsService; +using HwProj.NotificationService.Events.CoursesService; +using HwProj.NotificationsService.API.Models; using HwProj.NotificationsService.API.Repositories; using HwProj.NotificationsService.API.Services; using Microsoft.Extensions.Configuration; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/NewCourseMateHandler.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/NewCourseMateHandler.cs index eab810b0f..346c15a72 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/NewCourseMateHandler.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/NewCourseMateHandler.cs @@ -1,9 +1,8 @@ using System; using System.Threading.Tasks; using HwProj.AuthService.Client; -using HwProj.CoursesService.API.Events; using HwProj.EventBus.Client.Interfaces; -using HwProj.Models.NotificationsService; +using HwProj.NotificationService.Events.CoursesService; using HwProj.NotificationsService.API.Models; using HwProj.NotificationsService.API.Repositories; using HwProj.NotificationsService.API.Services; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/NewHomeworkEventHandler.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/NewHomeworkEventHandler.cs index dd7279356..ff67ca7d8 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/NewHomeworkEventHandler.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/NewHomeworkEventHandler.cs @@ -2,9 +2,9 @@ using System.Threading.Tasks; using HwProj.AuthService.Client; using HwProj.EventBus.Client.Interfaces; -using HwProj.Models.NotificationsService; +using HwProj.NotificationService.Events.CoursesService; +using HwProj.NotificationsService.API.Models; using HwProj.NotificationsService.API.Repositories; -using HwProj.CoursesService.API.Events; using HwProj.NotificationsService.API.Services; using Microsoft.Extensions.Configuration; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/NewHomeworkTaskEventHandler.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/NewHomeworkTaskEventHandler.cs index 7a157b48a..3a1a5b838 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/NewHomeworkTaskEventHandler.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/NewHomeworkTaskEventHandler.cs @@ -2,9 +2,9 @@ using System.Threading.Tasks; using HwProj.AuthService.Client; using HwProj.EventBus.Client.Interfaces; -using HwProj.Models.NotificationsService; +using HwProj.NotificationService.Events.CoursesService; +using HwProj.NotificationsService.API.Models; using HwProj.NotificationsService.API.Repositories; -using HwProj.CoursesService.API.Events; using HwProj.NotificationsService.API.Services; using Microsoft.Extensions.Configuration; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/PasswordRecoveryEventHandler.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/PasswordRecoveryEventHandler.cs index d6eb234f2..2fecadac9 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/PasswordRecoveryEventHandler.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/PasswordRecoveryEventHandler.cs @@ -2,9 +2,8 @@ using System.Threading.Tasks; using System.Web; using HwProj.EventBus.Client.Interfaces; -using HwProj.Models; -using HwProj.Models.NotificationsService; using HwProj.NotificationService.Events.AuthService; +using HwProj.NotificationsService.API.Models; using HwProj.NotificationsService.API.Repositories; using HwProj.NotificationsService.API.Services; using Microsoft.AspNetCore.Hosting; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/RateEventHandler.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/RateEventHandler.cs index d473b5cf2..4f64911ea 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/RateEventHandler.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/RateEventHandler.cs @@ -2,10 +2,10 @@ using System.Threading.Tasks; using HwProj.AuthService.Client; using HwProj.EventBus.Client.Interfaces; -using HwProj.Models.NotificationsService; +using HwProj.NotificationService.Events.SolutionsService; +using HwProj.NotificationsService.API.Models; using HwProj.NotificationsService.API.Repositories; using HwProj.NotificationsService.API.Services; -using HwProj.SolutionsService.API.Events; using Microsoft.Extensions.Configuration; namespace HwProj.NotificationsService.API.EventHandlers diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/RegisterEventHandler.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/RegisterEventHandler.cs index e3c58aeb5..322156d59 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/RegisterEventHandler.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/RegisterEventHandler.cs @@ -2,8 +2,8 @@ using System.Threading.Tasks; using System.Web; using HwProj.EventBus.Client.Interfaces; -using HwProj.Models.NotificationsService; using HwProj.NotificationService.Events.AuthService; +using HwProj.NotificationsService.API.Models; using HwProj.NotificationsService.API.Repositories; using HwProj.NotificationsService.API.Services; using Microsoft.AspNetCore.Hosting; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/StudentPassTaskEventHandler.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/StudentPassTaskEventHandler.cs index 01e610012..44fa6d736 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/StudentPassTaskEventHandler.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/StudentPassTaskEventHandler.cs @@ -1,11 +1,9 @@ using System.Threading.Tasks; using HwProj.AuthService.Client; using HwProj.EventBus.Client.Interfaces; -using HwProj.Models.NotificationsService; +using HwProj.NotificationService.Events.SolutionsService; using HwProj.NotificationsService.API.Models; -using HwProj.NotificationsService.API.Repositories; using HwProj.NotificationsService.API.Services; -using HwProj.SolutionsService.API.Events; using Microsoft.Extensions.Configuration; namespace HwProj.NotificationsService.API.EventHandlers diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/UpdateHomeworkEventHandler.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/UpdateHomeworkEventHandler.cs index 06f98170a..e0432c7b0 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/UpdateHomeworkEventHandler.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/UpdateHomeworkEventHandler.cs @@ -2,9 +2,9 @@ using System.Threading.Tasks; using HwProj.AuthService.Client; using HwProj.EventBus.Client.Interfaces; -using HwProj.Models.NotificationsService; +using HwProj.NotificationService.Events.CoursesService; +using HwProj.NotificationsService.API.Models; using HwProj.NotificationsService.API.Repositories; -using HwProj.CoursesService.API.Events; using HwProj.NotificationsService.API.Services; using Microsoft.Extensions.Configuration; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/UpdateTaskMaxRatingEventHandler.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/UpdateTaskMaxRatingEventHandler.cs index 2a6963f20..712c82f08 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/UpdateTaskMaxRatingEventHandler.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/UpdateTaskMaxRatingEventHandler.cs @@ -3,10 +3,10 @@ using AutoMapper; using HwProj.AuthService.Client; using HwProj.EventBus.Client.Interfaces; -using HwProj.Models.NotificationsService; using HwProj.NotificationsService.API.Repositories; -using HwProj.CoursesService.API.Events; using HwProj.Models.AuthService.DTO; +using HwProj.NotificationService.Events.CoursesService; +using HwProj.NotificationsService.API.Models; using HwProj.NotificationsService.API.Services; using Microsoft.Extensions.Configuration; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/HwProj.NotificationsService.API.csproj b/HwProj.NotificationsService/HwProj.NotificationsService.API/HwProj.NotificationsService.API.csproj index ccc08d04b..f1ac03115 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/HwProj.NotificationsService.API.csproj +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/HwProj.NotificationsService.API.csproj @@ -1,33 +1,24 @@  - netcoreapp2.2 + net8.0 ..\..\docker-compose.dcproj Linux ..\.. $(CSharpLanguageVersion) - $(NullableReferenceTypes) + disable - - - - - - - - - - + + + - - - - + + diff --git a/HwProj.Common/HwProj.Models/NotificationsService/Notification.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/Models/Notification.cs similarity index 86% rename from HwProj.Common/HwProj.Models/NotificationsService/Notification.cs rename to HwProj.NotificationsService/HwProj.NotificationsService.API/Models/Notification.cs index 61d20235d..c2c23d3d7 100644 --- a/HwProj.Common/HwProj.Models/NotificationsService/Notification.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/Models/Notification.cs @@ -1,8 +1,8 @@ using System; using System.ComponentModel.DataAnnotations; -using HwProj.Repositories; +using HwProj.Repositories.Net8; -namespace HwProj.Models.NotificationsService +namespace HwProj.NotificationsService.API.Models { public class Notification : IEntity { diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/Models/NotificationCategoryState.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/Models/NotificationCategoryState.cs new file mode 100644 index 000000000..be3411fa4 --- /dev/null +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/Models/NotificationCategoryState.cs @@ -0,0 +1,10 @@ +namespace HwProj.NotificationsService.API.Models +{ + public enum CategoryState + { + None, + Profile, + Courses, + Homeworks + } +} \ No newline at end of file diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/Models/NotificationsContext.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/Models/NotificationsContext.cs index d5ae11961..d199b7899 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/Models/NotificationsContext.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/Models/NotificationsContext.cs @@ -1,5 +1,4 @@ -using HwProj.Models.NotificationsService; -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; namespace HwProj.NotificationsService.API.Models { diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/Repositories/INotificationsRepository.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/Repositories/INotificationsRepository.cs index 8742cccc0..cec3973f6 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/Repositories/INotificationsRepository.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/Repositories/INotificationsRepository.cs @@ -1,8 +1,8 @@ using System; using System.Linq.Expressions; using System.Threading.Tasks; -using HwProj.Models.NotificationsService; -using HwProj.Repositories; +using HwProj.NotificationsService.API.Models; +using HwProj.Repositories.Net8; namespace HwProj.NotificationsService.API.Repositories { diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/Repositories/NotificationsRepository.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/Repositories/NotificationsRepository.cs index 701cff308..fee37b6b7 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/Repositories/NotificationsRepository.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/Repositories/NotificationsRepository.cs @@ -2,9 +2,8 @@ using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; -using HwProj.Models.NotificationsService; using HwProj.NotificationsService.API.Models; -using HwProj.Repositories; +using HwProj.Repositories.Net8; using Microsoft.EntityFrameworkCore; using Z.EntityFramework.Plus; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/Services/EmailService.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/Services/EmailService.cs index ee3a38fb3..f36f0d35e 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/Services/EmailService.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/Services/EmailService.cs @@ -1,7 +1,7 @@ using System; using System.Threading.Tasks; using Autofac.Core; -using HwProj.Models.NotificationsService; +using HwProj.NotificationsService.API.Models; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using MimeKit; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/Services/IEmailService.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/Services/IEmailService.cs index b2dcbdc86..37568aabe 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/Services/IEmailService.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/Services/IEmailService.cs @@ -1,5 +1,5 @@ -using HwProj.Models.NotificationsService; -using System.Threading.Tasks; +using System.Threading.Tasks; +using HwProj.NotificationsService.API.Models; namespace HwProj.NotificationsService.API.Services { diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/Startup.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/Startup.cs index d797a89f9..f15b72ff4 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/Startup.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/Startup.cs @@ -1,20 +1,21 @@ -using HwProj.AuthService.Client; +using System.Text.Json.Serialization; +using HwProj.AuthService.Client; +using HwProj.Common.Net8; using HwProj.EventBus.Client.Interfaces; using HwProj.NotificationsService.API.EventHandlers; using HwProj.NotificationsService.API.Models; using HwProj.NotificationsService.API.Repositories; using HwProj.NotificationsService.API.Services; -using HwProj.Utils.Configuration; using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using HwProj.CoursesService.API.Events; using HwProj.EventBus.Client; using HwProj.NotificationService.Events.AuthService; -using HwProj.SolutionsService.API.Events; -using UpdateTaskMaxRatingEvent = HwProj.CoursesService.API.Events.UpdateTaskMaxRatingEvent; +using HwProj.NotificationService.Events.CoursesService; +using HwProj.NotificationService.Events.SolutionsService; +using Microsoft.Extensions.Hosting; +using UpdateTaskMaxRatingEvent = HwProj.NotificationService.Events.CoursesService.UpdateTaskMaxRatingEvent; namespace HwProj.NotificationsService.API { @@ -52,10 +53,16 @@ public void ConfigureServices(IServiceCollection services) services.AddHttpClient(); services.AddAuthServiceClient(); - services.ConfigureHwProjServices("Notifications API"); + services + .AddCors() + .AddControllers() + .AddJsonOptions(options => + options.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles); + + services.AddAutoMapper(x => x.AddProfile()); } - public void Configure(IApplicationBuilder app, IHostingEnvironment env, IEventBus eventBus, + public void Configure(IApplicationBuilder app, IHostEnvironment env, IEventBus eventBus, NotificationsContext context) { using (var eventBustSubscriber = eventBus.CreateSubscriber()) @@ -75,7 +82,19 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, IEventBu eventBustSubscriber.Subscribe(); } - app.ConfigureHwProj(env, "Notifications API", context); + if (env.IsDevelopment()) app.UseDeveloperExceptionPage(); + else app.UseHsts(); + + app.UseRouting(); + app.UseCors(x => x + .AllowAnyMethod() + .AllowAnyHeader() + .SetIsOriginAllowed(_ => true) + .AllowCredentials()); + + app.UseEndpoints(x => x.MapControllers()); + + app.UseDatabase(env, context); } } } diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/appsettings.json b/HwProj.NotificationsService/HwProj.NotificationsService.API/appsettings.json index 5136b7f60..f6fe217f3 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/appsettings.json +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "DefaultConnectionForWindows": "Server=(localdb)\\mssqllocaldb;Database=NotificationsServiceDB;Trusted_Connection=True;MultipleActiveResultSets=True", + "DefaultConnectionForWindows": "Server=(localdb)\\mssqllocaldb;Database=NotificationsServiceDB;Trusted_Connection=True;TrustServerCertificate=true;MultipleActiveResultSets=True", "DefaultConnectionForLinux": "Server=localhost,1433;Database=NotificationsServiceDB;User ID=SA;Password=password_1234;" }, "Logging": { diff --git a/HwProj.SolutionsService/HwProj.SolutionsService.API/Dockerfile b/HwProj.SolutionsService/HwProj.SolutionsService.API/Dockerfile index e38a7af75..3a1c33e91 100644 --- a/HwProj.SolutionsService/HwProj.SolutionsService.API/Dockerfile +++ b/HwProj.SolutionsService/HwProj.SolutionsService.API/Dockerfile @@ -13,6 +13,7 @@ COPY ["HwProj.Common/HwProj.Utils/", "HwProj.Common/HwProj.Utils/"] COPY ["HwProj.EventBus/HwProj.EventBus.Client/", "HwProj.EventBus/HwProj.EventBus.Client/"] COPY ["HwProj.CoursesService/HwProj.CoursesService.Client/", "HwProj.CoursesService/HwProj.CoursesService.Client/"] COPY ["HwProj.AuthService/HwProj.AuthService.Client/", "HwProj.AuthService/HwProj.AuthService.Client/"] +COPY ["HwProj.NotificationsService/HwProj.NotificationService.Events/", "HwProj.NotificationsService/HwProj.NotificationService.Events/"] WORKDIR "/src/HwProj.SolutionsService/HwProj.SolutionsService.API" RUN dotnet publish "HwProj.SolutionsService.API.csproj" -c Release -o /app/publish diff --git a/HwProj.SolutionsService/HwProj.SolutionsService.API/HwProj.SolutionsService.API.csproj b/HwProj.SolutionsService/HwProj.SolutionsService.API/HwProj.SolutionsService.API.csproj index 3df1d2562..482ecfca2 100644 --- a/HwProj.SolutionsService/HwProj.SolutionsService.API/HwProj.SolutionsService.API.csproj +++ b/HwProj.SolutionsService/HwProj.SolutionsService.API/HwProj.SolutionsService.API.csproj @@ -31,6 +31,7 @@ + \ No newline at end of file diff --git a/HwProj.SolutionsService/HwProj.SolutionsService.API/Services/SolutionsService.cs b/HwProj.SolutionsService/HwProj.SolutionsService.API/Services/SolutionsService.cs index 4c040bbf4..df1a61bd8 100644 --- a/HwProj.SolutionsService/HwProj.SolutionsService.API/Services/SolutionsService.cs +++ b/HwProj.SolutionsService/HwProj.SolutionsService.API/Services/SolutionsService.cs @@ -10,8 +10,8 @@ using HwProj.Models.CoursesService; using HwProj.Models.SolutionsService; using HwProj.Models.StatisticsService; +using HwProj.NotificationService.Events.SolutionsService; using HwProj.SolutionsService.API.Domains; -using HwProj.SolutionsService.API.Events; using HwProj.SolutionsService.API.Models; using HwProj.SolutionsService.API.Repositories; using Microsoft.EntityFrameworkCore; diff --git a/HwProj.sln b/HwProj.sln index 77476a393..6b9064aec 100644 --- a/HwProj.sln +++ b/HwProj.sln @@ -80,6 +80,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HwProj.Common.Net8", "HwPro EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HwProj.NotificationService.Events", "HwProj.NotificationsService\HwProj.NotificationService.Events\HwProj.NotificationService.Events.csproj", "{C04A9D3D-B299-4534-B7B1-36DF92B1BC87}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HwProj.Repositories.Net8", "HwProj.Common\HwProj.Repositories.Net8\HwProj.Repositories.Net8.csproj", "{9E3A99DA-6975-46A7-90DB-69B708C8FF2C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -194,6 +196,10 @@ Global {C04A9D3D-B299-4534-B7B1-36DF92B1BC87}.Debug|Any CPU.Build.0 = Debug|Any CPU {C04A9D3D-B299-4534-B7B1-36DF92B1BC87}.Release|Any CPU.ActiveCfg = Release|Any CPU {C04A9D3D-B299-4534-B7B1-36DF92B1BC87}.Release|Any CPU.Build.0 = Release|Any CPU + {9E3A99DA-6975-46A7-90DB-69B708C8FF2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9E3A99DA-6975-46A7-90DB-69B708C8FF2C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E3A99DA-6975-46A7-90DB-69B708C8FF2C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9E3A99DA-6975-46A7-90DB-69B708C8FF2C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -226,6 +232,7 @@ Global {8DE955D7-FD97-4F11-B6D4-414E631B9F83} = {CCA598FB-F8A9-4F20-BCE5-BE21725156BD} {6D9F7095-5E38-4FC6-9913-C4015B233656} = {77D857A8-45C6-4432-B4BF-A2F2C9ECA7FE} {C04A9D3D-B299-4534-B7B1-36DF92B1BC87} = {1EAEB779-E7C8-4EF9-B9A9-22CB8E3C246D} + {9E3A99DA-6975-46A7-90DB-69B708C8FF2C} = {77D857A8-45C6-4432-B4BF-A2F2C9ECA7FE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C03BF138-4A5B-4261-9495-6D3AC6CE9779}