From cc73945ae2712f987621660a0b1d6ad84de06957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B0=D0=BB=D0=B8=D0=BC=D0=BE=D0=B2=20=D0=A0=D1=83?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BC?= Date: Fri, 13 Feb 2026 22:37:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D0=BC=D0=BF=D0=B5=D1=82=D0=B5?= =?UTF-8?q?=D0=BD=D1=86=D0=B8=D0=B8=20=D0=B8=20=D0=B0=D0=B2=D0=B0=D1=82?= =?UTF-8?q?=D0=B0=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + Dockerfile | 2 + docker-compose.yml | 2 + .../Commands/UploadAvatarCommandHandler.cs | 40 ++++++++++++++++++- .../Identity/Domain/Entities/Competency.cs | 2 +- .../Repositories/ICompetencyRepository.cs | 9 +++++ .../Infrastructure/DependencyInjection.cs | 2 + 7 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 src/Modules/Identity/Domain/Repositories/ICompetencyRepository.cs diff --git a/.gitignore b/.gitignore index d6472e2..47999cb 100644 --- a/.gitignore +++ b/.gitignore @@ -158,3 +158,5 @@ src/Modules/Collaboration/Tests/obj/ src/Modules/Reputation/Tests/obj/ src/Modules/Reputation/Tests/bin/ + +uploads/ diff --git a/Dockerfile b/Dockerfile index 64ff9dc..f33fcc9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,8 @@ RUN dotnet publish "Nashel.Host.csproj" -c Release -o /app/publish /p:UseAppHost FROM mcr.microsoft.com/dotnet/aspnet:10.0-preview AS final WORKDIR /app COPY --from=build /app/publish . +# Copy wwwroot folder for static files (uploads) +COPY src/Host/wwwroot /app/wwwroot ENV ASPNETCORE_URLS=http://+:8080 EXPOSE 8080 ENTRYPOINT ["dotnet", "Nashel.Host.dll"] diff --git a/docker-compose.yml b/docker-compose.yml index 142b367..c6b98ca 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,8 @@ services: container_name: nashel-backend ports: - "5000:8080" + volumes: + - ./uploads:/app/wwwroot/uploads environment: - ASPNETCORE_ENVIRONMENT=Development - ConnectionStrings__DefaultConnection=Host=db;Port=5432;Database=nashel;Username=postgres;Password=postgres diff --git a/src/Modules/Identity/Application/Commands/UploadAvatarCommandHandler.cs b/src/Modules/Identity/Application/Commands/UploadAvatarCommandHandler.cs index 2dbe6da..7daaf96 100644 --- a/src/Modules/Identity/Application/Commands/UploadAvatarCommandHandler.cs +++ b/src/Modules/Identity/Application/Commands/UploadAvatarCommandHandler.cs @@ -1,4 +1,6 @@ using MediatR; +using Nashel.BuildingBlocks.Application.Abstractions; +using Nashel.Modules.Identity.Domain.Repositories; namespace Nashel.Modules.Identity.Application.Commands; @@ -7,6 +9,17 @@ public class UploadAvatarCommandHandler : IRequestHandler Handle(UploadAvatarCommand request, CancellationToken cancellationToken) { var file = request.File; @@ -35,7 +48,30 @@ public class UploadAvatarCommandHandler : IRequestHandler GetByNameAsync(string name, CancellationToken cancellationToken); + Task AddAsync(Competency competency, CancellationToken cancellationToken); +} diff --git a/src/Modules/Identity/Infrastructure/DependencyInjection.cs b/src/Modules/Identity/Infrastructure/DependencyInjection.cs index be949b0..0c533e9 100644 --- a/src/Modules/Identity/Infrastructure/DependencyInjection.cs +++ b/src/Modules/Identity/Infrastructure/DependencyInjection.cs @@ -7,6 +7,7 @@ using Nashel.BuildingBlocks.Application.Behaviors; using Nashel.Modules.Identity.Application.Commands; using Nashel.Modules.Identity.Domain.Repositories; using Nashel.Modules.Identity.Domain.Services; +using Nashel.Modules.Identity.Infrastructure.CommandHandlers; using Nashel.Modules.Identity.Infrastructure.Persistence; using Nashel.Modules.Identity.Infrastructure.Repositories; using Nashel.Modules.Identity.Infrastructure.Services; @@ -26,6 +27,7 @@ public static class DependencyInjection services.AddMediatR(cfg => { cfg.RegisterServicesFromAssembly(typeof(RegisterUserCommand).Assembly); + cfg.RegisterServicesFromAssembly(typeof(UpdateProfileCompetenciesCommandHandler).Assembly); cfg.AddBehavior(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>)); });