aboutsummaryrefslogtreecommitdiff
path: root/src/Web/DevHive.Web/Configurations
diff options
context:
space:
mode:
authorVictor S <57849063+transtrike@users.noreply.github.com>2021-04-02 23:55:25 +0300
committerGitHub <noreply@github.com>2021-04-02 23:55:25 +0300
commitbad7456b379bcc683431e2279591f7c5227bd55a (patch)
treeb82e15d10e28759dcd066b38ccdd16c23753b33c /src/Web/DevHive.Web/Configurations
parent2448c4d31188aed26605c5e3c282bacc3bd71ae5 (diff)
parentb0c6c6e1795a1cc8fe82a60ce16a263ab4cad397 (diff)
downloadDevHive-bad7456b379bcc683431e2279591f7c5227bd55a.tar
DevHive-bad7456b379bcc683431e2279591f7c5227bd55a.tar.gz
DevHive-bad7456b379bcc683431e2279591f7c5227bd55a.zip
Merge pull request #24 from Team-Kaleidoscope/feature/profile_picture_implementation
- Removed InsertProfilePicture from Service layer (unneeded) - ReadProfilePicture endpoint implemented
Diffstat (limited to 'src/Web/DevHive.Web/Configurations')
-rw-r--r--src/Web/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs7
-rw-r--r--src/Web/DevHive.Web/Configurations/Mapping/ProfilePictureMappings.cs16
-rw-r--r--src/Web/DevHive.Web/Configurations/Mapping/UserMappings.cs3
3 files changed, 20 insertions, 6 deletions
diff --git a/src/Web/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs
index a0d0979..20b66e1 100644
--- a/src/Web/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs
+++ b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs
@@ -17,20 +17,22 @@ namespace DevHive.Web.Configurations.Extensions
services.AddTransient<ILanguageRepository, LanguageRepository>();
services.AddTransient<IRoleRepository, RoleRepository>();
services.AddTransient<ITechnologyRepository, TechnologyRepository>();
- services.AddTransient<IUserRepository, UserRepository>();
services.AddTransient<IPostRepository, PostRepository>();
services.AddTransient<ICommentRepository, CommentRepository>();
services.AddTransient<IFeedRepository, FeedRepository>();
services.AddTransient<IRatingRepository, RatingRepository>();
+ services.AddTransient<IProfilePictureRepository, ProfilePictureRepository>();
+ services.AddTransient<IUserRepository, UserRepository>();
services.AddTransient<ILanguageService, LanguageService>();
services.AddTransient<IRoleService, RoleService>();
services.AddTransient<ITechnologyService, TechnologyService>();
- services.AddTransient<IUserService, UserService>();
services.AddTransient<IPostService, PostService>();
services.AddTransient<ICommentService, CommentService>();
services.AddTransient<IFeedService, FeedService>();
services.AddTransient<IRatingService, RatingService>();
+ services.AddTransient<IProfilePictureService, ProfilePictureService>();
+ services.AddTransient<IUserService, UserService>();
services.AddTransient<ICloudService, CloudinaryService>(options =>
new CloudinaryService(
@@ -43,7 +45,6 @@ namespace DevHive.Web.Configurations.Extensions
signingKey: Encoding.ASCII.GetBytes(configuration.GetSection("Jwt").GetSection("signingKey").Value),
validationIssuer: configuration.GetSection("Jwt").GetSection("validationIssuer").Value,
audience: configuration.GetSection("Jwt").GetSection("audience").Value));
- services.AddTransient<IRatingService, RatingService>();
}
}
}
diff --git a/src/Web/DevHive.Web/Configurations/Mapping/ProfilePictureMappings.cs b/src/Web/DevHive.Web/Configurations/Mapping/ProfilePictureMappings.cs
new file mode 100644
index 0000000..8c12a20
--- /dev/null
+++ b/src/Web/DevHive.Web/Configurations/Mapping/ProfilePictureMappings.cs
@@ -0,0 +1,16 @@
+using System;
+using AutoMapper;
+using DevHive.Web.Models.ProfilePicture;
+using DevHive.Services.Models.ProfilePicture;
+
+namespace DevHive.Web.Configurations.Mapping
+{
+ public class ProfilePictureMappings : Profile
+ {
+ public ProfilePictureMappings()
+ {
+ CreateMap<ProfilePictureWebModel, ProfilePictureServiceModel>()
+ .ForMember(dest => dest.ProfilePictureFormFile, src => src.MapFrom(p => p.Picture));
+ }
+ }
+}
diff --git a/src/Web/DevHive.Web/Configurations/Mapping/UserMappings.cs b/src/Web/DevHive.Web/Configurations/Mapping/UserMappings.cs
index 14aaa3a..dabec93 100644
--- a/src/Web/DevHive.Web/Configurations/Mapping/UserMappings.cs
+++ b/src/Web/DevHive.Web/Configurations/Mapping/UserMappings.cs
@@ -23,9 +23,6 @@ namespace DevHive.Web.Configurations.Mapping
CreateMap<UsernameWebModel, FriendServiceModel>();
CreateMap<UsernameWebModel, UpdateFriendServiceModel>();
- CreateMap<UpdateProfilePictureWebModel, UpdateProfilePictureServiceModel>();
- CreateMap<ProfilePictureServiceModel, ProfilePictureWebModel>();
-
CreateMap<UpdateUserServiceModel, UpdateUserWebModel>();
CreateMap<FriendServiceModel, UsernameWebModel>();
}