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<,>)); });