From 98e17766b203734a1817eed94338e2d25f4395f7 Mon Sep 17 00:00:00 2001 From: transtrike Date: Sat, 13 Feb 2021 16:20:18 +0200 Subject: Project Restructure P.1 --- .../DevHive.Services/Interfaces/IRoleService.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/Services/DevHive.Services/Interfaces/IRoleService.cs (limited to 'src/Services/DevHive.Services/Interfaces/IRoleService.cs') diff --git a/src/Services/DevHive.Services/Interfaces/IRoleService.cs b/src/Services/DevHive.Services/Interfaces/IRoleService.cs new file mode 100644 index 0000000..d47728c --- /dev/null +++ b/src/Services/DevHive.Services/Interfaces/IRoleService.cs @@ -0,0 +1,17 @@ +using System; +using System.Threading.Tasks; +using DevHive.Services.Models.Identity.Role; + +namespace DevHive.Services.Interfaces +{ + public interface IRoleService + { + Task CreateRole(CreateRoleServiceModel roleServiceModel); + + Task GetRoleById(Guid id); + + Task UpdateRole(UpdateRoleServiceModel roleServiceModel); + + Task DeleteRole(Guid id); + } +} -- cgit v1.2.3 From c5b27c7eb62cc5428a0c01ffcf381f429d776122 Mon Sep 17 00:00:00 2001 From: transtrike Date: Sat, 13 Feb 2021 17:57:54 +0200 Subject: Removed all references --- src/Data/DevHive.Data.Models/Comment.cs | 2 +- .../DevHive.Data.Models/DevHive.Data.Models.csproj | 6 - .../DevHive.Data.Models/Interfaces/IComment.cs | 16 ++ .../DevHive.Data.Models/Interfaces/ILanguage.cs | 11 + src/Data/DevHive.Data.Models/Interfaces/IModel.cs | 9 + src/Data/DevHive.Data.Models/Interfaces/IPost.cs | 22 ++ .../Interfaces/IProfilePicture.cs | 13 + src/Data/DevHive.Data.Models/Interfaces/IRating.cs | 14 + src/Data/DevHive.Data.Models/Interfaces/IRole.cs | 10 + .../DevHive.Data.Models/Interfaces/ITechnology.cs | 11 + src/Data/DevHive.Data.Models/Interfaces/IUser.cs | 21 ++ src/Data/DevHive.Data.Models/Language.cs | 2 +- src/Data/DevHive.Data.Models/Post.cs | 2 +- src/Data/DevHive.Data.Models/ProfilePicture.cs | 2 +- src/Data/DevHive.Data.Models/Rating.cs | 4 +- src/Data/DevHive.Data.Models/Role.cs | 2 +- src/Data/DevHive.Data.Models/Technology.cs | 2 +- src/Data/DevHive.Data.Models/User.cs | 2 +- .../DevHive.Data.Tests/DevHive.Data.Tests.csproj | 8 - src/Data/DevHive.Data/DevHive.Data.csproj | 8 - .../DevHive.Data/Interfaces/ICommentRepository.cs | 16 ++ .../DevHive.Data/Interfaces/IFeedRepository.cs | 13 + .../DevHive.Data/Interfaces/ILanguageRepository.cs | 17 ++ .../DevHive.Data/Interfaces/IPostRepository.cs | 19 ++ .../DevHive.Data/Interfaces/IRatingRepository.cs | 13 + src/Data/DevHive.Data/Interfaces/IRepository.cs | 21 ++ .../DevHive.Data/Interfaces/IRoleRepository.cs | 15 + .../Interfaces/ITechnologyRepository.cs | 17 ++ .../DevHive.Data/Interfaces/IUserRepository.cs | 22 ++ .../DevHive.Data/Interfaces/Models/IComment.cs | 16 -- .../DevHive.Data/Interfaces/Models/ILanguage.cs | 11 - src/Data/DevHive.Data/Interfaces/Models/IModel.cs | 9 - src/Data/DevHive.Data/Interfaces/Models/IPost.cs | 22 -- .../Interfaces/Models/IProfilePicture.cs | 13 - src/Data/DevHive.Data/Interfaces/Models/IRating.cs | 14 - src/Data/DevHive.Data/Interfaces/Models/IRole.cs | 10 - .../DevHive.Data/Interfaces/Models/ITechnology.cs | 11 - src/Data/DevHive.Data/Interfaces/Models/IUser.cs | 21 -- .../Interfaces/Repositories/ICommentRepository.cs | 16 -- .../Interfaces/Repositories/IFeedRepository.cs | 13 - .../Interfaces/Repositories/ILanguageRepository.cs | 17 -- .../Interfaces/Repositories/IPostRepository.cs | 19 -- .../Interfaces/Repositories/IRatingRepository.cs | 13 - .../Interfaces/Repositories/IRepository.cs | 21 -- .../Interfaces/Repositories/IRoleRepository.cs | 15 - .../Repositories/ITechnologyRepository.cs | 17 -- .../Interfaces/Repositories/IUserRepository.cs | 22 -- src/DevHive.sln | 304 ++++++++++----------- .../DevHive.Services.Models.csproj | 4 +- .../Identity/Role/CreateRoleServiceModel.cs | 10 - .../Identity/Role/RoleServiceModel.cs | 7 - .../Identity/Role/UpdateRoleServiceModel.cs | 10 - .../Identity/User/BaseUserServiceModel.cs | 10 - .../Identity/User/FriendServiceModel.cs | 10 - .../Identity/User/LoginServiceModel.cs | 8 - .../Identity/User/ProfilePictureServiceModel.cs | 7 - .../Identity/User/RegisterServiceModel.cs | 15 - .../Identity/User/UpdateFriendServiceModel.cs | 10 - .../User/UpdateProfilePictureServiceModel.cs | 12 - .../Identity/User/UpdateUserServiceModel.cs | 26 -- .../Identity/User/UserServiceModel.cs | 23 -- .../Role/CreateRoleServiceModel.cs | 10 + .../Role/RoleServiceModel.cs | 7 + .../Role/UpdateRoleServiceModel.cs | 10 + .../User/BaseUserServiceModel.cs | 10 + .../User/FriendServiceModel.cs | 10 + .../User/LoginServiceModel.cs | 8 + .../User/ProfilePictureServiceModel.cs | 7 + .../User/RegisterServiceModel.cs | 15 + .../User/UpdateFriendServiceModel.cs | 10 + .../User/UpdateProfilePictureServiceModel.cs | 12 + .../User/UpdateUserServiceModel.cs | 26 ++ .../User/UserServiceModel.cs | 23 ++ .../DevHive.Services.Tests.csproj | 8 - .../DevHive.Services.Tests/RoleService.Tests.cs | 2 +- .../DevHive.Services.Tests/UserService.Tests.cs | 2 +- .../Configurations/Mapping/RoleMapings.cs | 2 +- .../Configurations/Mapping/UserMappings.cs | 2 +- .../DevHive.Services/DevHive.Services.csproj | 6 - .../DevHive.Services/Interfaces/IRoleService.cs | 2 +- .../DevHive.Services/Interfaces/IUserService.cs | 2 +- .../DevHive.Services/Services/RoleService.cs | 2 +- .../DevHive.Services/Services/UserService.cs | 2 +- .../DevHive.Web.Models/DevHive.Web.Models.csproj | 8 +- .../Identity/Role/CreateRoleWebModel.cs | 14 - .../Identity/Role/RoleWebModel.cs | 14 - .../Identity/Role/UpdateRoleWebModel.cs | 15 - .../Identity/User/BaseUserWebModel.cs | 34 --- .../Identity/User/LoginWebModel.cs | 20 -- .../Identity/User/ProfilePictureWebModel.cs | 7 - .../Identity/User/RegisterWebModel.cs | 14 - .../Identity/User/TokenWebModel.cs | 12 - .../Identity/User/UpdateProfilePictureWebModel.cs | 9 - .../Identity/User/UpdateUserWebModel.cs | 34 --- .../Identity/User/UserWebModel.cs | 33 --- .../Identity/User/UsernameWebModel.cs | 15 - .../Post/Rating/RatePostWebModel.cs | 11 - .../Post/Rating/ReadPostRatingWebModel.cs | 15 - .../DevHive.Web.Models/Rating/RatePostWebModel.cs | 11 + .../Rating/ReadPostRatingWebModel.cs | 15 + .../DevHive.Web.Models/Role/CreateRoleWebModel.cs | 14 + src/Web/DevHive.Web.Models/Role/RoleWebModel.cs | 14 + .../DevHive.Web.Models/Role/UpdateRoleWebModel.cs | 15 + .../DevHive.Web.Models/User/BaseUserWebModel.cs | 34 +++ src/Web/DevHive.Web.Models/User/LoginWebModel.cs | 20 ++ .../User/ProfilePictureWebModel.cs | 7 + .../DevHive.Web.Models/User/RegisterWebModel.cs | 14 + src/Web/DevHive.Web.Models/User/TokenWebModel.cs | 12 + .../User/UpdateProfilePictureWebModel.cs | 9 + .../DevHive.Web.Models/User/UpdateUserWebModel.cs | 34 +++ src/Web/DevHive.Web.Models/User/UserWebModel.cs | 33 +++ .../DevHive.Web.Models/User/UsernameWebModel.cs | 15 + src/Web/DevHive.Web.Tests/DevHive.Web.Tests.csproj | 7 - src/Web/DevHive.Web.Tests/RoleController.Tests.cs | 4 +- src/Web/DevHive.Web.Tests/UserController.Tests.cs | 4 +- .../Configurations/Mapping/RoleMappings.cs | 4 +- .../Configurations/Mapping/UserMappings.cs | 4 +- src/Web/DevHive.Web/Controllers/RoleController.cs | 4 +- src/Web/DevHive.Web/Controllers/UserController.cs | 4 +- src/Web/DevHive.Web/DevHive.Web.csproj | 7 - 120 files changed, 855 insertions(+), 919 deletions(-) create mode 100644 src/Data/DevHive.Data.Models/Interfaces/IComment.cs create mode 100644 src/Data/DevHive.Data.Models/Interfaces/ILanguage.cs create mode 100644 src/Data/DevHive.Data.Models/Interfaces/IModel.cs create mode 100644 src/Data/DevHive.Data.Models/Interfaces/IPost.cs create mode 100644 src/Data/DevHive.Data.Models/Interfaces/IProfilePicture.cs create mode 100644 src/Data/DevHive.Data.Models/Interfaces/IRating.cs create mode 100644 src/Data/DevHive.Data.Models/Interfaces/IRole.cs create mode 100644 src/Data/DevHive.Data.Models/Interfaces/ITechnology.cs create mode 100644 src/Data/DevHive.Data.Models/Interfaces/IUser.cs create mode 100644 src/Data/DevHive.Data/Interfaces/ICommentRepository.cs create mode 100644 src/Data/DevHive.Data/Interfaces/IFeedRepository.cs create mode 100644 src/Data/DevHive.Data/Interfaces/ILanguageRepository.cs create mode 100644 src/Data/DevHive.Data/Interfaces/IPostRepository.cs create mode 100644 src/Data/DevHive.Data/Interfaces/IRatingRepository.cs create mode 100644 src/Data/DevHive.Data/Interfaces/IRepository.cs create mode 100644 src/Data/DevHive.Data/Interfaces/IRoleRepository.cs create mode 100644 src/Data/DevHive.Data/Interfaces/ITechnologyRepository.cs create mode 100644 src/Data/DevHive.Data/Interfaces/IUserRepository.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Models/IComment.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Models/ILanguage.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Models/IModel.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Models/IPost.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Models/IProfilePicture.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Models/IRating.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Models/IRole.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Models/ITechnology.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Models/IUser.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Repositories/ICommentRepository.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Repositories/IFeedRepository.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Repositories/ILanguageRepository.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Repositories/IPostRepository.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Repositories/IRatingRepository.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Repositories/IRepository.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Repositories/IRoleRepository.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Repositories/ITechnologyRepository.cs delete mode 100644 src/Data/DevHive.Data/Interfaces/Repositories/IUserRepository.cs delete mode 100644 src/Services/DevHive.Services.Models/Identity/Role/CreateRoleServiceModel.cs delete mode 100644 src/Services/DevHive.Services.Models/Identity/Role/RoleServiceModel.cs delete mode 100644 src/Services/DevHive.Services.Models/Identity/Role/UpdateRoleServiceModel.cs delete mode 100644 src/Services/DevHive.Services.Models/Identity/User/BaseUserServiceModel.cs delete mode 100644 src/Services/DevHive.Services.Models/Identity/User/FriendServiceModel.cs delete mode 100644 src/Services/DevHive.Services.Models/Identity/User/LoginServiceModel.cs delete mode 100644 src/Services/DevHive.Services.Models/Identity/User/ProfilePictureServiceModel.cs delete mode 100644 src/Services/DevHive.Services.Models/Identity/User/RegisterServiceModel.cs delete mode 100644 src/Services/DevHive.Services.Models/Identity/User/UpdateFriendServiceModel.cs delete mode 100644 src/Services/DevHive.Services.Models/Identity/User/UpdateProfilePictureServiceModel.cs delete mode 100644 src/Services/DevHive.Services.Models/Identity/User/UpdateUserServiceModel.cs delete mode 100644 src/Services/DevHive.Services.Models/Identity/User/UserServiceModel.cs create mode 100644 src/Services/DevHive.Services.Models/Role/CreateRoleServiceModel.cs create mode 100644 src/Services/DevHive.Services.Models/Role/RoleServiceModel.cs create mode 100644 src/Services/DevHive.Services.Models/Role/UpdateRoleServiceModel.cs create mode 100644 src/Services/DevHive.Services.Models/User/BaseUserServiceModel.cs create mode 100644 src/Services/DevHive.Services.Models/User/FriendServiceModel.cs create mode 100644 src/Services/DevHive.Services.Models/User/LoginServiceModel.cs create mode 100644 src/Services/DevHive.Services.Models/User/ProfilePictureServiceModel.cs create mode 100644 src/Services/DevHive.Services.Models/User/RegisterServiceModel.cs create mode 100644 src/Services/DevHive.Services.Models/User/UpdateFriendServiceModel.cs create mode 100644 src/Services/DevHive.Services.Models/User/UpdateProfilePictureServiceModel.cs create mode 100644 src/Services/DevHive.Services.Models/User/UpdateUserServiceModel.cs create mode 100644 src/Services/DevHive.Services.Models/User/UserServiceModel.cs delete mode 100644 src/Web/DevHive.Web.Models/Identity/Role/CreateRoleWebModel.cs delete mode 100644 src/Web/DevHive.Web.Models/Identity/Role/RoleWebModel.cs delete mode 100644 src/Web/DevHive.Web.Models/Identity/Role/UpdateRoleWebModel.cs delete mode 100644 src/Web/DevHive.Web.Models/Identity/User/BaseUserWebModel.cs delete mode 100644 src/Web/DevHive.Web.Models/Identity/User/LoginWebModel.cs delete mode 100644 src/Web/DevHive.Web.Models/Identity/User/ProfilePictureWebModel.cs delete mode 100644 src/Web/DevHive.Web.Models/Identity/User/RegisterWebModel.cs delete mode 100644 src/Web/DevHive.Web.Models/Identity/User/TokenWebModel.cs delete mode 100644 src/Web/DevHive.Web.Models/Identity/User/UpdateProfilePictureWebModel.cs delete mode 100644 src/Web/DevHive.Web.Models/Identity/User/UpdateUserWebModel.cs delete mode 100644 src/Web/DevHive.Web.Models/Identity/User/UserWebModel.cs delete mode 100644 src/Web/DevHive.Web.Models/Identity/User/UsernameWebModel.cs delete mode 100644 src/Web/DevHive.Web.Models/Post/Rating/RatePostWebModel.cs delete mode 100644 src/Web/DevHive.Web.Models/Post/Rating/ReadPostRatingWebModel.cs create mode 100644 src/Web/DevHive.Web.Models/Rating/RatePostWebModel.cs create mode 100644 src/Web/DevHive.Web.Models/Rating/ReadPostRatingWebModel.cs create mode 100644 src/Web/DevHive.Web.Models/Role/CreateRoleWebModel.cs create mode 100644 src/Web/DevHive.Web.Models/Role/RoleWebModel.cs create mode 100644 src/Web/DevHive.Web.Models/Role/UpdateRoleWebModel.cs create mode 100644 src/Web/DevHive.Web.Models/User/BaseUserWebModel.cs create mode 100644 src/Web/DevHive.Web.Models/User/LoginWebModel.cs create mode 100644 src/Web/DevHive.Web.Models/User/ProfilePictureWebModel.cs create mode 100644 src/Web/DevHive.Web.Models/User/RegisterWebModel.cs create mode 100644 src/Web/DevHive.Web.Models/User/TokenWebModel.cs create mode 100644 src/Web/DevHive.Web.Models/User/UpdateProfilePictureWebModel.cs create mode 100644 src/Web/DevHive.Web.Models/User/UpdateUserWebModel.cs create mode 100644 src/Web/DevHive.Web.Models/User/UserWebModel.cs create mode 100644 src/Web/DevHive.Web.Models/User/UsernameWebModel.cs (limited to 'src/Services/DevHive.Services/Interfaces/IRoleService.cs') diff --git a/src/Data/DevHive.Data.Models/Comment.cs b/src/Data/DevHive.Data.Models/Comment.cs index e2bb21d..10a3aaf 100644 --- a/src/Data/DevHive.Data.Models/Comment.cs +++ b/src/Data/DevHive.Data.Models/Comment.cs @@ -1,5 +1,5 @@ using System; -using DevHive.Data.Interfaces.Models; +using DevHive.Data.Models.Interfaces; namespace DevHive.Data.Models { diff --git a/src/Data/DevHive.Data.Models/DevHive.Data.Models.csproj b/src/Data/DevHive.Data.Models/DevHive.Data.Models.csproj index ebf5f9c..628e361 100644 --- a/src/Data/DevHive.Data.Models/DevHive.Data.Models.csproj +++ b/src/Data/DevHive.Data.Models/DevHive.Data.Models.csproj @@ -1,11 +1,5 @@ - net5.0 - - - - - diff --git a/src/Data/DevHive.Data.Models/Interfaces/IComment.cs b/src/Data/DevHive.Data.Models/Interfaces/IComment.cs new file mode 100644 index 0000000..c8f1f6a --- /dev/null +++ b/src/Data/DevHive.Data.Models/Interfaces/IComment.cs @@ -0,0 +1,16 @@ +using System; +using DevHive.Data.Models; + +namespace DevHive.Data.Models.Interfaces +{ + public interface IComment : IModel + { + Post Post { get; set; } + + User Creator { get; set; } + + string Message { get; set; } + + DateTime TimeCreated { get; set; } + } +} diff --git a/src/Data/DevHive.Data.Models/Interfaces/ILanguage.cs b/src/Data/DevHive.Data.Models/Interfaces/ILanguage.cs new file mode 100644 index 0000000..06e11b4 --- /dev/null +++ b/src/Data/DevHive.Data.Models/Interfaces/ILanguage.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; +using DevHive.Data.Models; + +namespace DevHive.Data.Models.Interfaces +{ + public interface ILanguage : IModel + { + string Name { get; set; } + HashSet Users { get; set; } + } +} diff --git a/src/Data/DevHive.Data.Models/Interfaces/IModel.cs b/src/Data/DevHive.Data.Models/Interfaces/IModel.cs new file mode 100644 index 0000000..3226dce --- /dev/null +++ b/src/Data/DevHive.Data.Models/Interfaces/IModel.cs @@ -0,0 +1,9 @@ +using System; + +namespace DevHive.Data.Models.Interfaces +{ + public interface IModel + { + Guid Id { get; set; } + } +} diff --git a/src/Data/DevHive.Data.Models/Interfaces/IPost.cs b/src/Data/DevHive.Data.Models/Interfaces/IPost.cs new file mode 100644 index 0000000..b1f0cb7 --- /dev/null +++ b/src/Data/DevHive.Data.Models/Interfaces/IPost.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using DevHive.Data.Models; +using DevHive.Data.RelationModels; + +namespace DevHive.Data.Models.Interfaces +{ + public interface IPost : IModel + { + User Creator { get; set; } + + string Message { get; set; } + + DateTime TimeCreated { get; set; } + + List Comments { get; set; } + + // Rating Rating { get; set; } + + List Attachments { get; set; } + } +} diff --git a/src/Data/DevHive.Data.Models/Interfaces/IProfilePicture.cs b/src/Data/DevHive.Data.Models/Interfaces/IProfilePicture.cs new file mode 100644 index 0000000..550af24 --- /dev/null +++ b/src/Data/DevHive.Data.Models/Interfaces/IProfilePicture.cs @@ -0,0 +1,13 @@ +using System; +using DevHive.Data.Models; + +namespace DevHive.Data.Models.Interfaces +{ + public interface IProfilePicture : IModel + { + Guid UserId { get; set; } + User User { get; set; } + + string PictureURL { get; set; } + } +} diff --git a/src/Data/DevHive.Data.Models/Interfaces/IRating.cs b/src/Data/DevHive.Data.Models/Interfaces/IRating.cs new file mode 100644 index 0000000..1b081b0 --- /dev/null +++ b/src/Data/DevHive.Data.Models/Interfaces/IRating.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using DevHive.Data.Models; + +namespace DevHive.Data.Models.Interfaces +{ + public interface IRating : IModel + { + // Post Post { get; set; } + + int Rate { get; set; } + + // HashSet UsersThatRated { get; set; } + } +} diff --git a/src/Data/DevHive.Data.Models/Interfaces/IRole.cs b/src/Data/DevHive.Data.Models/Interfaces/IRole.cs new file mode 100644 index 0000000..3a87e12 --- /dev/null +++ b/src/Data/DevHive.Data.Models/Interfaces/IRole.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; +using DevHive.Data.Models; + +namespace DevHive.Data.Models.Interfaces +{ + public interface IRole + { + HashSet Users { get; set; } + } +} diff --git a/src/Data/DevHive.Data.Models/Interfaces/ITechnology.cs b/src/Data/DevHive.Data.Models/Interfaces/ITechnology.cs new file mode 100644 index 0000000..575aea6 --- /dev/null +++ b/src/Data/DevHive.Data.Models/Interfaces/ITechnology.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; +using DevHive.Data.Models; + +namespace DevHive.Data.Models.Interfaces +{ + public interface ITechnology : IModel + { + string Name { get; set; } + HashSet Users { get; set; } + } +} diff --git a/src/Data/DevHive.Data.Models/Interfaces/IUser.cs b/src/Data/DevHive.Data.Models/Interfaces/IUser.cs new file mode 100644 index 0000000..7606ba2 --- /dev/null +++ b/src/Data/DevHive.Data.Models/Interfaces/IUser.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; +using DevHive.Data.Models; +using DevHive.Data.RelationModels; + +namespace DevHive.Data.Models.Interfaces +{ + public interface IUser : IModel + { + string FirstName { get; set; } + + string LastName { get; set; } + + ProfilePicture ProfilePicture { get; set; } + + HashSet Languages { get; set; } + + HashSet Technologies { get; set; } + + HashSet Roles { get; set; } + } +} diff --git a/src/Data/DevHive.Data.Models/Language.cs b/src/Data/DevHive.Data.Models/Language.cs index 7ad8ff2..fdcfb07 100644 --- a/src/Data/DevHive.Data.Models/Language.cs +++ b/src/Data/DevHive.Data.Models/Language.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using DevHive.Data.Interfaces.Models; +using DevHive.Data.Models.Interfaces; namespace DevHive.Data.Models { diff --git a/src/Data/DevHive.Data.Models/Post.cs b/src/Data/DevHive.Data.Models/Post.cs index 3f3d8c9..5138d19 100644 --- a/src/Data/DevHive.Data.Models/Post.cs +++ b/src/Data/DevHive.Data.Models/Post.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; -using DevHive.Data.Interfaces.Models; +using DevHive.Data.Models.Interfaces; using DevHive.Data.RelationModels; namespace DevHive.Data.Models diff --git a/src/Data/DevHive.Data.Models/ProfilePicture.cs b/src/Data/DevHive.Data.Models/ProfilePicture.cs index d5cc397..c5dec68 100644 --- a/src/Data/DevHive.Data.Models/ProfilePicture.cs +++ b/src/Data/DevHive.Data.Models/ProfilePicture.cs @@ -1,5 +1,5 @@ using System; -using DevHive.Data.Interfaces.Models; +using DevHive.Data.Models.Interfaces; namespace DevHive.Data.Models { diff --git a/src/Data/DevHive.Data.Models/Rating.cs b/src/Data/DevHive.Data.Models/Rating.cs index e1bedd2..13fdbce 100644 --- a/src/Data/DevHive.Data.Models/Rating.cs +++ b/src/Data/DevHive.Data.Models/Rating.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using DevHive.Data.Interfaces.Models; +using DevHive.Data.Models.Interfaces; namespace DevHive.Data.Models { @@ -11,7 +11,7 @@ namespace DevHive.Data.Models public Guid PostId { get; set; } public Post Post { get; set; } - + public int Rate { get; set; } } } diff --git a/src/Data/DevHive.Data.Models/Role.cs b/src/Data/DevHive.Data.Models/Role.cs index 259d867..0df556c 100644 --- a/src/Data/DevHive.Data.Models/Role.cs +++ b/src/Data/DevHive.Data.Models/Role.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations.Schema; using System.Collections.Generic; -using DevHive.Data.Interfaces.Models; +using DevHive.Data.Models.Interfaces; using Microsoft.AspNetCore.Identity; using System; diff --git a/src/Data/DevHive.Data.Models/Technology.cs b/src/Data/DevHive.Data.Models/Technology.cs index 6f98f0b..9354d5b 100644 --- a/src/Data/DevHive.Data.Models/Technology.cs +++ b/src/Data/DevHive.Data.Models/Technology.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using DevHive.Data.Interfaces.Models; +using DevHive.Data.Models.Interfaces; namespace DevHive.Data.Models { diff --git a/src/Data/DevHive.Data.Models/User.cs b/src/Data/DevHive.Data.Models/User.cs index 983d073..806397a 100644 --- a/src/Data/DevHive.Data.Models/User.cs +++ b/src/Data/DevHive.Data.Models/User.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; -using DevHive.Data.Interfaces.Models; +using DevHive.Data.Models.Interfaces; using DevHive.Data.RelationModels; using Microsoft.AspNetCore.Identity; diff --git a/src/Data/DevHive.Data.Tests/DevHive.Data.Tests.csproj b/src/Data/DevHive.Data.Tests/DevHive.Data.Tests.csproj index 42a3273..d6d0876 100644 --- a/src/Data/DevHive.Data.Tests/DevHive.Data.Tests.csproj +++ b/src/Data/DevHive.Data.Tests/DevHive.Data.Tests.csproj @@ -14,14 +14,6 @@ - - - - - - - - true latest diff --git a/src/Data/DevHive.Data/DevHive.Data.csproj b/src/Data/DevHive.Data/DevHive.Data.csproj index 62b61dc..e8f38ee 100644 --- a/src/Data/DevHive.Data/DevHive.Data.csproj +++ b/src/Data/DevHive.Data/DevHive.Data.csproj @@ -18,14 +18,6 @@ - - - - - - - - true latest diff --git a/src/Data/DevHive.Data/Interfaces/ICommentRepository.cs b/src/Data/DevHive.Data/Interfaces/ICommentRepository.cs new file mode 100644 index 0000000..f85849f --- /dev/null +++ b/src/Data/DevHive.Data/Interfaces/ICommentRepository.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using DevHive.Data.Models; +using DevHive.Data.Repositories.Interfaces; + +namespace DevHive.Data.Interfaces +{ + public interface ICommentRepository : IRepository + { + Task> GetPostComments(Guid postId); + + Task DoesCommentExist(Guid id); + Task GetCommentByIssuerAndTimeCreatedAsync(Guid issuerId, DateTime timeCreated); + } +} diff --git a/src/Data/DevHive.Data/Interfaces/IFeedRepository.cs b/src/Data/DevHive.Data/Interfaces/IFeedRepository.cs new file mode 100644 index 0000000..bda51fa --- /dev/null +++ b/src/Data/DevHive.Data/Interfaces/IFeedRepository.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using DevHive.Data.Models; + +namespace DevHive.Data.Interfaces +{ + public interface IFeedRepository + { + Task> GetFriendsPosts(List friendsList, DateTime firstRequestIssued, int pageNumber, int pageSize); + Task> GetUsersPosts(User user, DateTime firstRequestIssued, int pageNumber, int pageSize); + } +} diff --git a/src/Data/DevHive.Data/Interfaces/ILanguageRepository.cs b/src/Data/DevHive.Data/Interfaces/ILanguageRepository.cs new file mode 100644 index 0000000..4771f91 --- /dev/null +++ b/src/Data/DevHive.Data/Interfaces/ILanguageRepository.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using DevHive.Data.Models; +using DevHive.Data.Repositories.Interfaces; + +namespace DevHive.Data.Interfaces +{ + public interface ILanguageRepository : IRepository + { + HashSet GetLanguages(); + Task GetByNameAsync(string name); + + Task DoesLanguageExistAsync(Guid id); + Task DoesLanguageNameExistAsync(string languageName); + } +} diff --git a/src/Data/DevHive.Data/Interfaces/IPostRepository.cs b/src/Data/DevHive.Data/Interfaces/IPostRepository.cs new file mode 100644 index 0000000..c24d596 --- /dev/null +++ b/src/Data/DevHive.Data/Interfaces/IPostRepository.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using DevHive.Data.Models; +using DevHive.Data.Repositories.Interfaces; + +namespace DevHive.Data.Interfaces +{ + public interface IPostRepository : IRepository + { + Task AddNewPostToCreator(Guid userId, Post post); + + Task GetPostByCreatorAndTimeCreatedAsync(Guid issuerId, DateTime timeCreated); + Task> GetFileUrls(Guid postId); + + Task DoesPostExist(Guid postId); + Task DoesPostHaveFiles(Guid postId); + } +} diff --git a/src/Data/DevHive.Data/Interfaces/IRatingRepository.cs b/src/Data/DevHive.Data/Interfaces/IRatingRepository.cs new file mode 100644 index 0000000..b5aff88 --- /dev/null +++ b/src/Data/DevHive.Data/Interfaces/IRatingRepository.cs @@ -0,0 +1,13 @@ +using System; +using System.Threading.Tasks; +using DevHive.Data.Models; +using DevHive.Data.Repositories.Interfaces; + +namespace DevHive.Data.Interfaces +{ + public interface IRatingRepository : IRepository + { + Task GetRatingByPostId(Guid postId); + Task UserRatedPost(Guid userId, Guid postId); + } +} diff --git a/src/Data/DevHive.Data/Interfaces/IRepository.cs b/src/Data/DevHive.Data/Interfaces/IRepository.cs new file mode 100644 index 0000000..0d11cd3 --- /dev/null +++ b/src/Data/DevHive.Data/Interfaces/IRepository.cs @@ -0,0 +1,21 @@ +using System; +using System.Threading.Tasks; + +namespace DevHive.Data.Repositories.Interfaces +{ + public interface IRepository + where TEntity : class + { + //Add Entity to database + Task AddAsync(TEntity entity); + + //Find entity by id + Task GetByIdAsync(Guid id); + + //Modify Entity from database + Task EditAsync(Guid id, TEntity newEntity); + + //Delete Entity from database + Task DeleteAsync(TEntity entity); + } +} diff --git a/src/Data/DevHive.Data/Interfaces/IRoleRepository.cs b/src/Data/DevHive.Data/Interfaces/IRoleRepository.cs new file mode 100644 index 0000000..a1080bb --- /dev/null +++ b/src/Data/DevHive.Data/Interfaces/IRoleRepository.cs @@ -0,0 +1,15 @@ +using System; +using System.Threading.Tasks; +using DevHive.Data.Models; +using DevHive.Data.Repositories.Interfaces; + +namespace DevHive.Data.Interfaces +{ + public interface IRoleRepository : IRepository + { + Task GetByNameAsync(string name); + + Task DoesNameExist(string name); + Task DoesRoleExist(Guid id); + } +} diff --git a/src/Data/DevHive.Data/Interfaces/ITechnologyRepository.cs b/src/Data/DevHive.Data/Interfaces/ITechnologyRepository.cs new file mode 100644 index 0000000..3e55b2d --- /dev/null +++ b/src/Data/DevHive.Data/Interfaces/ITechnologyRepository.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using DevHive.Data.Models; +using DevHive.Data.Repositories.Interfaces; + +namespace DevHive.Data.Interfaces +{ + public interface ITechnologyRepository : IRepository + { + Task GetByNameAsync(string name); + HashSet GetTechnologies(); + + Task DoesTechnologyExistAsync(Guid id); + Task DoesTechnologyNameExistAsync(string technologyName); + } +} diff --git a/src/Data/DevHive.Data/Interfaces/IUserRepository.cs b/src/Data/DevHive.Data/Interfaces/IUserRepository.cs new file mode 100644 index 0000000..917809d --- /dev/null +++ b/src/Data/DevHive.Data/Interfaces/IUserRepository.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using DevHive.Data.Models; +using DevHive.Data.Repositories.Interfaces; + +namespace DevHive.Data.Interfaces +{ + public interface IUserRepository : IRepository + { + //Read + Task GetByUsernameAsync(string username); + Task UpdateProfilePicture(Guid userId, string pictureUrl); + + //Validations + Task ValidateFriendsCollectionAsync(List usernames); + Task DoesEmailExistAsync(string email); + Task DoesUserExistAsync(Guid id); + Task DoesUsernameExistAsync(string username); + bool DoesUserHaveThisUsername(Guid id, string username); + } +} diff --git a/src/Data/DevHive.Data/Interfaces/Models/IComment.cs b/src/Data/DevHive.Data/Interfaces/Models/IComment.cs deleted file mode 100644 index 97c1578..0000000 --- a/src/Data/DevHive.Data/Interfaces/Models/IComment.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using DevHive.Data.Models; - -namespace DevHive.Data.Interfaces.Models -{ - public interface IComment : IModel - { - Post Post { get; set; } - - User Creator { get; set; } - - string Message { get; set; } - - DateTime TimeCreated { get; set; } - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Models/ILanguage.cs b/src/Data/DevHive.Data/Interfaces/Models/ILanguage.cs deleted file mode 100644 index 9eed09d..0000000 --- a/src/Data/DevHive.Data/Interfaces/Models/ILanguage.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; -using DevHive.Data.Models; - -namespace DevHive.Data.Interfaces.Models -{ - public interface ILanguage : IModel - { - string Name { get; set; } - HashSet Users { get; set; } - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Models/IModel.cs b/src/Data/DevHive.Data/Interfaces/Models/IModel.cs deleted file mode 100644 index f903af3..0000000 --- a/src/Data/DevHive.Data/Interfaces/Models/IModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace DevHive.Data.Interfaces.Models -{ - public interface IModel - { - Guid Id { get; set; } - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Models/IPost.cs b/src/Data/DevHive.Data/Interfaces/Models/IPost.cs deleted file mode 100644 index 712d955..0000000 --- a/src/Data/DevHive.Data/Interfaces/Models/IPost.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using DevHive.Data.Models; -using DevHive.Data.RelationModels; - -namespace DevHive.Data.Interfaces.Models -{ - public interface IPost : IModel - { - User Creator { get; set; } - - string Message { get; set; } - - DateTime TimeCreated { get; set; } - - List Comments { get; set; } - - // Rating Rating { get; set; } - - List Attachments { get; set; } - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Models/IProfilePicture.cs b/src/Data/DevHive.Data/Interfaces/Models/IProfilePicture.cs deleted file mode 100644 index c3fcbea..0000000 --- a/src/Data/DevHive.Data/Interfaces/Models/IProfilePicture.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using DevHive.Data.Models; - -namespace DevHive.Data.Interfaces.Models -{ - public interface IProfilePicture : IModel - { - Guid UserId { get; set; } - User User { get; set; } - - string PictureURL { get; set; } - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Models/IRating.cs b/src/Data/DevHive.Data/Interfaces/Models/IRating.cs deleted file mode 100644 index d1b968f..0000000 --- a/src/Data/DevHive.Data/Interfaces/Models/IRating.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; -using DevHive.Data.Models; - -namespace DevHive.Data.Interfaces.Models -{ - public interface IRating : IModel - { - // Post Post { get; set; } - - int Rate { get; set; } - - // HashSet UsersThatRated { get; set; } - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Models/IRole.cs b/src/Data/DevHive.Data/Interfaces/Models/IRole.cs deleted file mode 100644 index c8b7068..0000000 --- a/src/Data/DevHive.Data/Interfaces/Models/IRole.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Collections.Generic; -using DevHive.Data.Models; - -namespace DevHive.Data.Interfaces.Models -{ - public interface IRole - { - HashSet Users { get; set; } - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Models/ITechnology.cs b/src/Data/DevHive.Data/Interfaces/Models/ITechnology.cs deleted file mode 100644 index 153f75f..0000000 --- a/src/Data/DevHive.Data/Interfaces/Models/ITechnology.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; -using DevHive.Data.Models; - -namespace DevHive.Data.Interfaces.Models -{ - public interface ITechnology : IModel - { - string Name { get; set; } - HashSet Users { get; set; } - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Models/IUser.cs b/src/Data/DevHive.Data/Interfaces/Models/IUser.cs deleted file mode 100644 index fcd741c..0000000 --- a/src/Data/DevHive.Data/Interfaces/Models/IUser.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; -using DevHive.Data.Models; -using DevHive.Data.RelationModels; - -namespace DevHive.Data.Interfaces.Models -{ - public interface IUser : IModel - { - string FirstName { get; set; } - - string LastName { get; set; } - - ProfilePicture ProfilePicture { get; set; } - - HashSet Languages { get; set; } - - HashSet Technologies { get; set; } - - HashSet Roles { get; set; } - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Repositories/ICommentRepository.cs b/src/Data/DevHive.Data/Interfaces/Repositories/ICommentRepository.cs deleted file mode 100644 index 267f251..0000000 --- a/src/Data/DevHive.Data/Interfaces/Repositories/ICommentRepository.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using DevHive.Data.Models; -using DevHive.Data.Repositories.Interfaces; - -namespace DevHive.Data.Interfaces.Repositories -{ - public interface ICommentRepository : IRepository - { - Task> GetPostComments(Guid postId); - - Task DoesCommentExist(Guid id); - Task GetCommentByIssuerAndTimeCreatedAsync(Guid issuerId, DateTime timeCreated); - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Repositories/IFeedRepository.cs b/src/Data/DevHive.Data/Interfaces/Repositories/IFeedRepository.cs deleted file mode 100644 index 7262510..0000000 --- a/src/Data/DevHive.Data/Interfaces/Repositories/IFeedRepository.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using DevHive.Data.Models; - -namespace DevHive.Data.Interfaces.Repositories -{ - public interface IFeedRepository - { - Task> GetFriendsPosts(List friendsList, DateTime firstRequestIssued, int pageNumber, int pageSize); - Task> GetUsersPosts(User user, DateTime firstRequestIssued, int pageNumber, int pageSize); - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Repositories/ILanguageRepository.cs b/src/Data/DevHive.Data/Interfaces/Repositories/ILanguageRepository.cs deleted file mode 100644 index db2949a..0000000 --- a/src/Data/DevHive.Data/Interfaces/Repositories/ILanguageRepository.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using DevHive.Data.Models; -using DevHive.Data.Repositories.Interfaces; - -namespace DevHive.Data.Interfaces.Repositories -{ - public interface ILanguageRepository : IRepository - { - HashSet GetLanguages(); - Task GetByNameAsync(string name); - - Task DoesLanguageExistAsync(Guid id); - Task DoesLanguageNameExistAsync(string languageName); - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Repositories/IPostRepository.cs b/src/Data/DevHive.Data/Interfaces/Repositories/IPostRepository.cs deleted file mode 100644 index 9f7cf85..0000000 --- a/src/Data/DevHive.Data/Interfaces/Repositories/IPostRepository.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using DevHive.Data.Models; -using DevHive.Data.Repositories.Interfaces; - -namespace DevHive.Data.Interfaces.Repositories -{ - public interface IPostRepository : IRepository - { - Task AddNewPostToCreator(Guid userId, Post post); - - Task GetPostByCreatorAndTimeCreatedAsync(Guid issuerId, DateTime timeCreated); - Task> GetFileUrls(Guid postId); - - Task DoesPostExist(Guid postId); - Task DoesPostHaveFiles(Guid postId); - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Repositories/IRatingRepository.cs b/src/Data/DevHive.Data/Interfaces/Repositories/IRatingRepository.cs deleted file mode 100644 index f77f301..0000000 --- a/src/Data/DevHive.Data/Interfaces/Repositories/IRatingRepository.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Threading.Tasks; -using DevHive.Data.Models; -using DevHive.Data.Repositories.Interfaces; - -namespace DevHive.Data.Interfaces.Repositories -{ - public interface IRatingRepository : IRepository - { - Task GetRatingByPostId(Guid postId); - Task UserRatedPost(Guid userId, Guid postId); - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Repositories/IRepository.cs b/src/Data/DevHive.Data/Interfaces/Repositories/IRepository.cs deleted file mode 100644 index 0d11cd3..0000000 --- a/src/Data/DevHive.Data/Interfaces/Repositories/IRepository.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Threading.Tasks; - -namespace DevHive.Data.Repositories.Interfaces -{ - public interface IRepository - where TEntity : class - { - //Add Entity to database - Task AddAsync(TEntity entity); - - //Find entity by id - Task GetByIdAsync(Guid id); - - //Modify Entity from database - Task EditAsync(Guid id, TEntity newEntity); - - //Delete Entity from database - Task DeleteAsync(TEntity entity); - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Repositories/IRoleRepository.cs b/src/Data/DevHive.Data/Interfaces/Repositories/IRoleRepository.cs deleted file mode 100644 index e834369..0000000 --- a/src/Data/DevHive.Data/Interfaces/Repositories/IRoleRepository.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Threading.Tasks; -using DevHive.Data.Models; -using DevHive.Data.Repositories.Interfaces; - -namespace DevHive.Data.Interfaces.Repositories -{ - public interface IRoleRepository : IRepository - { - Task GetByNameAsync(string name); - - Task DoesNameExist(string name); - Task DoesRoleExist(Guid id); - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Repositories/ITechnologyRepository.cs b/src/Data/DevHive.Data/Interfaces/Repositories/ITechnologyRepository.cs deleted file mode 100644 index 9126bfc..0000000 --- a/src/Data/DevHive.Data/Interfaces/Repositories/ITechnologyRepository.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using DevHive.Data.Models; -using DevHive.Data.Repositories.Interfaces; - -namespace DevHive.Data.Interfaces.Repositories -{ - public interface ITechnologyRepository : IRepository - { - Task GetByNameAsync(string name); - HashSet GetTechnologies(); - - Task DoesTechnologyExistAsync(Guid id); - Task DoesTechnologyNameExistAsync(string technologyName); - } -} diff --git a/src/Data/DevHive.Data/Interfaces/Repositories/IUserRepository.cs b/src/Data/DevHive.Data/Interfaces/Repositories/IUserRepository.cs deleted file mode 100644 index 5ebe3d3..0000000 --- a/src/Data/DevHive.Data/Interfaces/Repositories/IUserRepository.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using DevHive.Data.Models; -using DevHive.Data.Repositories.Interfaces; - -namespace DevHive.Data.Interfaces.Repositories -{ - public interface IUserRepository : IRepository - { - //Read - Task GetByUsernameAsync(string username); - Task UpdateProfilePicture(Guid userId, string pictureUrl); - - //Validations - Task ValidateFriendsCollectionAsync(List usernames); - Task DoesEmailExistAsync(string email); - Task DoesUserExistAsync(Guid id); - Task DoesUsernameExistAsync(string username); - bool DoesUserHaveThisUsername(Guid id, string username); - } -} diff --git a/src/DevHive.sln b/src/DevHive.sln index 73c5b85..05bdcda 100644 --- a/src/DevHive.sln +++ b/src/DevHive.sln @@ -1,40 +1,35 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30717.126 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 MinimumVisualStudioVersion = 15.0.26124.0 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2E5E3F99-7936-4F3B-974E-A98000D1564B}" - ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - EndProjectSection +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{0C2AC7A9-AC68-4668-B88E-9370C596F498}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web", "Web", "{2ED11F7C-A247-48F6-99ED-CD0AA89C6A28}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Data", "Data\DevHive.Data\DevHive.Data.csproj", "{70D0903D-C65F-4600-B6F8-F7BD00500A51}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Web", "Web\DevHive.Web\DevHive.Web.csproj", "{BD295280-3F69-4BDD-8715-526E9852930E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Data.Models", "Data\DevHive.Data.Models\DevHive.Data.Models.csproj", "{56F85916-3955-4558-8809-376D20902B94}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{C94823A0-150D-49E0-9913-628FB5D67370}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Data.Tests", "Data\DevHive.Data.Tests\DevHive.Data.Tests.csproj", "{F056B3F1-B72D-4935-87EA-F7BFEA96AFB0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Services", "Services\DevHive.Services\DevHive.Services.csproj", "{897281A2-C315-42DA-92CB-267DF91D8A4B}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{F2864A9D-70F1-452F-AAAC-AAFD8102ABAD}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{9A0158E8-834E-4B8C-B62B-2BF6FF0E3518}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Common", "Common\DevHive.Common.Models\DevHive.Common.csproj", "{5C3DFE9B-9690-475E-A0AE-D62315D38337}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Data", "Data\DevHive.Data\DevHive.Data.csproj", "{A28CAD8A-CDA9-42AD-8701-2DAE5D55EC9C}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{7CA79114-C359-4871-BFA7-0EA898B50AE4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Web.Tests", "Web\DevHive.Web.Tests\DevHive.Web.Tests.csproj", "{251A09C6-28CA-4E9E-B482-0B10ABE293FF}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Services", "Services\DevHive.Services\DevHive.Services.csproj", "{B5F22590-E3CE-4595-BE48-AA7F1797A6B8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Services.Tests", "Services\DevHive.Services.Tests\DevHive.Services.Tests.csproj", "{3E86ACCF-9F49-4D51-B152-4ACD6801211D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Services.Models", "Services\DevHive.Services.Models\DevHive.Services.Models.csproj", "{2FFF985B-A26F-443D-A159-62ED2FD5A2BC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Data.Tests", "Data\DevHive.Data.Tests\DevHive.Data.Tests.csproj", "{E6E401DC-43A0-4562-8584-4FA81FE0206C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Services.Tests", "Services\DevHive.Services.Tests\DevHive.Services.Tests.csproj", "{6E58003B-E5E8-4AA4-8F70-A9442BBFC110}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Web.Models", "Web\DevHive.Web.Models\DevHive.Web.Models.csproj", "{746A1043-A016-4CA6-953A-CECD02020E28}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web", "Web", "{768A592D-58EA-4CD3-A053-2E8F2DC7708A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Services.Models", "Services\DevHive.Services.Models\DevHive.Services.Models.csproj", "{2B1E8E07-9E8C-4FE5-ADA7-F67BCBDD1D17}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Web", "Web\DevHive.Web\DevHive.Web.csproj", "{A6D35BD9-A2A4-4937-89A8-DCB0D610B04A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Data.Models", "Data\DevHive.Data.Models\DevHive.Data.Models.csproj", "{7FFECB5A-E23F-44E0-A978-416DBF075406}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Web.Models", "Web\DevHive.Web.Models\DevHive.Web.Models.csproj", "{D8C898F7-A0DE-4939-8708-3D4A5C383EFC}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{2C2D8ED7-CBBF-4E79-AC21-C932C6FA651B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Common", "Common\DevHive.Common.Models\DevHive.Common.csproj", "{34E78E35-2476-4925-864A-467C2BC5042B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevHive.Web.Tests", "Web\DevHive.Web.Tests\DevHive.Web.Tests.csproj", "{608273FF-01ED-48B3-B912-66CCDBF5572E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -45,144 +40,141 @@ Global Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BD295280-3F69-4BDD-8715-526E9852930E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BD295280-3F69-4BDD-8715-526E9852930E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BD295280-3F69-4BDD-8715-526E9852930E}.Debug|x64.ActiveCfg = Debug|Any CPU - {BD295280-3F69-4BDD-8715-526E9852930E}.Debug|x64.Build.0 = Debug|Any CPU - {BD295280-3F69-4BDD-8715-526E9852930E}.Debug|x86.ActiveCfg = Debug|Any CPU - {BD295280-3F69-4BDD-8715-526E9852930E}.Debug|x86.Build.0 = Debug|Any CPU - {BD295280-3F69-4BDD-8715-526E9852930E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BD295280-3F69-4BDD-8715-526E9852930E}.Release|Any CPU.Build.0 = Release|Any CPU - {BD295280-3F69-4BDD-8715-526E9852930E}.Release|x64.ActiveCfg = Release|Any CPU - {BD295280-3F69-4BDD-8715-526E9852930E}.Release|x64.Build.0 = Release|Any CPU - {BD295280-3F69-4BDD-8715-526E9852930E}.Release|x86.ActiveCfg = Release|Any CPU - {BD295280-3F69-4BDD-8715-526E9852930E}.Release|x86.Build.0 = Release|Any CPU - {897281A2-C315-42DA-92CB-267DF91D8A4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {897281A2-C315-42DA-92CB-267DF91D8A4B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {897281A2-C315-42DA-92CB-267DF91D8A4B}.Debug|x64.ActiveCfg = Debug|Any CPU - {897281A2-C315-42DA-92CB-267DF91D8A4B}.Debug|x64.Build.0 = Debug|Any CPU - {897281A2-C315-42DA-92CB-267DF91D8A4B}.Debug|x86.ActiveCfg = Debug|Any CPU - {897281A2-C315-42DA-92CB-267DF91D8A4B}.Debug|x86.Build.0 = Debug|Any CPU - {897281A2-C315-42DA-92CB-267DF91D8A4B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {897281A2-C315-42DA-92CB-267DF91D8A4B}.Release|Any CPU.Build.0 = Release|Any CPU - {897281A2-C315-42DA-92CB-267DF91D8A4B}.Release|x64.ActiveCfg = Release|Any CPU - {897281A2-C315-42DA-92CB-267DF91D8A4B}.Release|x64.Build.0 = Release|Any CPU - {897281A2-C315-42DA-92CB-267DF91D8A4B}.Release|x86.ActiveCfg = Release|Any CPU - {897281A2-C315-42DA-92CB-267DF91D8A4B}.Release|x86.Build.0 = Release|Any CPU - {A28CAD8A-CDA9-42AD-8701-2DAE5D55EC9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A28CAD8A-CDA9-42AD-8701-2DAE5D55EC9C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A28CAD8A-CDA9-42AD-8701-2DAE5D55EC9C}.Debug|x64.ActiveCfg = Debug|Any CPU - {A28CAD8A-CDA9-42AD-8701-2DAE5D55EC9C}.Debug|x64.Build.0 = Debug|Any CPU - {A28CAD8A-CDA9-42AD-8701-2DAE5D55EC9C}.Debug|x86.ActiveCfg = Debug|Any CPU - {A28CAD8A-CDA9-42AD-8701-2DAE5D55EC9C}.Debug|x86.Build.0 = Debug|Any CPU - {A28CAD8A-CDA9-42AD-8701-2DAE5D55EC9C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A28CAD8A-CDA9-42AD-8701-2DAE5D55EC9C}.Release|Any CPU.Build.0 = Release|Any CPU - {A28CAD8A-CDA9-42AD-8701-2DAE5D55EC9C}.Release|x64.ActiveCfg = Release|Any CPU - {A28CAD8A-CDA9-42AD-8701-2DAE5D55EC9C}.Release|x64.Build.0 = Release|Any CPU - {A28CAD8A-CDA9-42AD-8701-2DAE5D55EC9C}.Release|x86.ActiveCfg = Release|Any CPU - {A28CAD8A-CDA9-42AD-8701-2DAE5D55EC9C}.Release|x86.Build.0 = Release|Any CPU - {251A09C6-28CA-4E9E-B482-0B10ABE293FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {251A09C6-28CA-4E9E-B482-0B10ABE293FF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {251A09C6-28CA-4E9E-B482-0B10ABE293FF}.Debug|x64.ActiveCfg = Debug|Any CPU - {251A09C6-28CA-4E9E-B482-0B10ABE293FF}.Debug|x64.Build.0 = Debug|Any CPU - {251A09C6-28CA-4E9E-B482-0B10ABE293FF}.Debug|x86.ActiveCfg = Debug|Any CPU - {251A09C6-28CA-4E9E-B482-0B10ABE293FF}.Debug|x86.Build.0 = Debug|Any CPU - {251A09C6-28CA-4E9E-B482-0B10ABE293FF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {251A09C6-28CA-4E9E-B482-0B10ABE293FF}.Release|Any CPU.Build.0 = Release|Any CPU - {251A09C6-28CA-4E9E-B482-0B10ABE293FF}.Release|x64.ActiveCfg = Release|Any CPU - {251A09C6-28CA-4E9E-B482-0B10ABE293FF}.Release|x64.Build.0 = Release|Any CPU - {251A09C6-28CA-4E9E-B482-0B10ABE293FF}.Release|x86.ActiveCfg = Release|Any CPU - {251A09C6-28CA-4E9E-B482-0B10ABE293FF}.Release|x86.Build.0 = Release|Any CPU - {3E86ACCF-9F49-4D51-B152-4ACD6801211D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3E86ACCF-9F49-4D51-B152-4ACD6801211D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3E86ACCF-9F49-4D51-B152-4ACD6801211D}.Debug|x64.ActiveCfg = Debug|Any CPU - {3E86ACCF-9F49-4D51-B152-4ACD6801211D}.Debug|x64.Build.0 = Debug|Any CPU - {3E86ACCF-9F49-4D51-B152-4ACD6801211D}.Debug|x86.ActiveCfg = Debug|Any CPU - {3E86ACCF-9F49-4D51-B152-4ACD6801211D}.Debug|x86.Build.0 = Debug|Any CPU - {3E86ACCF-9F49-4D51-B152-4ACD6801211D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3E86ACCF-9F49-4D51-B152-4ACD6801211D}.Release|Any CPU.Build.0 = Release|Any CPU - {3E86ACCF-9F49-4D51-B152-4ACD6801211D}.Release|x64.ActiveCfg = Release|Any CPU - {3E86ACCF-9F49-4D51-B152-4ACD6801211D}.Release|x64.Build.0 = Release|Any CPU - {3E86ACCF-9F49-4D51-B152-4ACD6801211D}.Release|x86.ActiveCfg = Release|Any CPU - {3E86ACCF-9F49-4D51-B152-4ACD6801211D}.Release|x86.Build.0 = Release|Any CPU - {E6E401DC-43A0-4562-8584-4FA81FE0206C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E6E401DC-43A0-4562-8584-4FA81FE0206C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E6E401DC-43A0-4562-8584-4FA81FE0206C}.Debug|x64.ActiveCfg = Debug|Any CPU - {E6E401DC-43A0-4562-8584-4FA81FE0206C}.Debug|x64.Build.0 = Debug|Any CPU - {E6E401DC-43A0-4562-8584-4FA81FE0206C}.Debug|x86.ActiveCfg = Debug|Any CPU - {E6E401DC-43A0-4562-8584-4FA81FE0206C}.Debug|x86.Build.0 = Debug|Any CPU - {E6E401DC-43A0-4562-8584-4FA81FE0206C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E6E401DC-43A0-4562-8584-4FA81FE0206C}.Release|Any CPU.Build.0 = Release|Any CPU - {E6E401DC-43A0-4562-8584-4FA81FE0206C}.Release|x64.ActiveCfg = Release|Any CPU - {E6E401DC-43A0-4562-8584-4FA81FE0206C}.Release|x64.Build.0 = Release|Any CPU - {E6E401DC-43A0-4562-8584-4FA81FE0206C}.Release|x86.ActiveCfg = Release|Any CPU - {E6E401DC-43A0-4562-8584-4FA81FE0206C}.Release|x86.Build.0 = Release|Any CPU - {746A1043-A016-4CA6-953A-CECD02020E28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {746A1043-A016-4CA6-953A-CECD02020E28}.Debug|Any CPU.Build.0 = Debug|Any CPU - {746A1043-A016-4CA6-953A-CECD02020E28}.Debug|x64.ActiveCfg = Debug|Any CPU - {746A1043-A016-4CA6-953A-CECD02020E28}.Debug|x64.Build.0 = Debug|Any CPU - {746A1043-A016-4CA6-953A-CECD02020E28}.Debug|x86.ActiveCfg = Debug|Any CPU - {746A1043-A016-4CA6-953A-CECD02020E28}.Debug|x86.Build.0 = Debug|Any CPU - {746A1043-A016-4CA6-953A-CECD02020E28}.Release|Any CPU.ActiveCfg = Release|Any CPU - {746A1043-A016-4CA6-953A-CECD02020E28}.Release|Any CPU.Build.0 = Release|Any CPU - {746A1043-A016-4CA6-953A-CECD02020E28}.Release|x64.ActiveCfg = Release|Any CPU - {746A1043-A016-4CA6-953A-CECD02020E28}.Release|x64.Build.0 = Release|Any CPU - {746A1043-A016-4CA6-953A-CECD02020E28}.Release|x86.ActiveCfg = Release|Any CPU - {746A1043-A016-4CA6-953A-CECD02020E28}.Release|x86.Build.0 = Release|Any CPU - {2B1E8E07-9E8C-4FE5-ADA7-F67BCBDD1D17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2B1E8E07-9E8C-4FE5-ADA7-F67BCBDD1D17}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2B1E8E07-9E8C-4FE5-ADA7-F67BCBDD1D17}.Debug|x64.ActiveCfg = Debug|Any CPU - {2B1E8E07-9E8C-4FE5-ADA7-F67BCBDD1D17}.Debug|x64.Build.0 = Debug|Any CPU - {2B1E8E07-9E8C-4FE5-ADA7-F67BCBDD1D17}.Debug|x86.ActiveCfg = Debug|Any CPU - {2B1E8E07-9E8C-4FE5-ADA7-F67BCBDD1D17}.Debug|x86.Build.0 = Debug|Any CPU - {2B1E8E07-9E8C-4FE5-ADA7-F67BCBDD1D17}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2B1E8E07-9E8C-4FE5-ADA7-F67BCBDD1D17}.Release|Any CPU.Build.0 = Release|Any CPU - {2B1E8E07-9E8C-4FE5-ADA7-F67BCBDD1D17}.Release|x64.ActiveCfg = Release|Any CPU - {2B1E8E07-9E8C-4FE5-ADA7-F67BCBDD1D17}.Release|x64.Build.0 = Release|Any CPU - {2B1E8E07-9E8C-4FE5-ADA7-F67BCBDD1D17}.Release|x86.ActiveCfg = Release|Any CPU - {2B1E8E07-9E8C-4FE5-ADA7-F67BCBDD1D17}.Release|x86.Build.0 = Release|Any CPU - {7FFECB5A-E23F-44E0-A978-416DBF075406}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7FFECB5A-E23F-44E0-A978-416DBF075406}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7FFECB5A-E23F-44E0-A978-416DBF075406}.Debug|x64.ActiveCfg = Debug|Any CPU - {7FFECB5A-E23F-44E0-A978-416DBF075406}.Debug|x64.Build.0 = Debug|Any CPU - {7FFECB5A-E23F-44E0-A978-416DBF075406}.Debug|x86.ActiveCfg = Debug|Any CPU - {7FFECB5A-E23F-44E0-A978-416DBF075406}.Debug|x86.Build.0 = Debug|Any CPU - {7FFECB5A-E23F-44E0-A978-416DBF075406}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7FFECB5A-E23F-44E0-A978-416DBF075406}.Release|Any CPU.Build.0 = Release|Any CPU - {7FFECB5A-E23F-44E0-A978-416DBF075406}.Release|x64.ActiveCfg = Release|Any CPU - {7FFECB5A-E23F-44E0-A978-416DBF075406}.Release|x64.Build.0 = Release|Any CPU - {7FFECB5A-E23F-44E0-A978-416DBF075406}.Release|x86.ActiveCfg = Release|Any CPU - {7FFECB5A-E23F-44E0-A978-416DBF075406}.Release|x86.Build.0 = Release|Any CPU - {34E78E35-2476-4925-864A-467C2BC5042B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {34E78E35-2476-4925-864A-467C2BC5042B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {34E78E35-2476-4925-864A-467C2BC5042B}.Debug|x64.ActiveCfg = Debug|Any CPU - {34E78E35-2476-4925-864A-467C2BC5042B}.Debug|x64.Build.0 = Debug|Any CPU - {34E78E35-2476-4925-864A-467C2BC5042B}.Debug|x86.ActiveCfg = Debug|Any CPU - {34E78E35-2476-4925-864A-467C2BC5042B}.Debug|x86.Build.0 = Debug|Any CPU - {34E78E35-2476-4925-864A-467C2BC5042B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {34E78E35-2476-4925-864A-467C2BC5042B}.Release|Any CPU.Build.0 = Release|Any CPU - {34E78E35-2476-4925-864A-467C2BC5042B}.Release|x64.ActiveCfg = Release|Any CPU - {34E78E35-2476-4925-864A-467C2BC5042B}.Release|x64.Build.0 = Release|Any CPU - {34E78E35-2476-4925-864A-467C2BC5042B}.Release|x86.ActiveCfg = Release|Any CPU - {34E78E35-2476-4925-864A-467C2BC5042B}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {BD295280-3F69-4BDD-8715-526E9852930E} = {2ED11F7C-A247-48F6-99ED-CD0AA89C6A28} - {897281A2-C315-42DA-92CB-267DF91D8A4B} = {C94823A0-150D-49E0-9913-628FB5D67370} - {A28CAD8A-CDA9-42AD-8701-2DAE5D55EC9C} = {9A0158E8-834E-4B8C-B62B-2BF6FF0E3518} - {251A09C6-28CA-4E9E-B482-0B10ABE293FF} = {2ED11F7C-A247-48F6-99ED-CD0AA89C6A28} - {3E86ACCF-9F49-4D51-B152-4ACD6801211D} = {C94823A0-150D-49E0-9913-628FB5D67370} - {E6E401DC-43A0-4562-8584-4FA81FE0206C} = {9A0158E8-834E-4B8C-B62B-2BF6FF0E3518} - {746A1043-A016-4CA6-953A-CECD02020E28} = {2ED11F7C-A247-48F6-99ED-CD0AA89C6A28} - {2B1E8E07-9E8C-4FE5-ADA7-F67BCBDD1D17} = {C94823A0-150D-49E0-9913-628FB5D67370} - {7FFECB5A-E23F-44E0-A978-416DBF075406} = {9A0158E8-834E-4B8C-B62B-2BF6FF0E3518} - {34E78E35-2476-4925-864A-467C2BC5042B} = {2C2D8ED7-CBBF-4E79-AC21-C932C6FA651B} + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {70D0903D-C65F-4600-B6F8-F7BD00500A51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {70D0903D-C65F-4600-B6F8-F7BD00500A51}.Debug|Any CPU.Build.0 = Debug|Any CPU + {70D0903D-C65F-4600-B6F8-F7BD00500A51}.Debug|x64.ActiveCfg = Debug|Any CPU + {70D0903D-C65F-4600-B6F8-F7BD00500A51}.Debug|x64.Build.0 = Debug|Any CPU + {70D0903D-C65F-4600-B6F8-F7BD00500A51}.Debug|x86.ActiveCfg = Debug|Any CPU + {70D0903D-C65F-4600-B6F8-F7BD00500A51}.Debug|x86.Build.0 = Debug|Any CPU + {70D0903D-C65F-4600-B6F8-F7BD00500A51}.Release|Any CPU.ActiveCfg = Release|Any CPU + {70D0903D-C65F-4600-B6F8-F7BD00500A51}.Release|Any CPU.Build.0 = Release|Any CPU + {70D0903D-C65F-4600-B6F8-F7BD00500A51}.Release|x64.ActiveCfg = Release|Any CPU + {70D0903D-C65F-4600-B6F8-F7BD00500A51}.Release|x64.Build.0 = Release|Any CPU + {70D0903D-C65F-4600-B6F8-F7BD00500A51}.Release|x86.ActiveCfg = Release|Any CPU + {70D0903D-C65F-4600-B6F8-F7BD00500A51}.Release|x86.Build.0 = Release|Any CPU + {56F85916-3955-4558-8809-376D20902B94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {56F85916-3955-4558-8809-376D20902B94}.Debug|Any CPU.Build.0 = Debug|Any CPU + {56F85916-3955-4558-8809-376D20902B94}.Debug|x64.ActiveCfg = Debug|Any CPU + {56F85916-3955-4558-8809-376D20902B94}.Debug|x64.Build.0 = Debug|Any CPU + {56F85916-3955-4558-8809-376D20902B94}.Debug|x86.ActiveCfg = Debug|Any CPU + {56F85916-3955-4558-8809-376D20902B94}.Debug|x86.Build.0 = Debug|Any CPU + {56F85916-3955-4558-8809-376D20902B94}.Release|Any CPU.ActiveCfg = Release|Any CPU + {56F85916-3955-4558-8809-376D20902B94}.Release|Any CPU.Build.0 = Release|Any CPU + {56F85916-3955-4558-8809-376D20902B94}.Release|x64.ActiveCfg = Release|Any CPU + {56F85916-3955-4558-8809-376D20902B94}.Release|x64.Build.0 = Release|Any CPU + {56F85916-3955-4558-8809-376D20902B94}.Release|x86.ActiveCfg = Release|Any CPU + {56F85916-3955-4558-8809-376D20902B94}.Release|x86.Build.0 = Release|Any CPU + {F056B3F1-B72D-4935-87EA-F7BFEA96AFB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F056B3F1-B72D-4935-87EA-F7BFEA96AFB0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F056B3F1-B72D-4935-87EA-F7BFEA96AFB0}.Debug|x64.ActiveCfg = Debug|Any CPU + {F056B3F1-B72D-4935-87EA-F7BFEA96AFB0}.Debug|x64.Build.0 = Debug|Any CPU + {F056B3F1-B72D-4935-87EA-F7BFEA96AFB0}.Debug|x86.ActiveCfg = Debug|Any CPU + {F056B3F1-B72D-4935-87EA-F7BFEA96AFB0}.Debug|x86.Build.0 = Debug|Any CPU + {F056B3F1-B72D-4935-87EA-F7BFEA96AFB0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F056B3F1-B72D-4935-87EA-F7BFEA96AFB0}.Release|Any CPU.Build.0 = Release|Any CPU + {F056B3F1-B72D-4935-87EA-F7BFEA96AFB0}.Release|x64.ActiveCfg = Release|Any CPU + {F056B3F1-B72D-4935-87EA-F7BFEA96AFB0}.Release|x64.Build.0 = Release|Any CPU + {F056B3F1-B72D-4935-87EA-F7BFEA96AFB0}.Release|x86.ActiveCfg = Release|Any CPU + {F056B3F1-B72D-4935-87EA-F7BFEA96AFB0}.Release|x86.Build.0 = Release|Any CPU + {5C3DFE9B-9690-475E-A0AE-D62315D38337}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5C3DFE9B-9690-475E-A0AE-D62315D38337}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5C3DFE9B-9690-475E-A0AE-D62315D38337}.Debug|x64.ActiveCfg = Debug|Any CPU + {5C3DFE9B-9690-475E-A0AE-D62315D38337}.Debug|x64.Build.0 = Debug|Any CPU + {5C3DFE9B-9690-475E-A0AE-D62315D38337}.Debug|x86.ActiveCfg = Debug|Any CPU + {5C3DFE9B-9690-475E-A0AE-D62315D38337}.Debug|x86.Build.0 = Debug|Any CPU + {5C3DFE9B-9690-475E-A0AE-D62315D38337}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5C3DFE9B-9690-475E-A0AE-D62315D38337}.Release|Any CPU.Build.0 = Release|Any CPU + {5C3DFE9B-9690-475E-A0AE-D62315D38337}.Release|x64.ActiveCfg = Release|Any CPU + {5C3DFE9B-9690-475E-A0AE-D62315D38337}.Release|x64.Build.0 = Release|Any CPU + {5C3DFE9B-9690-475E-A0AE-D62315D38337}.Release|x86.ActiveCfg = Release|Any CPU + {5C3DFE9B-9690-475E-A0AE-D62315D38337}.Release|x86.Build.0 = Release|Any CPU + {B5F22590-E3CE-4595-BE48-AA7F1797A6B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B5F22590-E3CE-4595-BE48-AA7F1797A6B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B5F22590-E3CE-4595-BE48-AA7F1797A6B8}.Debug|x64.ActiveCfg = Debug|Any CPU + {B5F22590-E3CE-4595-BE48-AA7F1797A6B8}.Debug|x64.Build.0 = Debug|Any CPU + {B5F22590-E3CE-4595-BE48-AA7F1797A6B8}.Debug|x86.ActiveCfg = Debug|Any CPU + {B5F22590-E3CE-4595-BE48-AA7F1797A6B8}.Debug|x86.Build.0 = Debug|Any CPU + {B5F22590-E3CE-4595-BE48-AA7F1797A6B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B5F22590-E3CE-4595-BE48-AA7F1797A6B8}.Release|Any CPU.Build.0 = Release|Any CPU + {B5F22590-E3CE-4595-BE48-AA7F1797A6B8}.Release|x64.ActiveCfg = Release|Any CPU + {B5F22590-E3CE-4595-BE48-AA7F1797A6B8}.Release|x64.Build.0 = Release|Any CPU + {B5F22590-E3CE-4595-BE48-AA7F1797A6B8}.Release|x86.ActiveCfg = Release|Any CPU + {B5F22590-E3CE-4595-BE48-AA7F1797A6B8}.Release|x86.Build.0 = Release|Any CPU + {2FFF985B-A26F-443D-A159-62ED2FD5A2BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2FFF985B-A26F-443D-A159-62ED2FD5A2BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2FFF985B-A26F-443D-A159-62ED2FD5A2BC}.Debug|x64.ActiveCfg = Debug|Any CPU + {2FFF985B-A26F-443D-A159-62ED2FD5A2BC}.Debug|x64.Build.0 = Debug|Any CPU + {2FFF985B-A26F-443D-A159-62ED2FD5A2BC}.Debug|x86.ActiveCfg = Debug|Any CPU + {2FFF985B-A26F-443D-A159-62ED2FD5A2BC}.Debug|x86.Build.0 = Debug|Any CPU + {2FFF985B-A26F-443D-A159-62ED2FD5A2BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2FFF985B-A26F-443D-A159-62ED2FD5A2BC}.Release|Any CPU.Build.0 = Release|Any CPU + {2FFF985B-A26F-443D-A159-62ED2FD5A2BC}.Release|x64.ActiveCfg = Release|Any CPU + {2FFF985B-A26F-443D-A159-62ED2FD5A2BC}.Release|x64.Build.0 = Release|Any CPU + {2FFF985B-A26F-443D-A159-62ED2FD5A2BC}.Release|x86.ActiveCfg = Release|Any CPU + {2FFF985B-A26F-443D-A159-62ED2FD5A2BC}.Release|x86.Build.0 = Release|Any CPU + {6E58003B-E5E8-4AA4-8F70-A9442BBFC110}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6E58003B-E5E8-4AA4-8F70-A9442BBFC110}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6E58003B-E5E8-4AA4-8F70-A9442BBFC110}.Debug|x64.ActiveCfg = Debug|Any CPU + {6E58003B-E5E8-4AA4-8F70-A9442BBFC110}.Debug|x64.Build.0 = Debug|Any CPU + {6E58003B-E5E8-4AA4-8F70-A9442BBFC110}.Debug|x86.ActiveCfg = Debug|Any CPU + {6E58003B-E5E8-4AA4-8F70-A9442BBFC110}.Debug|x86.Build.0 = Debug|Any CPU + {6E58003B-E5E8-4AA4-8F70-A9442BBFC110}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6E58003B-E5E8-4AA4-8F70-A9442BBFC110}.Release|Any CPU.Build.0 = Release|Any CPU + {6E58003B-E5E8-4AA4-8F70-A9442BBFC110}.Release|x64.ActiveCfg = Release|Any CPU + {6E58003B-E5E8-4AA4-8F70-A9442BBFC110}.Release|x64.Build.0 = Release|Any CPU + {6E58003B-E5E8-4AA4-8F70-A9442BBFC110}.Release|x86.ActiveCfg = Release|Any CPU + {6E58003B-E5E8-4AA4-8F70-A9442BBFC110}.Release|x86.Build.0 = Release|Any CPU + {A6D35BD9-A2A4-4937-89A8-DCB0D610B04A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A6D35BD9-A2A4-4937-89A8-DCB0D610B04A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A6D35BD9-A2A4-4937-89A8-DCB0D610B04A}.Debug|x64.ActiveCfg = Debug|Any CPU + {A6D35BD9-A2A4-4937-89A8-DCB0D610B04A}.Debug|x64.Build.0 = Debug|Any CPU + {A6D35BD9-A2A4-4937-89A8-DCB0D610B04A}.Debug|x86.ActiveCfg = Debug|Any CPU + {A6D35BD9-A2A4-4937-89A8-DCB0D610B04A}.Debug|x86.Build.0 = Debug|Any CPU + {A6D35BD9-A2A4-4937-89A8-DCB0D610B04A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A6D35BD9-A2A4-4937-89A8-DCB0D610B04A}.Release|Any CPU.Build.0 = Release|Any CPU + {A6D35BD9-A2A4-4937-89A8-DCB0D610B04A}.Release|x64.ActiveCfg = Release|Any CPU + {A6D35BD9-A2A4-4937-89A8-DCB0D610B04A}.Release|x64.Build.0 = Release|Any CPU + {A6D35BD9-A2A4-4937-89A8-DCB0D610B04A}.Release|x86.ActiveCfg = Release|Any CPU + {A6D35BD9-A2A4-4937-89A8-DCB0D610B04A}.Release|x86.Build.0 = Release|Any CPU + {D8C898F7-A0DE-4939-8708-3D4A5C383EFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D8C898F7-A0DE-4939-8708-3D4A5C383EFC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D8C898F7-A0DE-4939-8708-3D4A5C383EFC}.Debug|x64.ActiveCfg = Debug|Any CPU + {D8C898F7-A0DE-4939-8708-3D4A5C383EFC}.Debug|x64.Build.0 = Debug|Any CPU + {D8C898F7-A0DE-4939-8708-3D4A5C383EFC}.Debug|x86.ActiveCfg = Debug|Any CPU + {D8C898F7-A0DE-4939-8708-3D4A5C383EFC}.Debug|x86.Build.0 = Debug|Any CPU + {D8C898F7-A0DE-4939-8708-3D4A5C383EFC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D8C898F7-A0DE-4939-8708-3D4A5C383EFC}.Release|Any CPU.Build.0 = Release|Any CPU + {D8C898F7-A0DE-4939-8708-3D4A5C383EFC}.Release|x64.ActiveCfg = Release|Any CPU + {D8C898F7-A0DE-4939-8708-3D4A5C383EFC}.Release|x64.Build.0 = Release|Any CPU + {D8C898F7-A0DE-4939-8708-3D4A5C383EFC}.Release|x86.ActiveCfg = Release|Any CPU + {D8C898F7-A0DE-4939-8708-3D4A5C383EFC}.Release|x86.Build.0 = Release|Any CPU + {608273FF-01ED-48B3-B912-66CCDBF5572E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {608273FF-01ED-48B3-B912-66CCDBF5572E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {608273FF-01ED-48B3-B912-66CCDBF5572E}.Debug|x64.ActiveCfg = Debug|Any CPU + {608273FF-01ED-48B3-B912-66CCDBF5572E}.Debug|x64.Build.0 = Debug|Any CPU + {608273FF-01ED-48B3-B912-66CCDBF5572E}.Debug|x86.ActiveCfg = Debug|Any CPU + {608273FF-01ED-48B3-B912-66CCDBF5572E}.Debug|x86.Build.0 = Debug|Any CPU + {608273FF-01ED-48B3-B912-66CCDBF5572E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {608273FF-01ED-48B3-B912-66CCDBF5572E}.Release|Any CPU.Build.0 = Release|Any CPU + {608273FF-01ED-48B3-B912-66CCDBF5572E}.Release|x64.ActiveCfg = Release|Any CPU + {608273FF-01ED-48B3-B912-66CCDBF5572E}.Release|x64.Build.0 = Release|Any CPU + {608273FF-01ED-48B3-B912-66CCDBF5572E}.Release|x86.ActiveCfg = Release|Any CPU + {608273FF-01ED-48B3-B912-66CCDBF5572E}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {0F5395E8-26FB-40FD-83A1-EE7766C5E398} + GlobalSection(NestedProjects) = preSolution + {70D0903D-C65F-4600-B6F8-F7BD00500A51} = {0C2AC7A9-AC68-4668-B88E-9370C596F498} + {56F85916-3955-4558-8809-376D20902B94} = {0C2AC7A9-AC68-4668-B88E-9370C596F498} + {F056B3F1-B72D-4935-87EA-F7BFEA96AFB0} = {0C2AC7A9-AC68-4668-B88E-9370C596F498} + {5C3DFE9B-9690-475E-A0AE-D62315D38337} = {F2864A9D-70F1-452F-AAAC-AAFD8102ABAD} + {B5F22590-E3CE-4595-BE48-AA7F1797A6B8} = {7CA79114-C359-4871-BFA7-0EA898B50AE4} + {2FFF985B-A26F-443D-A159-62ED2FD5A2BC} = {7CA79114-C359-4871-BFA7-0EA898B50AE4} + {6E58003B-E5E8-4AA4-8F70-A9442BBFC110} = {7CA79114-C359-4871-BFA7-0EA898B50AE4} + {A6D35BD9-A2A4-4937-89A8-DCB0D610B04A} = {768A592D-58EA-4CD3-A053-2E8F2DC7708A} + {D8C898F7-A0DE-4939-8708-3D4A5C383EFC} = {768A592D-58EA-4CD3-A053-2E8F2DC7708A} + {608273FF-01ED-48B3-B912-66CCDBF5572E} = {768A592D-58EA-4CD3-A053-2E8F2DC7708A} EndGlobalSection EndGlobal diff --git a/src/Services/DevHive.Services.Models/DevHive.Services.Models.csproj b/src/Services/DevHive.Services.Models/DevHive.Services.Models.csproj index ebf5f9c..744a855 100644 --- a/src/Services/DevHive.Services.Models/DevHive.Services.Models.csproj +++ b/src/Services/DevHive.Services.Models/DevHive.Services.Models.csproj @@ -1,11 +1,9 @@ - net5.0 - + - diff --git a/src/Services/DevHive.Services.Models/Identity/Role/CreateRoleServiceModel.cs b/src/Services/DevHive.Services.Models/Identity/Role/CreateRoleServiceModel.cs deleted file mode 100644 index 3bed3fd..0000000 --- a/src/Services/DevHive.Services.Models/Identity/Role/CreateRoleServiceModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; - -namespace DevHive.Services.Models.Identity.Role -{ - public class CreateRoleServiceModel - { - public string Name { get; set; } - } -} diff --git a/src/Services/DevHive.Services.Models/Identity/Role/RoleServiceModel.cs b/src/Services/DevHive.Services.Models/Identity/Role/RoleServiceModel.cs deleted file mode 100644 index 07249fe..0000000 --- a/src/Services/DevHive.Services.Models/Identity/Role/RoleServiceModel.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace DevHive.Services.Models.Identity.Role -{ - public class RoleServiceModel - { - public string Name { get; set; } - } -} diff --git a/src/Services/DevHive.Services.Models/Identity/Role/UpdateRoleServiceModel.cs b/src/Services/DevHive.Services.Models/Identity/Role/UpdateRoleServiceModel.cs deleted file mode 100644 index e21e6b4..0000000 --- a/src/Services/DevHive.Services.Models/Identity/Role/UpdateRoleServiceModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace DevHive.Services.Models.Identity.Role -{ - public class UpdateRoleServiceModel - { - public Guid Id { get; set; } - public string Name { get; set; } - } -} diff --git a/src/Services/DevHive.Services.Models/Identity/User/BaseUserServiceModel.cs b/src/Services/DevHive.Services.Models/Identity/User/BaseUserServiceModel.cs deleted file mode 100644 index 514f82a..0000000 --- a/src/Services/DevHive.Services.Models/Identity/User/BaseUserServiceModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace DevHive.Services.Models.Identity.User -{ - public class BaseUserServiceModel - { - public string UserName { get; set; } - public string Email { get; set; } - public string FirstName { get; set; } - public string LastName { get; set; } - } -} diff --git a/src/Services/DevHive.Services.Models/Identity/User/FriendServiceModel.cs b/src/Services/DevHive.Services.Models/Identity/User/FriendServiceModel.cs deleted file mode 100644 index a784f5c..0000000 --- a/src/Services/DevHive.Services.Models/Identity/User/FriendServiceModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace DevHive.Services.Models.Identity.User -{ - public class FriendServiceModel - { - public Guid Id { get; set; } - public string UserName { get; set; } - } -} diff --git a/src/Services/DevHive.Services.Models/Identity/User/LoginServiceModel.cs b/src/Services/DevHive.Services.Models/Identity/User/LoginServiceModel.cs deleted file mode 100644 index 4d53283..0000000 --- a/src/Services/DevHive.Services.Models/Identity/User/LoginServiceModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace DevHive.Services.Models.Identity.User -{ - public class LoginServiceModel - { - public string UserName { get; set; } - public string Password { get; set; } - } -} diff --git a/src/Services/DevHive.Services.Models/Identity/User/ProfilePictureServiceModel.cs b/src/Services/DevHive.Services.Models/Identity/User/ProfilePictureServiceModel.cs deleted file mode 100644 index ad81057..0000000 --- a/src/Services/DevHive.Services.Models/Identity/User/ProfilePictureServiceModel.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace DevHive.Services.Models.Identity.User -{ - public class ProfilePictureServiceModel - { - public string ProfilePictureURL { get; set; } - } -} diff --git a/src/Services/DevHive.Services.Models/Identity/User/RegisterServiceModel.cs b/src/Services/DevHive.Services.Models/Identity/User/RegisterServiceModel.cs deleted file mode 100644 index adc4119..0000000 --- a/src/Services/DevHive.Services.Models/Identity/User/RegisterServiceModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Collections.Generic; -using DevHive.Services.Models.Language; -using DevHive.Services.Models.Technology; - -namespace DevHive.Services.Models.Identity.User -{ - public class RegisterServiceModel : BaseUserServiceModel - { - public string Password { get; set; } - - public HashSet Languages { get; set; } - - public HashSet Technologies { get; set; } - } -} diff --git a/src/Services/DevHive.Services.Models/Identity/User/UpdateFriendServiceModel.cs b/src/Services/DevHive.Services.Models/Identity/User/UpdateFriendServiceModel.cs deleted file mode 100644 index b0efe10..0000000 --- a/src/Services/DevHive.Services.Models/Identity/User/UpdateFriendServiceModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace DevHive.Services.Models.Identity.User -{ - public class UpdateFriendServiceModel - { - public Guid Id { get; set; } - public string UserName { get; set; } - } -} diff --git a/src/Services/DevHive.Services.Models/Identity/User/UpdateProfilePictureServiceModel.cs b/src/Services/DevHive.Services.Models/Identity/User/UpdateProfilePictureServiceModel.cs deleted file mode 100644 index 8563953..0000000 --- a/src/Services/DevHive.Services.Models/Identity/User/UpdateProfilePictureServiceModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using Microsoft.AspNetCore.Http; - -namespace DevHive.Services.Models.Identity.User -{ - public class UpdateProfilePictureServiceModel - { - public Guid UserId { get; set; } - - public IFormFile Picture { get; set; } - } -} diff --git a/src/Services/DevHive.Services.Models/Identity/User/UpdateUserServiceModel.cs b/src/Services/DevHive.Services.Models/Identity/User/UpdateUserServiceModel.cs deleted file mode 100644 index b4e4400..0000000 --- a/src/Services/DevHive.Services.Models/Identity/User/UpdateUserServiceModel.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using DevHive.Services.Models.Identity.Role; -using DevHive.Services.Models.Language; -using DevHive.Services.Models.Technology; - -namespace DevHive.Services.Models.Identity.User -{ - public class UpdateUserServiceModel : BaseUserServiceModel - { - public Guid Id { get; set; } - - public string Password { get; set; } - - public string ProfilePictureURL { get; set; } - - public HashSet Roles { get; set; } = new HashSet(); - - public HashSet Friends { get; set; } = new HashSet(); - - public HashSet Languages { get; set; } = new HashSet(); - - public HashSet Technologies { get; set; } = new HashSet(); - - } -} diff --git a/src/Services/DevHive.Services.Models/Identity/User/UserServiceModel.cs b/src/Services/DevHive.Services.Models/Identity/User/UserServiceModel.cs deleted file mode 100644 index ac7bba2..0000000 --- a/src/Services/DevHive.Services.Models/Identity/User/UserServiceModel.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections.Generic; -using DevHive.Common.Models.Misc; -using DevHive.Services.Models.Identity.Role; -using DevHive.Services.Models.Language; -using DevHive.Services.Models.Technology; - -namespace DevHive.Services.Models.Identity.User -{ - public class UserServiceModel : BaseUserServiceModel - { - public string ProfilePictureURL { get; set; } - - public HashSet Roles { get; set; } = new(); - - public HashSet Friends { get; set; } = new(); - - public HashSet Languages { get; set; } = new(); - - public HashSet Technologies { get; set; } = new(); - - public List Posts { get; set; } = new(); - } -} diff --git a/src/Services/DevHive.Services.Models/Role/CreateRoleServiceModel.cs b/src/Services/DevHive.Services.Models/Role/CreateRoleServiceModel.cs new file mode 100644 index 0000000..8b03c65 --- /dev/null +++ b/src/Services/DevHive.Services.Models/Role/CreateRoleServiceModel.cs @@ -0,0 +1,10 @@ +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; + +namespace DevHive.Services.Models.Role +{ + public class CreateRoleServiceModel + { + public string Name { get; set; } + } +} diff --git a/src/Services/DevHive.Services.Models/Role/RoleServiceModel.cs b/src/Services/DevHive.Services.Models/Role/RoleServiceModel.cs new file mode 100644 index 0000000..77ca954 --- /dev/null +++ b/src/Services/DevHive.Services.Models/Role/RoleServiceModel.cs @@ -0,0 +1,7 @@ +namespace DevHive.Services.Models.Role +{ + public class RoleServiceModel + { + public string Name { get; set; } + } +} diff --git a/src/Services/DevHive.Services.Models/Role/UpdateRoleServiceModel.cs b/src/Services/DevHive.Services.Models/Role/UpdateRoleServiceModel.cs new file mode 100644 index 0000000..9b8fbfe --- /dev/null +++ b/src/Services/DevHive.Services.Models/Role/UpdateRoleServiceModel.cs @@ -0,0 +1,10 @@ +using System; + +namespace DevHive.Services.Models.Role +{ + public class UpdateRoleServiceModel + { + public Guid Id { get; set; } + public string Name { get; set; } + } +} diff --git a/src/Services/DevHive.Services.Models/User/BaseUserServiceModel.cs b/src/Services/DevHive.Services.Models/User/BaseUserServiceModel.cs new file mode 100644 index 0000000..5c3dc6b --- /dev/null +++ b/src/Services/DevHive.Services.Models/User/BaseUserServiceModel.cs @@ -0,0 +1,10 @@ +namespace DevHive.Services.Models.User +{ + public class BaseUserServiceModel + { + public string UserName { get; set; } + public string Email { get; set; } + public string FirstName { get; set; } + public string LastName { get; set; } + } +} diff --git a/src/Services/DevHive.Services.Models/User/FriendServiceModel.cs b/src/Services/DevHive.Services.Models/User/FriendServiceModel.cs new file mode 100644 index 0000000..2241886 --- /dev/null +++ b/src/Services/DevHive.Services.Models/User/FriendServiceModel.cs @@ -0,0 +1,10 @@ +using System; + +namespace DevHive.Services.Models.User +{ + public class FriendServiceModel + { + public Guid Id { get; set; } + public string UserName { get; set; } + } +} diff --git a/src/Services/DevHive.Services.Models/User/LoginServiceModel.cs b/src/Services/DevHive.Services.Models/User/LoginServiceModel.cs new file mode 100644 index 0000000..6a0d128 --- /dev/null +++ b/src/Services/DevHive.Services.Models/User/LoginServiceModel.cs @@ -0,0 +1,8 @@ +namespace DevHive.Services.Models.User +{ + public class LoginServiceModel + { + public string UserName { get; set; } + public string Password { get; set; } + } +} diff --git a/src/Services/DevHive.Services.Models/User/ProfilePictureServiceModel.cs b/src/Services/DevHive.Services.Models/User/ProfilePictureServiceModel.cs new file mode 100644 index 0000000..cbe64b2 --- /dev/null +++ b/src/Services/DevHive.Services.Models/User/ProfilePictureServiceModel.cs @@ -0,0 +1,7 @@ +namespace DevHive.Services.Models.User +{ + public class ProfilePictureServiceModel + { + public string ProfilePictureURL { get; set; } + } +} diff --git a/src/Services/DevHive.Services.Models/User/RegisterServiceModel.cs b/src/Services/DevHive.Services.Models/User/RegisterServiceModel.cs new file mode 100644 index 0000000..5852d46 --- /dev/null +++ b/src/Services/DevHive.Services.Models/User/RegisterServiceModel.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using DevHive.Services.Models.Language; +using DevHive.Services.Models.Technology; + +namespace DevHive.Services.Models.User +{ + public class RegisterServiceModel : BaseUserServiceModel + { + public string Password { get; set; } + + public HashSet Languages { get; set; } + + public HashSet Technologies { get; set; } + } +} diff --git a/src/Services/DevHive.Services.Models/User/UpdateFriendServiceModel.cs b/src/Services/DevHive.Services.Models/User/UpdateFriendServiceModel.cs new file mode 100644 index 0000000..0d7a8c1 --- /dev/null +++ b/src/Services/DevHive.Services.Models/User/UpdateFriendServiceModel.cs @@ -0,0 +1,10 @@ +using System; + +namespace DevHive.Services.Models.User +{ + public class UpdateFriendServiceModel + { + public Guid Id { get; set; } + public string UserName { get; set; } + } +} diff --git a/src/Services/DevHive.Services.Models/User/UpdateProfilePictureServiceModel.cs b/src/Services/DevHive.Services.Models/User/UpdateProfilePictureServiceModel.cs new file mode 100644 index 0000000..19ba08f --- /dev/null +++ b/src/Services/DevHive.Services.Models/User/UpdateProfilePictureServiceModel.cs @@ -0,0 +1,12 @@ +using System; +using Microsoft.AspNetCore.Http; + +namespace DevHive.Services.Models.User +{ + public class UpdateProfilePictureServiceModel + { + public Guid UserId { get; set; } + + public IFormFile Picture { get; set; } + } +} diff --git a/src/Services/DevHive.Services.Models/User/UpdateUserServiceModel.cs b/src/Services/DevHive.Services.Models/User/UpdateUserServiceModel.cs new file mode 100644 index 0000000..ff20e6b --- /dev/null +++ b/src/Services/DevHive.Services.Models/User/UpdateUserServiceModel.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using DevHive.Services.Models.Role; +using DevHive.Services.Models.Language; +using DevHive.Services.Models.Technology; + +namespace DevHive.Services.Models.User +{ + public class UpdateUserServiceModel : BaseUserServiceModel + { + public Guid Id { get; set; } + + public string Password { get; set; } + + public string ProfilePictureURL { get; set; } + + public HashSet Roles { get; set; } = new HashSet(); + + public HashSet Friends { get; set; } = new HashSet(); + + public HashSet Languages { get; set; } = new HashSet(); + + public HashSet Technologies { get; set; } = new HashSet(); + + } +} diff --git a/src/Services/DevHive.Services.Models/User/UserServiceModel.cs b/src/Services/DevHive.Services.Models/User/UserServiceModel.cs new file mode 100644 index 0000000..04b618b --- /dev/null +++ b/src/Services/DevHive.Services.Models/User/UserServiceModel.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; +using DevHive.Common.Models.Misc; +using DevHive.Services.Models.Role; +using DevHive.Services.Models.Language; +using DevHive.Services.Models.Technology; + +namespace DevHive.Services.Models.User +{ + public class UserServiceModel : BaseUserServiceModel + { + public string ProfilePictureURL { get; set; } + + public HashSet Roles { get; set; } = new(); + + public HashSet Friends { get; set; } = new(); + + public HashSet Languages { get; set; } = new(); + + public HashSet Technologies { get; set; } = new(); + + public List Posts { get; set; } = new(); + } +} diff --git a/src/Services/DevHive.Services.Tests/DevHive.Services.Tests.csproj b/src/Services/DevHive.Services.Tests/DevHive.Services.Tests.csproj index af419df..d6d0876 100644 --- a/src/Services/DevHive.Services.Tests/DevHive.Services.Tests.csproj +++ b/src/Services/DevHive.Services.Tests/DevHive.Services.Tests.csproj @@ -14,14 +14,6 @@ - - - - - - - - true latest diff --git a/src/Services/DevHive.Services.Tests/RoleService.Tests.cs b/src/Services/DevHive.Services.Tests/RoleService.Tests.cs index e500dd1..c4fac77 100644 --- a/src/Services/DevHive.Services.Tests/RoleService.Tests.cs +++ b/src/Services/DevHive.Services.Tests/RoleService.Tests.cs @@ -3,7 +3,7 @@ using System.Threading.Tasks; using AutoMapper; using DevHive.Data.Interfaces.Repositories; using DevHive.Data.Models; -using DevHive.Services.Models.Identity.Role; +using DevHive.Services.Models.Role; using DevHive.Services.Services; using Moq; using NUnit.Framework; diff --git a/src/Services/DevHive.Services.Tests/UserService.Tests.cs b/src/Services/DevHive.Services.Tests/UserService.Tests.cs index 21d4862..aff34c9 100644 --- a/src/Services/DevHive.Services.Tests/UserService.Tests.cs +++ b/src/Services/DevHive.Services.Tests/UserService.Tests.cs @@ -10,7 +10,7 @@ using DevHive.Common.Models.Misc; using DevHive.Data.Interfaces.Repositories; using DevHive.Data.Models; using DevHive.Services.Interfaces; -using DevHive.Services.Models.Identity.User; +using DevHive.Services.Models.User; using DevHive.Services.Options; using DevHive.Services.Services; using Microsoft.AspNetCore.Identity; diff --git a/src/Services/DevHive.Services/Configurations/Mapping/RoleMapings.cs b/src/Services/DevHive.Services/Configurations/Mapping/RoleMapings.cs index e61a107..37f259a 100644 --- a/src/Services/DevHive.Services/Configurations/Mapping/RoleMapings.cs +++ b/src/Services/DevHive.Services/Configurations/Mapping/RoleMapings.cs @@ -1,6 +1,6 @@ using DevHive.Data.Models; using AutoMapper; -using DevHive.Services.Models.Identity.Role; +using DevHive.Services.Models.Role; namespace DevHive.Services.Configurations.Mapping { diff --git a/src/Services/DevHive.Services/Configurations/Mapping/UserMappings.cs b/src/Services/DevHive.Services/Configurations/Mapping/UserMappings.cs index 2b0f4ed..9a8e3d9 100644 --- a/src/Services/DevHive.Services/Configurations/Mapping/UserMappings.cs +++ b/src/Services/DevHive.Services/Configurations/Mapping/UserMappings.cs @@ -1,6 +1,6 @@ using DevHive.Data.Models; using AutoMapper; -using DevHive.Services.Models.Identity.User; +using DevHive.Services.Models.User; using DevHive.Common.Models.Misc; using DevHive.Data.RelationModels; diff --git a/src/Services/DevHive.Services/DevHive.Services.csproj b/src/Services/DevHive.Services/DevHive.Services.csproj index 7a33166..1380248 100644 --- a/src/Services/DevHive.Services/DevHive.Services.csproj +++ b/src/Services/DevHive.Services/DevHive.Services.csproj @@ -18,12 +18,6 @@ - - - - - - true latest diff --git a/src/Services/DevHive.Services/Interfaces/IRoleService.cs b/src/Services/DevHive.Services/Interfaces/IRoleService.cs index d47728c..2c31b06 100644 --- a/src/Services/DevHive.Services/Interfaces/IRoleService.cs +++ b/src/Services/DevHive.Services/Interfaces/IRoleService.cs @@ -1,6 +1,6 @@ using System; using System.Threading.Tasks; -using DevHive.Services.Models.Identity.Role; +using DevHive.Services.Models.Role; namespace DevHive.Services.Interfaces { diff --git a/src/Services/DevHive.Services/Interfaces/IUserService.cs b/src/Services/DevHive.Services/Interfaces/IUserService.cs index 9e2b4e3..daa5e5e 100644 --- a/src/Services/DevHive.Services/Interfaces/IUserService.cs +++ b/src/Services/DevHive.Services/Interfaces/IUserService.cs @@ -1,7 +1,7 @@ using System; using System.Threading.Tasks; using DevHive.Common.Models.Identity; -using DevHive.Services.Models.Identity.User; +using DevHive.Services.Models.User; namespace DevHive.Services.Interfaces { diff --git a/src/Services/DevHive.Services/Services/RoleService.cs b/src/Services/DevHive.Services/Services/RoleService.cs index a8b8e17..dbf8fcd 100644 --- a/src/Services/DevHive.Services/Services/RoleService.cs +++ b/src/Services/DevHive.Services/Services/RoleService.cs @@ -4,7 +4,7 @@ using AutoMapper; using DevHive.Data.Interfaces.Repositories; using DevHive.Data.Models; using DevHive.Services.Interfaces; -using DevHive.Services.Models.Identity.Role; +using DevHive.Services.Models.Role; using DevHive.Services.Models.Language; namespace DevHive.Services.Services diff --git a/src/Services/DevHive.Services/Services/UserService.cs b/src/Services/DevHive.Services/Services/UserService.cs index 22d5052..f68e3aa 100644 --- a/src/Services/DevHive.Services/Services/UserService.cs +++ b/src/Services/DevHive.Services/Services/UserService.cs @@ -1,6 +1,6 @@ using AutoMapper; using DevHive.Services.Options; -using DevHive.Services.Models.Identity.User; +using DevHive.Services.Models.User; using System.Threading.Tasks; using DevHive.Data.Models; using System; diff --git a/src/Web/DevHive.Web.Models/DevHive.Web.Models.csproj b/src/Web/DevHive.Web.Models/DevHive.Web.Models.csproj index 0462967..65892c5 100644 --- a/src/Web/DevHive.Web.Models/DevHive.Web.Models.csproj +++ b/src/Web/DevHive.Web.Models/DevHive.Web.Models.csproj @@ -1,14 +1,10 @@ - net5.0 + + - - - - - diff --git a/src/Web/DevHive.Web.Models/Identity/Role/CreateRoleWebModel.cs b/src/Web/DevHive.Web.Models/Identity/Role/CreateRoleWebModel.cs deleted file mode 100644 index 859cdd9..0000000 --- a/src/Web/DevHive.Web.Models/Identity/Role/CreateRoleWebModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; - -namespace DevHive.Web.Models.Identity.Role -{ - public class CreateRoleWebModel - { - [NotNull] - [Required] - [MinLength(3)] - [MaxLength(50)] - public string Name { get; set; } - } -} diff --git a/src/Web/DevHive.Web.Models/Identity/Role/RoleWebModel.cs b/src/Web/DevHive.Web.Models/Identity/Role/RoleWebModel.cs deleted file mode 100644 index 99b0f50..0000000 --- a/src/Web/DevHive.Web.Models/Identity/Role/RoleWebModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; - -namespace DevHive.Web.Models.Identity.Role -{ - public class RoleWebModel - { - [NotNull] - [Required] - [MinLength(3)] - [MaxLength(50)] - public string Name { get; set; } - } -} diff --git a/src/Web/DevHive.Web.Models/Identity/Role/UpdateRoleWebModel.cs b/src/Web/DevHive.Web.Models/Identity/Role/UpdateRoleWebModel.cs deleted file mode 100644 index 3870481..0000000 --- a/src/Web/DevHive.Web.Models/Identity/Role/UpdateRoleWebModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; - -namespace DevHive.Web.Models.Identity.Role -{ - public class UpdateRoleWebModel - { - [NotNull] - [Required] - [MinLength(3)] - [MaxLength(50)] - public string Name { get; set; } - } -} diff --git a/src/Web/DevHive.Web.Models/Identity/User/BaseUserWebModel.cs b/src/Web/DevHive.Web.Models/Identity/User/BaseUserWebModel.cs deleted file mode 100644 index 297e1a5..0000000 --- a/src/Web/DevHive.Web.Models/Identity/User/BaseUserWebModel.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; -using DevHive.Web.Attributes; - -namespace DevHive.Web.Models.Identity.User -{ - public class BaseUserWebModel - { - [NotNull] - [Required] - [MinLength(3)] - [MaxLength(50)] - public string UserName { get; set; } - - [NotNull] - [Required] - [EmailAddress] - public string Email { get; set; } - - [NotNull] - [Required] - [MinLength(3)] - [MaxLength(30)] - [OnlyLetters(ErrorMessage = "First name can only contain letters!")] - public string FirstName { get; set; } - - [NotNull] - [Required] - [MinLength(3)] - [MaxLength(30)] - [OnlyLetters(ErrorMessage = "Last name can only contain letters!")] - public string LastName { get; set; } - } -} diff --git a/src/Web/DevHive.Web.Models/Identity/User/LoginWebModel.cs b/src/Web/DevHive.Web.Models/Identity/User/LoginWebModel.cs deleted file mode 100644 index ccd806f..0000000 --- a/src/Web/DevHive.Web.Models/Identity/User/LoginWebModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; -using DevHive.Web.Attributes; - -namespace DevHive.Web.Models.Identity.User -{ - public class LoginWebModel - { - [NotNull] - [Required] - [MinLength(3)] - [MaxLength(50)] - public string UserName { get; set; } - - [NotNull] - [Required] - [GoodPassword] - public string Password { get; set; } - } -} diff --git a/src/Web/DevHive.Web.Models/Identity/User/ProfilePictureWebModel.cs b/src/Web/DevHive.Web.Models/Identity/User/ProfilePictureWebModel.cs deleted file mode 100644 index 91c9487..0000000 --- a/src/Web/DevHive.Web.Models/Identity/User/ProfilePictureWebModel.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace DevHive.Web.Models.Identity.User -{ - public class ProfilePictureWebModel - { - public string ProfilePictureURL { get; set; } - } -} diff --git a/src/Web/DevHive.Web.Models/Identity/User/RegisterWebModel.cs b/src/Web/DevHive.Web.Models/Identity/User/RegisterWebModel.cs deleted file mode 100644 index 0fc7ec6..0000000 --- a/src/Web/DevHive.Web.Models/Identity/User/RegisterWebModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; -using DevHive.Web.Attributes; - -namespace DevHive.Web.Models.Identity.User -{ - public class RegisterWebModel : BaseUserWebModel - { - [NotNull] - [Required] - [GoodPassword] - public string Password { get; set; } - } -} diff --git a/src/Web/DevHive.Web.Models/Identity/User/TokenWebModel.cs b/src/Web/DevHive.Web.Models/Identity/User/TokenWebModel.cs deleted file mode 100644 index 154b64b..0000000 --- a/src/Web/DevHive.Web.Models/Identity/User/TokenWebModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace DevHive.Web.Models.Identity.User -{ - public class TokenWebModel - { - public TokenWebModel(string token) - { - this.Token = token; - } - - public string Token { get; set; } - } -} \ No newline at end of file diff --git a/src/Web/DevHive.Web.Models/Identity/User/UpdateProfilePictureWebModel.cs b/src/Web/DevHive.Web.Models/Identity/User/UpdateProfilePictureWebModel.cs deleted file mode 100644 index 6efe968..0000000 --- a/src/Web/DevHive.Web.Models/Identity/User/UpdateProfilePictureWebModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Microsoft.AspNetCore.Http; - -namespace DevHive.Web.Models.Identity.User -{ - public class UpdateProfilePictureWebModel - { - public IFormFile Picture { get; set; } - } -} diff --git a/src/Web/DevHive.Web.Models/Identity/User/UpdateUserWebModel.cs b/src/Web/DevHive.Web.Models/Identity/User/UpdateUserWebModel.cs deleted file mode 100644 index 62901f6..0000000 --- a/src/Web/DevHive.Web.Models/Identity/User/UpdateUserWebModel.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; -using DevHive.Web.Attributes; -using DevHive.Web.Models.Identity.Role; -using DevHive.Web.Models.Language; -using DevHive.Web.Models.Technology; - -namespace DevHive.Web.Models.Identity.User -{ - public class UpdateUserWebModel : BaseUserWebModel - { - [NotNull] - [Required] - [GoodPassword] - public string Password { get; set; } - - [NotNull] - [Required] - public HashSet Friends { get; set; } - - [NotNull] - [Required] - public HashSet Roles { get; set; } - - [NotNull] - [Required] - public HashSet Languages { get; set; } - - [NotNull] - [Required] - public HashSet Technologies { get; set; } - } -} diff --git a/src/Web/DevHive.Web.Models/Identity/User/UserWebModel.cs b/src/Web/DevHive.Web.Models/Identity/User/UserWebModel.cs deleted file mode 100644 index 7ab8cca..0000000 --- a/src/Web/DevHive.Web.Models/Identity/User/UserWebModel.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; -using DevHive.Common.Models.Misc; -using DevHive.Web.Models.Identity.Role; -using DevHive.Web.Models.Language; -using DevHive.Web.Models.Technology; - -namespace DevHive.Web.Models.Identity.User -{ - public class UserWebModel : BaseUserWebModel - { - public string ProfilePictureURL { get; set; } - - [NotNull] - [Required] - public HashSet Roles { get; set; } = new(); - - [NotNull] - [Required] - public HashSet Friends { get; set; } = new(); - - [NotNull] - [Required] - public HashSet Languages { get; set; } = new(); - - [NotNull] - [Required] - public HashSet Technologies { get; set; } = new(); - - public List Posts { get; set; } = new(); - } -} diff --git a/src/Web/DevHive.Web.Models/Identity/User/UsernameWebModel.cs b/src/Web/DevHive.Web.Models/Identity/User/UsernameWebModel.cs deleted file mode 100644 index c533bba..0000000 --- a/src/Web/DevHive.Web.Models/Identity/User/UsernameWebModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; -using DevHive.Web.Attributes; - -namespace DevHive.Web.Models.Identity.User -{ - public class UsernameWebModel - { - [NotNull] - [Required] - [MinLength(3)] - [MaxLength(50)] - public string UserName { get; set; } - } -} diff --git a/src/Web/DevHive.Web.Models/Post/Rating/RatePostWebModel.cs b/src/Web/DevHive.Web.Models/Post/Rating/RatePostWebModel.cs deleted file mode 100644 index 5f0e58f..0000000 --- a/src/Web/DevHive.Web.Models/Post/Rating/RatePostWebModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace DevHive.Web.Models.Post.Rating -{ - public class RatePostWebModel - { - public Guid PostId { get; set; } - - public bool Liked { get; set; } - } -} diff --git a/src/Web/DevHive.Web.Models/Post/Rating/ReadPostRatingWebModel.cs b/src/Web/DevHive.Web.Models/Post/Rating/ReadPostRatingWebModel.cs deleted file mode 100644 index a551fb8..0000000 --- a/src/Web/DevHive.Web.Models/Post/Rating/ReadPostRatingWebModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace DevHive.Web.Models.Post.Rating -{ - public class ReadPostRatingWebModel - { - public Guid Id { get; set; } - - public Guid PostId { get; set; } - - public int Likes { get; set; } - - public int Dislikes { get; set; } - } -} diff --git a/src/Web/DevHive.Web.Models/Rating/RatePostWebModel.cs b/src/Web/DevHive.Web.Models/Rating/RatePostWebModel.cs new file mode 100644 index 0000000..cbba4ab --- /dev/null +++ b/src/Web/DevHive.Web.Models/Rating/RatePostWebModel.cs @@ -0,0 +1,11 @@ +using System; + +namespace DevHive.Web.Models.Rating +{ + public class RatePostWebModel + { + public Guid PostId { get; set; } + + public bool Liked { get; set; } + } +} diff --git a/src/Web/DevHive.Web.Models/Rating/ReadPostRatingWebModel.cs b/src/Web/DevHive.Web.Models/Rating/ReadPostRatingWebModel.cs new file mode 100644 index 0000000..8afd57e --- /dev/null +++ b/src/Web/DevHive.Web.Models/Rating/ReadPostRatingWebModel.cs @@ -0,0 +1,15 @@ +using System; + +namespace DevHive.Web.Models.Rating +{ + public class ReadPostRatingWebModel + { + public Guid Id { get; set; } + + public Guid PostId { get; set; } + + public int Likes { get; set; } + + public int Dislikes { get; set; } + } +} diff --git a/src/Web/DevHive.Web.Models/Role/CreateRoleWebModel.cs b/src/Web/DevHive.Web.Models/Role/CreateRoleWebModel.cs new file mode 100644 index 0000000..9beced4 --- /dev/null +++ b/src/Web/DevHive.Web.Models/Role/CreateRoleWebModel.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; + +namespace DevHive.Web.Models.Role +{ + public class CreateRoleWebModel + { + [NotNull] + [Required] + [MinLength(3)] + [MaxLength(50)] + public string Name { get; set; } + } +} diff --git a/src/Web/DevHive.Web.Models/Role/RoleWebModel.cs b/src/Web/DevHive.Web.Models/Role/RoleWebModel.cs new file mode 100644 index 0000000..680fb05 --- /dev/null +++ b/src/Web/DevHive.Web.Models/Role/RoleWebModel.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; + +namespace DevHive.Web.Models.Role +{ + public class RoleWebModel + { + [NotNull] + [Required] + [MinLength(3)] + [MaxLength(50)] + public string Name { get; set; } + } +} diff --git a/src/Web/DevHive.Web.Models/Role/UpdateRoleWebModel.cs b/src/Web/DevHive.Web.Models/Role/UpdateRoleWebModel.cs new file mode 100644 index 0000000..f32839e --- /dev/null +++ b/src/Web/DevHive.Web.Models/Role/UpdateRoleWebModel.cs @@ -0,0 +1,15 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; + +namespace DevHive.Web.Models.Role +{ + public class UpdateRoleWebModel + { + [NotNull] + [Required] + [MinLength(3)] + [MaxLength(50)] + public string Name { get; set; } + } +} diff --git a/src/Web/DevHive.Web.Models/User/BaseUserWebModel.cs b/src/Web/DevHive.Web.Models/User/BaseUserWebModel.cs new file mode 100644 index 0000000..9a2544d --- /dev/null +++ b/src/Web/DevHive.Web.Models/User/BaseUserWebModel.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; +using DevHive.Web.Attributes; + +namespace DevHive.Web.Models.User +{ + public class BaseUserWebModel + { + [NotNull] + [Required] + [MinLength(3)] + [MaxLength(50)] + public string UserName { get; set; } + + [NotNull] + [Required] + [EmailAddress] + public string Email { get; set; } + + [NotNull] + [Required] + [MinLength(3)] + [MaxLength(30)] + [OnlyLetters(ErrorMessage = "First name can only contain letters!")] + public string FirstName { get; set; } + + [NotNull] + [Required] + [MinLength(3)] + [MaxLength(30)] + [OnlyLetters(ErrorMessage = "Last name can only contain letters!")] + public string LastName { get; set; } + } +} diff --git a/src/Web/DevHive.Web.Models/User/LoginWebModel.cs b/src/Web/DevHive.Web.Models/User/LoginWebModel.cs new file mode 100644 index 0000000..c821721 --- /dev/null +++ b/src/Web/DevHive.Web.Models/User/LoginWebModel.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; +using DevHive.Web.Attributes; + +namespace DevHive.Web.Models.User +{ + public class LoginWebModel + { + [NotNull] + [Required] + [MinLength(3)] + [MaxLength(50)] + public string UserName { get; set; } + + [NotNull] + [Required] + [GoodPassword] + public string Password { get; set; } + } +} diff --git a/src/Web/DevHive.Web.Models/User/ProfilePictureWebModel.cs b/src/Web/DevHive.Web.Models/User/ProfilePictureWebModel.cs new file mode 100644 index 0000000..e09ee08 --- /dev/null +++ b/src/Web/DevHive.Web.Models/User/ProfilePictureWebModel.cs @@ -0,0 +1,7 @@ +namespace DevHive.Web.Models.User +{ + public class ProfilePictureWebModel + { + public string ProfilePictureURL { get; set; } + } +} diff --git a/src/Web/DevHive.Web.Models/User/RegisterWebModel.cs b/src/Web/DevHive.Web.Models/User/RegisterWebModel.cs new file mode 100644 index 0000000..754c8eb --- /dev/null +++ b/src/Web/DevHive.Web.Models/User/RegisterWebModel.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; +using DevHive.Web.Attributes; + +namespace DevHive.Web.Models.User +{ + public class RegisterWebModel : BaseUserWebModel + { + [NotNull] + [Required] + [GoodPassword] + public string Password { get; set; } + } +} diff --git a/src/Web/DevHive.Web.Models/User/TokenWebModel.cs b/src/Web/DevHive.Web.Models/User/TokenWebModel.cs new file mode 100644 index 0000000..7f3361d --- /dev/null +++ b/src/Web/DevHive.Web.Models/User/TokenWebModel.cs @@ -0,0 +1,12 @@ +namespace DevHive.Web.Models.User +{ + public class TokenWebModel + { + public TokenWebModel(string token) + { + this.Token = token; + } + + public string Token { get; set; } + } +} diff --git a/src/Web/DevHive.Web.Models/User/UpdateProfilePictureWebModel.cs b/src/Web/DevHive.Web.Models/User/UpdateProfilePictureWebModel.cs new file mode 100644 index 0000000..196d1e7 --- /dev/null +++ b/src/Web/DevHive.Web.Models/User/UpdateProfilePictureWebModel.cs @@ -0,0 +1,9 @@ +using Microsoft.AspNetCore.Http; + +namespace DevHive.Web.Models.User +{ + public class UpdateProfilePictureWebModel + { + public IFormFile Picture { get; set; } + } +} diff --git a/src/Web/DevHive.Web.Models/User/UpdateUserWebModel.cs b/src/Web/DevHive.Web.Models/User/UpdateUserWebModel.cs new file mode 100644 index 0000000..86f6bfe --- /dev/null +++ b/src/Web/DevHive.Web.Models/User/UpdateUserWebModel.cs @@ -0,0 +1,34 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; +using DevHive.Web.Attributes; +using DevHive.Web.Models.Role; +using DevHive.Web.Models.Language; +using DevHive.Web.Models.Technology; + +namespace DevHive.Web.Models.User +{ + public class UpdateUserWebModel : BaseUserWebModel + { + [NotNull] + [Required] + [GoodPassword] + public string Password { get; set; } + + [NotNull] + [Required] + public HashSet Friends { get; set; } + + [NotNull] + [Required] + public HashSet Roles { get; set; } + + [NotNull] + [Required] + public HashSet Languages { get; set; } + + [NotNull] + [Required] + public HashSet Technologies { get; set; } + } +} diff --git a/src/Web/DevHive.Web.Models/User/UserWebModel.cs b/src/Web/DevHive.Web.Models/User/UserWebModel.cs new file mode 100644 index 0000000..37141d0 --- /dev/null +++ b/src/Web/DevHive.Web.Models/User/UserWebModel.cs @@ -0,0 +1,33 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; +using DevHive.Common.Models.Misc; +using DevHive.Web.Models.Role; +using DevHive.Web.Models.Language; +using DevHive.Web.Models.Technology; + +namespace DevHive.Web.Models.User +{ + public class UserWebModel : BaseUserWebModel + { + public string ProfilePictureURL { get; set; } + + [NotNull] + [Required] + public HashSet Roles { get; set; } = new(); + + [NotNull] + [Required] + public HashSet Friends { get; set; } = new(); + + [NotNull] + [Required] + public HashSet Languages { get; set; } = new(); + + [NotNull] + [Required] + public HashSet Technologies { get; set; } = new(); + + public List Posts { get; set; } = new(); + } +} diff --git a/src/Web/DevHive.Web.Models/User/UsernameWebModel.cs b/src/Web/DevHive.Web.Models/User/UsernameWebModel.cs new file mode 100644 index 0000000..fc0a7ff --- /dev/null +++ b/src/Web/DevHive.Web.Models/User/UsernameWebModel.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; +using DevHive.Web.Attributes; + +namespace DevHive.Web.Models.User +{ + public class UsernameWebModel + { + [NotNull] + [Required] + [MinLength(3)] + [MaxLength(50)] + public string UserName { get; set; } + } +} diff --git a/src/Web/DevHive.Web.Tests/DevHive.Web.Tests.csproj b/src/Web/DevHive.Web.Tests/DevHive.Web.Tests.csproj index 2b30bb8..ee390b5 100644 --- a/src/Web/DevHive.Web.Tests/DevHive.Web.Tests.csproj +++ b/src/Web/DevHive.Web.Tests/DevHive.Web.Tests.csproj @@ -13,13 +13,6 @@ - - - - - - - true latest diff --git a/src/Web/DevHive.Web.Tests/RoleController.Tests.cs b/src/Web/DevHive.Web.Tests/RoleController.Tests.cs index 067b4e4..b5deba0 100644 --- a/src/Web/DevHive.Web.Tests/RoleController.Tests.cs +++ b/src/Web/DevHive.Web.Tests/RoleController.Tests.cs @@ -3,9 +3,9 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; using DevHive.Services.Interfaces; -using DevHive.Services.Models.Identity.Role; +using DevHive.Services.Models.Role; using DevHive.Web.Controllers; -using DevHive.Web.Models.Identity.Role; +using DevHive.Web.Models.Role; using Microsoft.AspNetCore.Mvc; using Moq; using NUnit.Framework; diff --git a/src/Web/DevHive.Web.Tests/UserController.Tests.cs b/src/Web/DevHive.Web.Tests/UserController.Tests.cs index c1431c8..3e858f6 100644 --- a/src/Web/DevHive.Web.Tests/UserController.Tests.cs +++ b/src/Web/DevHive.Web.Tests/UserController.Tests.cs @@ -3,9 +3,9 @@ using System.Threading.Tasks; using AutoMapper; using DevHive.Common.Models.Identity; using DevHive.Services.Interfaces; -using DevHive.Services.Models.Identity.User; +using DevHive.Services.Models.User; using DevHive.Web.Controllers; -using DevHive.Web.Models.Identity.User; +using DevHive.Web.Models.User; using Microsoft.AspNetCore.Mvc; using Moq; using NUnit.Framework; diff --git a/src/Web/DevHive.Web/Configurations/Mapping/RoleMappings.cs b/src/Web/DevHive.Web/Configurations/Mapping/RoleMappings.cs index 2ea2742..60f8503 100644 --- a/src/Web/DevHive.Web/Configurations/Mapping/RoleMappings.cs +++ b/src/Web/DevHive.Web/Configurations/Mapping/RoleMappings.cs @@ -1,6 +1,6 @@ using AutoMapper; -using DevHive.Web.Models.Identity.Role; -using DevHive.Services.Models.Identity.Role; +using DevHive.Web.Models.Role; +using DevHive.Services.Models.Role; namespace DevHive.Web.Configurations.Mapping { diff --git a/src/Web/DevHive.Web/Configurations/Mapping/UserMappings.cs b/src/Web/DevHive.Web/Configurations/Mapping/UserMappings.cs index f58e7ca..14aaa3a 100644 --- a/src/Web/DevHive.Web/Configurations/Mapping/UserMappings.cs +++ b/src/Web/DevHive.Web/Configurations/Mapping/UserMappings.cs @@ -1,6 +1,6 @@ using AutoMapper; -using DevHive.Services.Models.Identity.User; -using DevHive.Web.Models.Identity.User; +using DevHive.Services.Models.User; +using DevHive.Web.Models.User; using DevHive.Common.Models.Identity; namespace DevHive.Web.Configurations.Mapping diff --git a/src/Web/DevHive.Web/Controllers/RoleController.cs b/src/Web/DevHive.Web/Controllers/RoleController.cs index 0d2a2eb..1465795 100644 --- a/src/Web/DevHive.Web/Controllers/RoleController.cs +++ b/src/Web/DevHive.Web/Controllers/RoleController.cs @@ -1,10 +1,10 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; -using DevHive.Web.Models.Identity.Role; +using DevHive.Web.Models.Role; using AutoMapper; using System; using DevHive.Services.Interfaces; -using DevHive.Services.Models.Identity.Role; +using DevHive.Services.Models.Role; using Microsoft.AspNetCore.Authorization; namespace DevHive.Web.Controllers diff --git a/src/Web/DevHive.Web/Controllers/UserController.cs b/src/Web/DevHive.Web/Controllers/UserController.cs index 109bbaa..25faa8a 100644 --- a/src/Web/DevHive.Web/Controllers/UserController.cs +++ b/src/Web/DevHive.Web/Controllers/UserController.cs @@ -1,8 +1,8 @@ using System; using System.Threading.Tasks; using AutoMapper; -using DevHive.Services.Models.Identity.User; -using DevHive.Web.Models.Identity.User; +using DevHive.Services.Models.User; +using DevHive.Web.Models.User; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using DevHive.Common.Models.Identity; diff --git a/src/Web/DevHive.Web/DevHive.Web.csproj b/src/Web/DevHive.Web/DevHive.Web.csproj index 71362ce..7ba07b1 100644 --- a/src/Web/DevHive.Web/DevHive.Web.csproj +++ b/src/Web/DevHive.Web/DevHive.Web.csproj @@ -20,11 +20,4 @@ - - - - - - - -- cgit v1.2.3 From 4c03712af14c37718b7be5b23fcadeb86f2a2191 Mon Sep 17 00:00:00 2001 From: transtrike Date: Mon, 15 Feb 2021 19:06:14 +0200 Subject: Code Analyzer added to all csproj; Removed unnessessary code; Fixed formatting --- .../DevHive.Common.Models/DevHive.Common.csproj | 1 + .../DevHive.Data.Models/DevHive.Data.Models.csproj | 1 + .../DevHive.Data.Tests/DevHive.Data.Tests.csproj | 13 +++--- src/Data/DevHive.Data/DevHive.Data.csproj | 1 + .../DevHive.Services.Models.csproj | 9 ++-- .../DevHive.Services.Tests.csproj | 13 +++--- .../DevHive.Services.Tests/UserService.Tests.cs | 8 ++-- .../Configurations/Mapping/PostMappings.cs | 1 - .../Configurations/Mapping/RatingMappings.cs | 2 - .../DevHive.Services/DevHive.Services.csproj | 17 +++---- .../DevHive.Services/Interfaces/ICloudService.cs | 2 - .../DevHive.Services/Interfaces/IRoleService.cs | 2 +- .../DevHive.Services/Options/JWTOptions.cs | 14 ------ .../DevHive.Services/Options/JwtOptions.cs | 14 ++++++ .../DevHive.Services/Services/FeedService.cs | 2 +- .../DevHive.Services/Services/PostService.cs | 15 +++--- .../DevHive.Services/Services/RateService.cs | 2 +- .../DevHive.Services/Services/RoleService.cs | 9 ++-- .../DevHive.Services/Services/UserService.cs | 15 +++--- .../Attributes/GoodPasswordAttribute.cs | 23 +++++++++ .../Attributes/GoodPasswordModelValidation.cs | 24 ---------- .../Attributes/OnlyLettersModelValidation.cs | 4 +- .../DevHive.Web.Models/DevHive.Web.Models.csproj | 8 ++-- .../DevHive.Web.Models/Post/ReadPostWebModel.cs | 1 - .../DevHive.Web.Tests/CommentController.Tests.cs | 35 +++++++------- src/Web/DevHive.Web.Tests/DevHive.Web.Tests.csproj | 11 +++-- .../DevHive.Web.Tests/LanguageController.Tests.cs | 4 +- src/Web/DevHive.Web.Tests/PostController.Tests.cs | 29 ++++++------ src/Web/DevHive.Web.Tests/RoleController.Tests.cs | 4 +- .../TechnologyController.Tests.cs | 4 +- src/Web/DevHive.Web.Tests/UserController.Tests.cs | 46 ++++++++---------- .../Extensions/ConfigureAutoMapper.cs | 5 +- .../ConfigureExceptionHandlerMiddleware.cs | 2 - .../Configurations/Extensions/ConfigureJWT.cs | 54 ---------------------- .../Configurations/Extensions/ConfigureJwt.cs | 54 ++++++++++++++++++++++ src/Web/DevHive.Web/DevHive.Web.csproj | 21 +++++---- .../DevHive.Web/Middleware/ExceptionMiddleware.cs | 14 ++---- 37 files changed, 229 insertions(+), 255 deletions(-) delete mode 100644 src/Services/DevHive.Services/Options/JWTOptions.cs create mode 100644 src/Services/DevHive.Services/Options/JwtOptions.cs create mode 100644 src/Web/DevHive.Web.Models/Attributes/GoodPasswordAttribute.cs delete mode 100644 src/Web/DevHive.Web.Models/Attributes/GoodPasswordModelValidation.cs delete mode 100644 src/Web/DevHive.Web/Configurations/Extensions/ConfigureJWT.cs create mode 100644 src/Web/DevHive.Web/Configurations/Extensions/ConfigureJwt.cs (limited to 'src/Services/DevHive.Services/Interfaces/IRoleService.cs') diff --git a/src/Common/DevHive.Common.Models/DevHive.Common.csproj b/src/Common/DevHive.Common.Models/DevHive.Common.csproj index 4829c80..f6d662c 100644 --- a/src/Common/DevHive.Common.Models/DevHive.Common.csproj +++ b/src/Common/DevHive.Common.Models/DevHive.Common.csproj @@ -4,6 +4,7 @@ + true diff --git a/src/Data/DevHive.Data.Models/DevHive.Data.Models.csproj b/src/Data/DevHive.Data.Models/DevHive.Data.Models.csproj index e58a6d8..e9dc644 100644 --- a/src/Data/DevHive.Data.Models/DevHive.Data.Models.csproj +++ b/src/Data/DevHive.Data.Models/DevHive.Data.Models.csproj @@ -5,5 +5,6 @@ + \ No newline at end of file diff --git a/src/Data/DevHive.Data.Tests/DevHive.Data.Tests.csproj b/src/Data/DevHive.Data.Tests/DevHive.Data.Tests.csproj index 568edda..2af369f 100644 --- a/src/Data/DevHive.Data.Tests/DevHive.Data.Tests.csproj +++ b/src/Data/DevHive.Data.Tests/DevHive.Data.Tests.csproj @@ -4,14 +4,15 @@ false - - - - - + + + + + + - + true diff --git a/src/Data/DevHive.Data/DevHive.Data.csproj b/src/Data/DevHive.Data/DevHive.Data.csproj index fac1581..46928c6 100644 --- a/src/Data/DevHive.Data/DevHive.Data.csproj +++ b/src/Data/DevHive.Data/DevHive.Data.csproj @@ -12,6 +12,7 @@ + diff --git a/src/Services/DevHive.Services.Models/DevHive.Services.Models.csproj b/src/Services/DevHive.Services.Models/DevHive.Services.Models.csproj index 3f0eadf..914efe0 100644 --- a/src/Services/DevHive.Services.Models/DevHive.Services.Models.csproj +++ b/src/Services/DevHive.Services.Models/DevHive.Services.Models.csproj @@ -2,12 +2,11 @@ net5.0 - - + + - - + - + \ No newline at end of file diff --git a/src/Services/DevHive.Services.Tests/DevHive.Services.Tests.csproj b/src/Services/DevHive.Services.Tests/DevHive.Services.Tests.csproj index eb33d07..bdfb2bb 100644 --- a/src/Services/DevHive.Services.Tests/DevHive.Services.Tests.csproj +++ b/src/Services/DevHive.Services.Tests/DevHive.Services.Tests.csproj @@ -4,14 +4,15 @@ false - - - - - + + + + + + - + true diff --git a/src/Services/DevHive.Services.Tests/UserService.Tests.cs b/src/Services/DevHive.Services.Tests/UserService.Tests.cs index 8fddce7..ce997c1 100644 --- a/src/Services/DevHive.Services.Tests/UserService.Tests.cs +++ b/src/Services/DevHive.Services.Tests/UserService.Tests.cs @@ -29,7 +29,7 @@ namespace DevHive.Services.Tests private Mock LanguageRepositoryMock { get; set; } private Mock TechnologyRepositoryMock { get; set; } private Mock MapperMock { get; set; } - private JWTOptions JWTOptions { get; set; } + private JwtOptions JwtOptions { get; set; } private UserService UserService { get; set; } #region SetUps @@ -41,10 +41,10 @@ namespace DevHive.Services.Tests this.CloudServiceMock = new Mock(); this.LanguageRepositoryMock = new Mock(); this.TechnologyRepositoryMock = new Mock(); - this.JWTOptions = new JWTOptions("gXfQlU6qpDleFWyimscjYcT3tgFsQg3yoFjcvSLxG56n1Vu2yptdIUq254wlJWjm"); + this.JwtOptions = new JwtOptions("gXfQlU6qpDleFWyimscjYcT3tgFsQg3yoFjcvSLxG56n1Vu2yptdIUq254wlJWjm"); this.MapperMock = new Mock(); // TODO: give actual UserManager and RoleManager to UserService - this.UserService = new UserService(this.UserRepositoryMock.Object, this.LanguageRepositoryMock.Object, this.RoleRepositoryMock.Object, this.TechnologyRepositoryMock.Object, null, null, this.MapperMock.Object, this.JWTOptions, this.CloudServiceMock.Object); + this.UserService = new UserService(this.UserRepositoryMock.Object, this.LanguageRepositoryMock.Object, this.RoleRepositoryMock.Object, this.TechnologyRepositoryMock.Object, null, null, this.MapperMock.Object, this.JwtOptions, this.CloudServiceMock.Object); } #endregion @@ -364,7 +364,7 @@ namespace DevHive.Services.Tests #region HelperMethods private string WriteJWTSecurityToken(Guid userId, string username, HashSet roles) { - byte[] signingKey = Encoding.ASCII.GetBytes(this.JWTOptions.Secret); + byte[] signingKey = Encoding.ASCII.GetBytes(this.JwtOptions.Secret); HashSet claims = new() { new Claim("ID", $"{userId}"), diff --git a/src/Services/DevHive.Services/Configurations/Mapping/PostMappings.cs b/src/Services/DevHive.Services/Configurations/Mapping/PostMappings.cs index 9362f90..1d7d88b 100644 --- a/src/Services/DevHive.Services/Configurations/Mapping/PostMappings.cs +++ b/src/Services/DevHive.Services/Configurations/Mapping/PostMappings.cs @@ -12,7 +12,6 @@ namespace DevHive.Services.Configurations.Mapping public PostMappings() { CreateMap(); - // .ForMember(dest => dest.Files, src => src.Ignore()); CreateMap() .ForMember(dest => dest.Id, src => src.MapFrom(p => p.PostId)) // .ForMember(dest => dest.Files, src => src.Ignore()) diff --git a/src/Services/DevHive.Services/Configurations/Mapping/RatingMappings.cs b/src/Services/DevHive.Services/Configurations/Mapping/RatingMappings.cs index 1dbb7b4..fefa6d8 100644 --- a/src/Services/DevHive.Services/Configurations/Mapping/RatingMappings.cs +++ b/src/Services/DevHive.Services/Configurations/Mapping/RatingMappings.cs @@ -8,8 +8,6 @@ namespace DevHive.Services.Configurations.Mapping { public RatingMappings() { - // CreateMap() - // .ForMember(dest => dest.PostId, src => src.MapFrom(p => p.Post.Id)); } } } diff --git a/src/Services/DevHive.Services/DevHive.Services.csproj b/src/Services/DevHive.Services/DevHive.Services.csproj index b09c46d..650a304 100644 --- a/src/Services/DevHive.Services/DevHive.Services.csproj +++ b/src/Services/DevHive.Services/DevHive.Services.csproj @@ -3,22 +3,23 @@ net5.0 - + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - + + + + + - - + + true latest - + \ No newline at end of file diff --git a/src/Services/DevHive.Services/Interfaces/ICloudService.cs b/src/Services/DevHive.Services/Interfaces/ICloudService.cs index 3ae7a24..040729f 100644 --- a/src/Services/DevHive.Services/Interfaces/ICloudService.cs +++ b/src/Services/DevHive.Services/Interfaces/ICloudService.cs @@ -9,8 +9,6 @@ namespace DevHive.Services.Interfaces { Task> UploadFilesToCloud(List formFiles); - // Task> GetFilesFromCloud(List fileUrls); - Task RemoveFilesFromCloud(List fileUrls); } } diff --git a/src/Services/DevHive.Services/Interfaces/IRoleService.cs b/src/Services/DevHive.Services/Interfaces/IRoleService.cs index 2c31b06..05df917 100644 --- a/src/Services/DevHive.Services/Interfaces/IRoleService.cs +++ b/src/Services/DevHive.Services/Interfaces/IRoleService.cs @@ -6,7 +6,7 @@ namespace DevHive.Services.Interfaces { public interface IRoleService { - Task CreateRole(CreateRoleServiceModel roleServiceModel); + Task CreateRole(CreateRoleServiceModel createRoleServiceModel); Task GetRoleById(Guid id); diff --git a/src/Services/DevHive.Services/Options/JWTOptions.cs b/src/Services/DevHive.Services/Options/JWTOptions.cs deleted file mode 100644 index 95458f5..0000000 --- a/src/Services/DevHive.Services/Options/JWTOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Microsoft.Extensions.Options; - -namespace DevHive.Services.Options -{ - public class JWTOptions - { - public JWTOptions(string secret) - { - this.Secret = secret; - } - - public string Secret { get; init; } - } -} diff --git a/src/Services/DevHive.Services/Options/JwtOptions.cs b/src/Services/DevHive.Services/Options/JwtOptions.cs new file mode 100644 index 0000000..d973f45 --- /dev/null +++ b/src/Services/DevHive.Services/Options/JwtOptions.cs @@ -0,0 +1,14 @@ +using Microsoft.Extensions.Options; + +namespace DevHive.Services.Options +{ + public class JwtOptions + { + public JwtOptions(string secret) + { + this.Secret = secret; + } + + public string Secret { get; init; } + } +} diff --git a/src/Services/DevHive.Services/Services/FeedService.cs b/src/Services/DevHive.Services/Services/FeedService.cs index 5feef6e..17cc43f 100644 --- a/src/Services/DevHive.Services/Services/FeedService.cs +++ b/src/Services/DevHive.Services/Services/FeedService.cs @@ -57,7 +57,7 @@ namespace DevHive.Services.Services /// /// This method is used in the profile pages. - /// See the FeedRepository "GetUsersPosts" menthod for more information on how it works. + /// See the FeedRepository "GetUsersPosts" method for more information on how it works. /// public async Task GetUserPage(GetPageServiceModel model) { diff --git a/src/Services/DevHive.Services/Services/PostService.cs b/src/Services/DevHive.Services/Services/PostService.cs index 0becd9f..a3d5117 100644 --- a/src/Services/DevHive.Services/Services/PostService.cs +++ b/src/Services/DevHive.Services/Services/PostService.cs @@ -41,7 +41,7 @@ namespace DevHive.Services.Services if (createPostServiceModel.Files.Count != 0) { List fileUrls = await _cloudService.UploadFilesToCloud(createPostServiceModel.Files); - post.Attachments = this.GetPostAttachmentsFromUrls(post, fileUrls); + post.Attachments = GetPostAttachmentsFromUrls(post, fileUrls); } post.Creator = await this._userRepository.GetByIdAsync(createPostServiceModel.CreatorId); @@ -105,8 +105,8 @@ namespace DevHive.Services.Services } List fileUrls = await _cloudService.UploadFilesToCloud(updatePostServiceModel.Files) ?? - throw new ArgumentNullException("Unable to upload images to cloud"); - post.Attachments = this.GetPostAttachmentsFromUrls(post, fileUrls); + throw new ArgumentException("Unable to upload images to cloud!"); + post.Attachments = GetPostAttachmentsFromUrls(post, fileUrls); } post.Creator = await this._userRepository.GetByIdAsync(updatePostServiceModel.CreatorId); @@ -202,8 +202,7 @@ namespace DevHive.Services.Services { JwtSecurityToken jwt = new JwtSecurityTokenHandler().ReadJwtToken(rawTokenData.Remove(0, 7)); - Guid jwtUserId = Guid.Parse(this.GetClaimTypeValues("ID", jwt.Claims).First()); - //HashSet jwtRoleNames = this.GetClaimTypeValues("role", jwt.Claims); + Guid jwtUserId = Guid.Parse(GetClaimTypeValues("ID", jwt.Claims).First()); User user = await this._userRepository.GetByIdAsync(jwtUserId) ?? throw new ArgumentException("User does not exist!"); @@ -214,7 +213,7 @@ namespace DevHive.Services.Services /// /// Returns all values from a given claim type /// - private List GetClaimTypeValues(string type, IEnumerable claims) + private static List GetClaimTypeValues(string type, IEnumerable claims) { List toReturn = new(); @@ -227,9 +226,9 @@ namespace DevHive.Services.Services #endregion #region Misc - private List GetPostAttachmentsFromUrls(Post post, List fileUrls) + private static List GetPostAttachmentsFromUrls(Post post, List fileUrls) { - List postAttachments = new List(); + List postAttachments = new(); foreach (string url in fileUrls) postAttachments.Add(new PostAttachments { Post = post, FileUrl = url }); return postAttachments; diff --git a/src/Services/DevHive.Services/Services/RateService.cs b/src/Services/DevHive.Services/Services/RateService.cs index d423d8c..5e924ab 100644 --- a/src/Services/DevHive.Services/Services/RateService.cs +++ b/src/Services/DevHive.Services/Services/RateService.cs @@ -28,7 +28,7 @@ namespace DevHive.Services.Services { throw new NotImplementedException(); // if (!await this._postRepository.DoesPostExist(ratePostServiceModel.PostId)) - // throw new ArgumentException("Post does not exist!"); + // throw new ArgumentException("Post does not exist!"); // if (!await this._userRepository.DoesUserExistAsync(ratePostServiceModel.UserId)) // throw new ArgumentException("User does not exist!"); diff --git a/src/Services/DevHive.Services/Services/RoleService.cs b/src/Services/DevHive.Services/Services/RoleService.cs index 5472e44..1285421 100644 --- a/src/Services/DevHive.Services/Services/RoleService.cs +++ b/src/Services/DevHive.Services/Services/RoleService.cs @@ -5,7 +5,6 @@ using DevHive.Data.Interfaces; using DevHive.Data.Models; using DevHive.Services.Interfaces; using DevHive.Services.Models.Role; -using DevHive.Services.Models.Language; namespace DevHive.Services.Services { @@ -20,17 +19,17 @@ namespace DevHive.Services.Services this._roleMapper = mapper; } - public async Task CreateRole(CreateRoleServiceModel roleServiceModel) + public async Task CreateRole(CreateRoleServiceModel createRoleServiceModel) { - if (await this._roleRepository.DoesNameExist(roleServiceModel.Name)) + if (await this._roleRepository.DoesNameExist(createRoleServiceModel.Name)) throw new ArgumentException("Role already exists!"); - Role role = this._roleMapper.Map(roleServiceModel); + Role role = this._roleMapper.Map(createRoleServiceModel); bool success = await this._roleRepository.AddAsync(role); if (success) { - Role newRole = await this._roleRepository.GetByNameAsync(roleServiceModel.Name); + Role newRole = await this._roleRepository.GetByNameAsync(createRoleServiceModel.Name); return newRole.Id; } else diff --git a/src/Services/DevHive.Services/Services/UserService.cs b/src/Services/DevHive.Services/Services/UserService.cs index 9a63853..e31eb8d 100644 --- a/src/Services/DevHive.Services/Services/UserService.cs +++ b/src/Services/DevHive.Services/Services/UserService.cs @@ -28,7 +28,7 @@ namespace DevHive.Services.Services private readonly UserManager _userManager; private readonly RoleManager _roleManager; private readonly IMapper _userMapper; - private readonly JWTOptions _jwtOptions; + private readonly JwtOptions _jwtOptions; private readonly ICloudService _cloudService; public UserService(IUserRepository userRepository, @@ -38,7 +38,7 @@ namespace DevHive.Services.Services UserManager userManager, RoleManager roleManager, IMapper mapper, - JWTOptions jwtOptions, + JwtOptions jwtOptions, ICloudService cloudService) { this._userRepository = userRepository; @@ -128,7 +128,7 @@ namespace DevHive.Services.Services User currentUser = await this._userRepository.GetByIdAsync(updateUserServiceModel.Id); await this.PopulateUserModel(currentUser, updateUserServiceModel); - if (updateUserServiceModel.Friends.Count() > 0) + if (updateUserServiceModel.Friends.Count > 0) await this.CreateRelationToFriends(currentUser, updateUserServiceModel.Friends.ToList()); else currentUser.Friends.Clear(); @@ -157,7 +157,7 @@ namespace DevHive.Services.Services } string fileUrl = (await this._cloudService.UploadFilesToCloud(new List { updateProfilePictureServiceModel.Picture }))[0] ?? - throw new ArgumentNullException("Unable to upload profile picture to cloud"); + throw new ArgumentException("Unable to upload profile picture to cloud"); bool successful = await this._userRepository.UpdateProfilePicture(updateProfilePictureServiceModel.UserId, fileUrl); @@ -201,16 +201,13 @@ namespace DevHive.Services.Services /* Check if user is trying to do something to himself, unless he's an admin */ /* Check roles */ - if (!jwtRoleNames.Contains(Role.AdminRole)) - if (user.Id != id) - return false; + if (!jwtRoleNames.Contains(Role.AdminRole) && user.Id != id) + return false; // Check if jwt contains all user roles (if it doesn't, jwt is either old or tampered with) foreach (var role in user.Roles) - { if (!jwtRoleNames.Contains(role.Name)) return false; - } // Check if jwt contains only roles of user if (jwtRoleNames.Count != user.Roles.Count) diff --git a/src/Web/DevHive.Web.Models/Attributes/GoodPasswordAttribute.cs b/src/Web/DevHive.Web.Models/Attributes/GoodPasswordAttribute.cs new file mode 100644 index 0000000..c452499 --- /dev/null +++ b/src/Web/DevHive.Web.Models/Attributes/GoodPasswordAttribute.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; + +namespace DevHive.Web.Models.Attributes +{ + public class GoodPasswordAttribute : ValidationAttribute + { + public override bool IsValid(object value) + { + var stringValue = (string)value; + + for (int i = 0; i < stringValue.Length; i++) + { + if (char.IsDigit(stringValue[i])) + { + base.ErrorMessage = "Password must be atleast 5 characters long!"; + return stringValue.Length >= 5; + } + } + base.ErrorMessage = "Password must contain atleast 1 digit!"; + return false; + } + } +} diff --git a/src/Web/DevHive.Web.Models/Attributes/GoodPasswordModelValidation.cs b/src/Web/DevHive.Web.Models/Attributes/GoodPasswordModelValidation.cs deleted file mode 100644 index 5ecb41a..0000000 --- a/src/Web/DevHive.Web.Models/Attributes/GoodPasswordModelValidation.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; - -namespace DevHive.Web.Models.Attributes -{ - public class GoodPassword : ValidationAttribute - { - public override bool IsValid(object value) - { - var stringValue = (string)value; - - for (int i = 0; i < stringValue.Length; i++) - { - if (Char.IsDigit(stringValue[i])) - { - base.ErrorMessage = "Password must be atleast 5 characters long!"; - return stringValue.Length >= 5; - } - } - base.ErrorMessage = "Password must contain atleast 1 digit!"; - return false; - } - } -} diff --git a/src/Web/DevHive.Web.Models/Attributes/OnlyLettersModelValidation.cs b/src/Web/DevHive.Web.Models/Attributes/OnlyLettersModelValidation.cs index 0f6adb1..faaeee4 100644 --- a/src/Web/DevHive.Web.Models/Attributes/OnlyLettersModelValidation.cs +++ b/src/Web/DevHive.Web.Models/Attributes/OnlyLettersModelValidation.cs @@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations; namespace DevHive.Web.Models.Attributes { - public class OnlyLetters : ValidationAttribute + public class OnlyLettersAttribute : ValidationAttribute { public override bool IsValid(object value) { @@ -11,7 +11,7 @@ namespace DevHive.Web.Models.Attributes foreach (char ch in stringValue) { - if (!Char.IsLetter(ch)) + if (!char.IsLetter(ch)) return false; } return true; diff --git a/src/Web/DevHive.Web.Models/DevHive.Web.Models.csproj b/src/Web/DevHive.Web.Models/DevHive.Web.Models.csproj index ca49b8c..64d0bd0 100644 --- a/src/Web/DevHive.Web.Models/DevHive.Web.Models.csproj +++ b/src/Web/DevHive.Web.Models/DevHive.Web.Models.csproj @@ -3,10 +3,10 @@ net5.0 - + - - + + - + \ No newline at end of file diff --git a/src/Web/DevHive.Web.Models/Post/ReadPostWebModel.cs b/src/Web/DevHive.Web.Models/Post/ReadPostWebModel.cs index 8238f47..3ae93aa 100644 --- a/src/Web/DevHive.Web.Models/Post/ReadPostWebModel.cs +++ b/src/Web/DevHive.Web.Models/Post/ReadPostWebModel.cs @@ -21,6 +21,5 @@ namespace DevHive.Web.Models.Post public List Comments { get; set; } public List FileUrls { get; set; } - // public List Files { get; set; } } } diff --git a/src/Web/DevHive.Web.Tests/CommentController.Tests.cs b/src/Web/DevHive.Web.Tests/CommentController.Tests.cs index 3a03f1a..98397e7 100644 --- a/src/Web/DevHive.Web.Tests/CommentController.Tests.cs +++ b/src/Web/DevHive.Web.Tests/CommentController.Tests.cs @@ -35,11 +35,11 @@ namespace DevHive.Web.Tests public void AddComment_ReturnsOkObjectResult_WhenCommentIsSuccessfullyCreated() { Guid id = Guid.NewGuid(); - CreateCommentWebModel createCommentWebModel = new CreateCommentWebModel + CreateCommentWebModel createCommentWebModel = new() { Message = MESSAGE }; - CreateCommentServiceModel createCommentServiceModel = new CreateCommentServiceModel + CreateCommentServiceModel createCommentServiceModel = new() { Message = MESSAGE }; @@ -67,11 +67,11 @@ namespace DevHive.Web.Tests public void AddComment_ReturnsBadRequestObjectResult_WhenCommentIsNotCreatedSuccessfully() { Guid id = Guid.NewGuid(); - CreateCommentWebModel createCommentWebModel = new CreateCommentWebModel + CreateCommentWebModel createCommentWebModel = new() { Message = MESSAGE }; - CreateCommentServiceModel createCommentServiceModel = new CreateCommentServiceModel + CreateCommentServiceModel createCommentServiceModel = new() { Message = MESSAGE }; @@ -86,8 +86,8 @@ namespace DevHive.Web.Tests Assert.IsInstanceOf(result); - BadRequestObjectResult badRequsetObjectResult = result as BadRequestObjectResult; - string resultMessage = badRequsetObjectResult.Value.ToString(); + BadRequestObjectResult badRequestObjectResult = result as BadRequestObjectResult; + string resultMessage = badRequestObjectResult.Value.ToString(); Assert.AreEqual(errorMessage, resultMessage); } @@ -95,8 +95,7 @@ namespace DevHive.Web.Tests [Test] public void AddComment_ReturnsUnauthorizedResult_WhenUserIsNotAuthorized() { - Guid id = Guid.NewGuid(); - CreateCommentWebModel createCommentWebModel = new CreateCommentWebModel + CreateCommentWebModel createCommentWebModel = new() { Message = MESSAGE }; @@ -115,11 +114,11 @@ namespace DevHive.Web.Tests { Guid id = Guid.NewGuid(); - ReadCommentServiceModel readCommentServiceModel = new ReadCommentServiceModel + ReadCommentServiceModel readCommentServiceModel = new() { Message = MESSAGE }; - ReadCommentWebModel readCommentWebModel = new ReadCommentWebModel + ReadCommentWebModel readCommentWebModel = new() { Message = MESSAGE }; @@ -132,7 +131,7 @@ namespace DevHive.Web.Tests Assert.IsInstanceOf(result); OkObjectResult okObjectResult = result as OkObjectResult; - ReadCommentWebModel resultModel = okObjectResult.Value as Models.Comment.ReadCommentWebModel; + ReadCommentWebModel resultModel = okObjectResult.Value as ReadCommentWebModel; Assert.AreEqual(MESSAGE, resultModel.Message); } @@ -143,11 +142,11 @@ namespace DevHive.Web.Tests public void Update_ShouldReturnOkResult_WhenCommentIsUpdatedSuccessfully() { Guid id = Guid.NewGuid(); - UpdateCommentWebModel updateCommentWebModel = new UpdateCommentWebModel + UpdateCommentWebModel updateCommentWebModel = new() { NewMessage = MESSAGE }; - UpdateCommentServiceModel updateCommentServiceModel = new UpdateCommentServiceModel + UpdateCommentServiceModel updateCommentServiceModel = new() { NewMessage = MESSAGE }; @@ -171,11 +170,11 @@ namespace DevHive.Web.Tests public void Update_ShouldReturnBadObjectResult_WhenCommentIsNotUpdatedSuccessfully() { string message = "Unable to update comment!"; - UpdateCommentWebModel updateCommentWebModel = new UpdateCommentWebModel + UpdateCommentWebModel updateCommentWebModel = new() { NewMessage = MESSAGE }; - UpdateCommentServiceModel updateCommentServiceModel = new UpdateCommentServiceModel + UpdateCommentServiceModel updateCommentServiceModel = new() { NewMessage = MESSAGE }; @@ -196,7 +195,7 @@ namespace DevHive.Web.Tests [Test] public void Update_ShouldReturnUnauthorizedResult_WhenUserIsNotAuthorized() { - UpdateCommentWebModel updateCommentWebModel = new UpdateCommentWebModel + UpdateCommentWebModel updateCommentWebModel = new() { NewMessage = MESSAGE }; @@ -224,7 +223,7 @@ namespace DevHive.Web.Tests } [Test] - public void DeletComment_ReturnsBadRequestObjectResult_WhenCommentIsNotDeletedSuccessfully() + public void DeleteComment_ReturnsBadRequestObjectResult_WhenCommentIsNotDeletedSuccessfully() { string message = "Could not delete Comment"; Guid id = Guid.NewGuid(); @@ -243,7 +242,7 @@ namespace DevHive.Web.Tests } [Test] - public void DeletComment_ReturnsUnauthorizedResult_WhenUserIsNotAuthorized() + public void DeleteComment_ReturnsUnauthorizedResult_WhenUserIsNotAuthorized() { this.CommentServiceMock.Setup(p => p.ValidateJwtForComment(It.IsAny(), It.IsAny())).Returns(Task.FromResult(false)); diff --git a/src/Web/DevHive.Web.Tests/DevHive.Web.Tests.csproj b/src/Web/DevHive.Web.Tests/DevHive.Web.Tests.csproj index f8390de..465698c 100644 --- a/src/Web/DevHive.Web.Tests/DevHive.Web.Tests.csproj +++ b/src/Web/DevHive.Web.Tests/DevHive.Web.Tests.csproj @@ -4,13 +4,14 @@ false - - - - + + + + + - + true diff --git a/src/Web/DevHive.Web.Tests/LanguageController.Tests.cs b/src/Web/DevHive.Web.Tests/LanguageController.Tests.cs index 7c8d64e..af4672a 100644 --- a/src/Web/DevHive.Web.Tests/LanguageController.Tests.cs +++ b/src/Web/DevHive.Web.Tests/LanguageController.Tests.cs @@ -81,8 +81,8 @@ namespace DevHive.Web.Tests Assert.IsInstanceOf(result); - BadRequestObjectResult badRequsetObjectResult = result as BadRequestObjectResult; - string resultMessage = badRequsetObjectResult.Value.ToString(); + BadRequestObjectResult badRequestObjectResult = result as BadRequestObjectResult; + string resultMessage = badRequestObjectResult.Value.ToString(); Assert.AreEqual(errorMessage, resultMessage); } diff --git a/src/Web/DevHive.Web.Tests/PostController.Tests.cs b/src/Web/DevHive.Web.Tests/PostController.Tests.cs index 96b0356..f10f8dd 100644 --- a/src/Web/DevHive.Web.Tests/PostController.Tests.cs +++ b/src/Web/DevHive.Web.Tests/PostController.Tests.cs @@ -32,11 +32,11 @@ namespace DevHive.Web.Tests [Test] public void CreatePost_ReturnsOkObjectResult_WhenPostIsSuccessfullyCreated() { - CreatePostWebModel createPostWebModel = new CreatePostWebModel + CreatePostWebModel createPostWebModel = new() { Message = MESSAGE }; - CreatePostServiceModel createPostServiceModel = new CreatePostServiceModel + CreatePostServiceModel createPostServiceModel = new() { Message = MESSAGE }; @@ -64,11 +64,11 @@ namespace DevHive.Web.Tests [Test] public void CreatePost_ReturnsBadRequestObjectResult_WhenPostIsNotCreatedSuccessfully() { - CreatePostWebModel createTechnologyWebModel = new CreatePostWebModel + CreatePostWebModel createTechnologyWebModel = new() { Message = MESSAGE }; - CreatePostServiceModel createTechnologyServiceModel = new CreatePostServiceModel + CreatePostServiceModel createTechnologyServiceModel = new() { Message = MESSAGE }; @@ -83,8 +83,8 @@ namespace DevHive.Web.Tests Assert.IsInstanceOf(result); - BadRequestObjectResult badRequsetObjectResult = result as BadRequestObjectResult; - string resultMessage = badRequsetObjectResult.Value.ToString(); + BadRequestObjectResult badRequestObjectResult = result as BadRequestObjectResult; + string resultMessage = badRequestObjectResult.Value.ToString(); Assert.AreEqual(errorMessage, resultMessage); } @@ -92,8 +92,7 @@ namespace DevHive.Web.Tests [Test] public void CreatePost_ReturnsUnauthorizedResult_WhenUserIsNotAuthorized() { - Guid id = Guid.NewGuid(); - CreatePostWebModel createPostWebModel = new CreatePostWebModel + CreatePostWebModel createPostWebModel = new() { Message = MESSAGE }; @@ -112,11 +111,11 @@ namespace DevHive.Web.Tests { Guid id = Guid.NewGuid(); - ReadPostServiceModel readPostServiceModel = new ReadPostServiceModel + ReadPostServiceModel readPostServiceModel = new() { Message = MESSAGE }; - ReadPostWebModel readPostWebModel = new ReadPostWebModel + ReadPostWebModel readPostWebModel = new() { Message = MESSAGE }; @@ -140,11 +139,11 @@ namespace DevHive.Web.Tests public void Update_ShouldReturnOkResult_WhenPostIsUpdatedSuccessfully() { Guid id = Guid.NewGuid(); - UpdatePostWebModel updatePostWebModel = new UpdatePostWebModel + UpdatePostWebModel updatePostWebModel = new() { NewMessage = MESSAGE }; - UpdatePostServiceModel updatePostServiceModel = new UpdatePostServiceModel + UpdatePostServiceModel updatePostServiceModel = new() { NewMessage = MESSAGE }; @@ -163,11 +162,11 @@ namespace DevHive.Web.Tests { Guid id = Guid.NewGuid(); string message = "Could not update post!"; - UpdatePostWebModel updatePostWebModel = new UpdatePostWebModel + UpdatePostWebModel updatePostWebModel = new() { NewMessage = MESSAGE }; - UpdatePostServiceModel updatePostServiceModel = new UpdatePostServiceModel + UpdatePostServiceModel updatePostServiceModel = new() { NewMessage = MESSAGE }; @@ -188,7 +187,7 @@ namespace DevHive.Web.Tests [Test] public void Update_ShouldReturnUnauthorizedResult_WhenUserIsNotAuthorized() { - UpdatePostWebModel updatePostWebModel = new UpdatePostWebModel + UpdatePostWebModel updatePostWebModel = new() { NewMessage = MESSAGE }; diff --git a/src/Web/DevHive.Web.Tests/RoleController.Tests.cs b/src/Web/DevHive.Web.Tests/RoleController.Tests.cs index 64e3f11..ff80dc0 100644 --- a/src/Web/DevHive.Web.Tests/RoleController.Tests.cs +++ b/src/Web/DevHive.Web.Tests/RoleController.Tests.cs @@ -81,8 +81,8 @@ namespace DevHive.Web.Tests Assert.IsInstanceOf(result); - BadRequestObjectResult badRequsetObjectResult = result as BadRequestObjectResult; - string resultMessage = badRequsetObjectResult.Value.ToString(); + BadRequestObjectResult badRequestObjectResult = result as BadRequestObjectResult; + string resultMessage = badRequestObjectResult.Value.ToString(); Assert.AreEqual(errorMessage, resultMessage); } diff --git a/src/Web/DevHive.Web.Tests/TechnologyController.Tests.cs b/src/Web/DevHive.Web.Tests/TechnologyController.Tests.cs index 164bcbf..a00f1db 100644 --- a/src/Web/DevHive.Web.Tests/TechnologyController.Tests.cs +++ b/src/Web/DevHive.Web.Tests/TechnologyController.Tests.cs @@ -84,8 +84,8 @@ namespace DevHive.Web.Tests Assert.IsInstanceOf(result); - BadRequestObjectResult badRequsetObjectResult = result as BadRequestObjectResult; - string resultMessage = badRequsetObjectResult.Value.ToString(); + BadRequestObjectResult badRequestObjectResult = result as BadRequestObjectResult; + string resultMessage = badRequestObjectResult.Value.ToString(); Assert.AreEqual(errorMessage, resultMessage); } diff --git a/src/Web/DevHive.Web.Tests/UserController.Tests.cs b/src/Web/DevHive.Web.Tests/UserController.Tests.cs index 7457ad7..13f618e 100644 --- a/src/Web/DevHive.Web.Tests/UserController.Tests.cs +++ b/src/Web/DevHive.Web.Tests/UserController.Tests.cs @@ -33,17 +33,17 @@ namespace DevHive.Web.Tests public void LoginUser_ReturnsOkObjectResult_WhenUserIsSuccessfullyLoggedIn() { Guid id = Guid.NewGuid(); - LoginWebModel loginWebModel = new LoginWebModel + LoginWebModel loginWebModel = new() { UserName = USERNAME }; - LoginServiceModel loginServiceModel = new LoginServiceModel + LoginServiceModel loginServiceModel = new() { UserName = USERNAME }; string token = "goshotrapov"; - TokenModel tokenModel = new TokenModel(token); - TokenWebModel tokenWebModel = new TokenWebModel(token); + TokenModel tokenModel = new(token); + TokenWebModel tokenWebModel = new(token); this.MapperMock.Setup(p => p.Map(It.IsAny())).Returns(loginServiceModel); this.MapperMock.Setup(p => p.Map(It.IsAny())).Returns(tokenWebModel); @@ -61,18 +61,17 @@ namespace DevHive.Web.Tests [Test] public void RegisterUser_ReturnsOkObjectResult_WhenUserIsSuccessfullyRegistered() { - Guid id = Guid.NewGuid(); - RegisterWebModel registerWebModel = new RegisterWebModel + RegisterWebModel registerWebModel = new() { UserName = USERNAME }; - RegisterServiceModel registerServiceModel = new RegisterServiceModel + RegisterServiceModel registerServiceModel = new() { UserName = USERNAME }; string token = "goshotrapov"; - TokenModel tokenModel = new TokenModel(token); - TokenWebModel tokenWebModel = new TokenWebModel(token); + TokenModel tokenModel = new(token); + TokenWebModel tokenWebModel = new(token); this.MapperMock.Setup(p => p.Map(It.IsAny())).Returns(registerServiceModel); this.MapperMock.Setup(p => p.Map(It.IsAny())).Returns(tokenWebModel); @@ -95,11 +94,11 @@ namespace DevHive.Web.Tests { Guid id = Guid.NewGuid(); - UserServiceModel userServiceModel = new UserServiceModel + UserServiceModel userServiceModel = new() { UserName = USERNAME }; - UserWebModel userWebModel = new UserWebModel + UserWebModel userWebModel = new() { UserName = USERNAME }; @@ -121,12 +120,6 @@ namespace DevHive.Web.Tests [Test] public void GetById_ReturnsUnauthorizedResult_WhenUserIsNotAuthorized() { - Guid id = Guid.NewGuid(); - UserWebModel userWebModel = new UserWebModel - { - UserName = USERNAME - }; - this.UserServiceMock.Setup(p => p.ValidJWT(It.IsAny(), It.IsAny())).Returns(Task.FromResult(false)); IActionResult result = this.UserController.GetById(Guid.NewGuid(), null).Result; @@ -137,12 +130,11 @@ namespace DevHive.Web.Tests [Test] public void GetUser_ReturnsTheUser_WhenItExists() { - Guid id = Guid.NewGuid(); - UserWebModel userWebModel = new UserWebModel + UserWebModel userWebModel = new() { UserName = USERNAME }; - UserServiceModel userServiceModel = new UserServiceModel + UserServiceModel userServiceModel = new() { UserName = USERNAME }; @@ -166,15 +158,15 @@ namespace DevHive.Web.Tests public void Update_ShouldReturnOkResult_WhenUserIsUpdatedSuccessfully() { Guid id = Guid.NewGuid(); - UpdateUserWebModel updateUserWebModel = new UpdateUserWebModel + UpdateUserWebModel updateUserWebModel = new() { UserName = USERNAME }; - UpdateUserServiceModel updateUserServiceModel = new UpdateUserServiceModel + UpdateUserServiceModel updateUserServiceModel = new() { UserName = USERNAME }; - UserServiceModel userServiceModel = new UserServiceModel + UserServiceModel userServiceModel = new() { UserName = USERNAME }; @@ -192,13 +184,13 @@ namespace DevHive.Web.Tests public void UpdateProfilePicture_ShouldReturnOkObjectResult_WhenProfilePictureIsUpdatedSuccessfully() { string profilePictureURL = "goshotrapov"; - UpdateProfilePictureWebModel updateProfilePictureWebModel = new UpdateProfilePictureWebModel(); - UpdateProfilePictureServiceModel updateProfilePictureServiceModel = new UpdateProfilePictureServiceModel(); - ProfilePictureServiceModel profilePictureServiceModel = new ProfilePictureServiceModel + UpdateProfilePictureWebModel updateProfilePictureWebModel = new(); + UpdateProfilePictureServiceModel updateProfilePictureServiceModel = new(); + ProfilePictureServiceModel profilePictureServiceModel = new() { ProfilePictureURL = profilePictureURL }; - ProfilePictureWebModel profilePictureWebModel = new ProfilePictureWebModel + ProfilePictureWebModel profilePictureWebModel = new() { ProfilePictureURL = profilePictureURL }; diff --git a/src/Web/DevHive.Web/Configurations/Extensions/ConfigureAutoMapper.cs b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureAutoMapper.cs index 8b7d657..0b8194e 100644 --- a/src/Web/DevHive.Web/Configurations/Extensions/ConfigureAutoMapper.cs +++ b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureAutoMapper.cs @@ -1,6 +1,5 @@ using System; using AutoMapper; -//using AutoMapper.Configuration; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; @@ -15,10 +14,10 @@ namespace DevHive.Web.Configurations.Extensions public static void UseAutoMapperConfiguration(this IApplicationBuilder app) { - var config = new MapperConfiguration(cfg => + _ = new MapperConfiguration(cfg => { cfg.AllowNullCollections = true; }); } } -} \ No newline at end of file +} diff --git a/src/Web/DevHive.Web/Configurations/Extensions/ConfigureExceptionHandlerMiddleware.cs b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureExceptionHandlerMiddleware.cs index 286727f..c017a8c 100644 --- a/src/Web/DevHive.Web/Configurations/Extensions/ConfigureExceptionHandlerMiddleware.cs +++ b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureExceptionHandlerMiddleware.cs @@ -6,8 +6,6 @@ namespace DevHive.Web.Configurations.Extensions { public static class ConfigureExceptionHandlerMiddleware { - public static void ExceptionHandlerMiddlewareConfiguration(this IServiceCollection services) { } - public static void UseExceptionHandlerMiddlewareConfiguration(this IApplicationBuilder app) { app.UseMiddleware(); diff --git a/src/Web/DevHive.Web/Configurations/Extensions/ConfigureJWT.cs b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureJWT.cs deleted file mode 100644 index d422bc8..0000000 --- a/src/Web/DevHive.Web/Configurations/Extensions/ConfigureJWT.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.Text; -using System.Threading.Tasks; -using DevHive.Services.Options; -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.IdentityModel.Tokens; - -namespace DevHive.Web.Configurations.Extensions -{ - public static class JWTExtensions - { - public static void JWTConfiguration(this IServiceCollection services, IConfiguration configuration) - { - services.AddSingleton(new JWTOptions(configuration - .GetSection("AppSettings") - .GetSection("Secret") - .Value)); - - // Get key from appsettings.json - var key = Encoding.ASCII.GetBytes(configuration - .GetSection("AppSettings") - .GetSection("Secret") - .Value); - - // Setup Jwt Authentication - services.AddAuthentication(x => - { - x.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; - x.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; - }) - .AddJwtBearer(x => - { - x.Events = new JwtBearerEvents - { - OnTokenValidated = context => - { - // TODO: add more authentication - return Task.CompletedTask; - } - }; - x.RequireHttpsMetadata = false; - x.SaveToken = true; - x.TokenValidationParameters = new TokenValidationParameters - { - //ValidateIssuerSigningKey = false, - IssuerSigningKey = new SymmetricSecurityKey(key), - ValidateIssuer = false, - ValidateAudience = false - }; - }); - } - } -} \ No newline at end of file diff --git a/src/Web/DevHive.Web/Configurations/Extensions/ConfigureJwt.cs b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureJwt.cs new file mode 100644 index 0000000..03d4b11 --- /dev/null +++ b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureJwt.cs @@ -0,0 +1,54 @@ +using System.Text; +using System.Threading.Tasks; +using DevHive.Services.Options; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.IdentityModel.Tokens; + +namespace DevHive.Web.Configurations.Extensions +{ + public static class ConfigureJwt + { + public static void JWTConfiguration(this IServiceCollection services, IConfiguration configuration) + { + services.AddSingleton(new JwtOptions(configuration + .GetSection("AppSettings") + .GetSection("Secret") + .Value)); + + // Get key from appsettings.json + var key = Encoding.ASCII.GetBytes(configuration + .GetSection("AppSettings") + .GetSection("Secret") + .Value); + + // Setup Jwt Authentication + services.AddAuthentication(x => + { + x.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; + x.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; + }) + .AddJwtBearer(x => + { + x.Events = new JwtBearerEvents + { + OnTokenValidated = context => + { + // TODO: add more authentication + return Task.CompletedTask; + } + }; + x.RequireHttpsMetadata = false; + x.SaveToken = true; + x.TokenValidationParameters = new TokenValidationParameters + { + //ValidateIssuerSigningKey = false, + IssuerSigningKey = new SymmetricSecurityKey(key), + ValidateIssuer = false, + ValidateAudience = false + }; + }); + } + } +} diff --git a/src/Web/DevHive.Web/DevHive.Web.csproj b/src/Web/DevHive.Web/DevHive.Web.csproj index 6f78b69..6511c37 100644 --- a/src/Web/DevHive.Web/DevHive.Web.csproj +++ b/src/Web/DevHive.Web/DevHive.Web.csproj @@ -7,21 +7,22 @@ latest - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - - - + + + + + + + - - + + \ No newline at end of file diff --git a/src/Web/DevHive.Web/Middleware/ExceptionMiddleware.cs b/src/Web/DevHive.Web/Middleware/ExceptionMiddleware.cs index cb6d4ca..f159b69 100644 --- a/src/Web/DevHive.Web/Middleware/ExceptionMiddleware.cs +++ b/src/Web/DevHive.Web/Middleware/ExceptionMiddleware.cs @@ -9,18 +9,11 @@ namespace DevHive.Web.Middleware public class ExceptionMiddleware { private readonly RequestDelegate _next; - // private readonly ILogger _logger; public ExceptionMiddleware(RequestDelegate next) { this._next = next; - // this._logger = logger; } - // public ExceptionMiddleware(RequestDelegate next, ILogger logger) - // { - // this._logger = logger; - // this._next = next; - // } public async Task InvokeAsync(HttpContext httpContext) { @@ -30,20 +23,19 @@ namespace DevHive.Web.Middleware } catch (Exception ex) { - // this._logger.LogError($"Something went wrong: {ex}"); await HandleExceptionAsync(httpContext, ex); } } - private Task HandleExceptionAsync(HttpContext context, Exception exception) + private static Task HandleExceptionAsync(HttpContext context, Exception exception) { context.Response.ContentType = "application/json"; context.Response.StatusCode = (int)HttpStatusCode.BadRequest; return context.Response.WriteAsync(new { - StatusCode = context.Response.StatusCode, - Message = exception.Message + context.Response.StatusCode, + exception.Message }.ToString()); } } -- cgit v1.2.3 From ebf488fd51a2d1a83c124c380b9a1a98d62f42a2 Mon Sep 17 00:00:00 2001 From: transtrike Date: Mon, 15 Feb 2021 21:50:36 +0200 Subject: Fixed formatting; Adjusted warnings; Adjusted variable names --- src/Data/DevHive.Data.Models/Comment.cs | 2 + .../DevHive.Data/Interfaces/ILanguageRepository.cs | 2 +- .../DevHive.Data/Interfaces/IPostRepository.cs | 2 +- .../Interfaces/ITechnologyRepository.cs | 2 +- .../DevHive.Services/Interfaces/ICommentService.cs | 2 +- .../DevHive.Services/Interfaces/IRoleService.cs | 2 +- .../DevHive.Services/Interfaces/IUserService.cs | 2 +- .../DevHive.Services/Services/CommentService.cs | 1 - .../DevHive.Services/Services/FeedService.cs | 12 +++--- .../DevHive.Services/Services/RateService.cs | 2 +- .../DevHive.Web.Tests/CommentController.Tests.cs | 2 - src/Web/DevHive.Web.Tests/UserController.Tests.cs | 1 - .../Configurations/Extensions/ConfigureJwt.cs | 2 - src/Web/DevHive.Web/Program.cs | 48 +++++++++++----------- 14 files changed, 40 insertions(+), 42 deletions(-) (limited to 'src/Services/DevHive.Services/Interfaces/IRoleService.cs') diff --git a/src/Data/DevHive.Data.Models/Comment.cs b/src/Data/DevHive.Data.Models/Comment.cs index 10a3aaf..f907e43 100644 --- a/src/Data/DevHive.Data.Models/Comment.cs +++ b/src/Data/DevHive.Data.Models/Comment.cs @@ -8,9 +8,11 @@ namespace DevHive.Data.Models public Guid Id { get; set; } // public Guid PostId { get; set; } + public Post Post { get; set; } // public Guid CreatorId { get; set; } + public User Creator { get; set; } public string Message { get; set; } diff --git a/src/Data/DevHive.Data/Interfaces/ILanguageRepository.cs b/src/Data/DevHive.Data/Interfaces/ILanguageRepository.cs index 4771f91..ea0e8c6 100644 --- a/src/Data/DevHive.Data/Interfaces/ILanguageRepository.cs +++ b/src/Data/DevHive.Data/Interfaces/ILanguageRepository.cs @@ -9,7 +9,7 @@ namespace DevHive.Data.Interfaces public interface ILanguageRepository : IRepository { HashSet GetLanguages(); - Task GetByNameAsync(string name); + Task GetByNameAsync(string languageName); Task DoesLanguageExistAsync(Guid id); Task DoesLanguageNameExistAsync(string languageName); diff --git a/src/Data/DevHive.Data/Interfaces/IPostRepository.cs b/src/Data/DevHive.Data/Interfaces/IPostRepository.cs index c24d596..5a04aed 100644 --- a/src/Data/DevHive.Data/Interfaces/IPostRepository.cs +++ b/src/Data/DevHive.Data/Interfaces/IPostRepository.cs @@ -10,7 +10,7 @@ namespace DevHive.Data.Interfaces { Task AddNewPostToCreator(Guid userId, Post post); - Task GetPostByCreatorAndTimeCreatedAsync(Guid issuerId, DateTime timeCreated); + Task GetPostByCreatorAndTimeCreatedAsync(Guid creatorId, DateTime timeCreated); Task> GetFileUrls(Guid postId); Task DoesPostExist(Guid postId); diff --git a/src/Data/DevHive.Data/Interfaces/ITechnologyRepository.cs b/src/Data/DevHive.Data/Interfaces/ITechnologyRepository.cs index 3e55b2d..f746d9d 100644 --- a/src/Data/DevHive.Data/Interfaces/ITechnologyRepository.cs +++ b/src/Data/DevHive.Data/Interfaces/ITechnologyRepository.cs @@ -8,7 +8,7 @@ namespace DevHive.Data.Interfaces { public interface ITechnologyRepository : IRepository { - Task GetByNameAsync(string name); + Task GetByNameAsync(string technologyName); HashSet GetTechnologies(); Task DoesTechnologyExistAsync(Guid id); diff --git a/src/Services/DevHive.Services/Interfaces/ICommentService.cs b/src/Services/DevHive.Services/Interfaces/ICommentService.cs index e7409a8..6d92a5d 100644 --- a/src/Services/DevHive.Services/Interfaces/ICommentService.cs +++ b/src/Services/DevHive.Services/Interfaces/ICommentService.cs @@ -6,7 +6,7 @@ namespace DevHive.Services.Interfaces { public interface ICommentService { - Task AddComment(CreateCommentServiceModel createPostServiceModel); + Task AddComment(CreateCommentServiceModel createCommentServiceModel); Task GetCommentById(Guid id); diff --git a/src/Services/DevHive.Services/Interfaces/IRoleService.cs b/src/Services/DevHive.Services/Interfaces/IRoleService.cs index 05df917..36e5a01 100644 --- a/src/Services/DevHive.Services/Interfaces/IRoleService.cs +++ b/src/Services/DevHive.Services/Interfaces/IRoleService.cs @@ -10,7 +10,7 @@ namespace DevHive.Services.Interfaces Task GetRoleById(Guid id); - Task UpdateRole(UpdateRoleServiceModel roleServiceModel); + Task UpdateRole(UpdateRoleServiceModel updateRoleServiceModel); Task DeleteRole(Guid id); } diff --git a/src/Services/DevHive.Services/Interfaces/IUserService.cs b/src/Services/DevHive.Services/Interfaces/IUserService.cs index daa5e5e..4a9ffc8 100644 --- a/src/Services/DevHive.Services/Interfaces/IUserService.cs +++ b/src/Services/DevHive.Services/Interfaces/IUserService.cs @@ -13,7 +13,7 @@ namespace DevHive.Services.Interfaces Task GetUserByUsername(string username); Task GetUserById(Guid id); - Task UpdateUser(UpdateUserServiceModel updateModel); + Task UpdateUser(UpdateUserServiceModel updateUserServiceModel); Task UpdateProfilePicture(UpdateProfilePictureServiceModel updateProfilePictureServiceModel); Task DeleteUser(Guid id); diff --git a/src/Services/DevHive.Services/Services/CommentService.cs b/src/Services/DevHive.Services/Services/CommentService.cs index e14f3bb..b48bac8 100644 --- a/src/Services/DevHive.Services/Services/CommentService.cs +++ b/src/Services/DevHive.Services/Services/CommentService.cs @@ -142,7 +142,6 @@ namespace DevHive.Services.Services JwtSecurityToken jwt = new JwtSecurityTokenHandler().ReadJwtToken(rawTokenData.Remove(0, 7)); Guid jwtUserId = Guid.Parse(this.GetClaimTypeValues("ID", jwt.Claims).First()); - //HashSet jwtRoleNames = this.GetClaimTypeValues("role", jwt.Claims); User user = await this._userRepository.GetByIdAsync(jwtUserId) ?? throw new ArgumentException("User does not exist!"); diff --git a/src/Services/DevHive.Services/Services/FeedService.cs b/src/Services/DevHive.Services/Services/FeedService.cs index 17cc43f..c16ffae 100644 --- a/src/Services/DevHive.Services/Services/FeedService.cs +++ b/src/Services/DevHive.Services/Services/FeedService.cs @@ -28,14 +28,14 @@ namespace DevHive.Services.Services /// This method is used in the feed page. /// See the FeedRepository "GetFriendsPosts" menthod for more information on how it works. /// - public async Task GetPage(GetPageServiceModel model) + public async Task GetPage(GetPageServiceModel getPageServiceModel) { User user = null; - if (model.UserId != Guid.Empty) - user = await this._userRepository.GetByIdAsync(model.UserId); - else if (!string.IsNullOrEmpty(model.Username)) - user = await this._userRepository.GetByUsernameAsync(model.Username); + if (getPageServiceModel.UserId != Guid.Empty) + user = await this._userRepository.GetByIdAsync(getPageServiceModel.UserId); + else if (!string.IsNullOrEmpty(getPageServiceModel.Username)) + user = await this._userRepository.GetByUsernameAsync(getPageServiceModel.Username); else throw new ArgumentException("Invalid given data!"); @@ -46,7 +46,7 @@ namespace DevHive.Services.Services throw new ArgumentException("User has no friends to get feed from!"); List posts = await this._feedRepository - .GetFriendsPosts(user.Friends.ToList(), model.FirstRequestIssued, model.PageNumber, model.PageSize); + .GetFriendsPosts(user.Friends.ToList(), getPageServiceModel.FirstRequestIssued, getPageServiceModel.PageNumber, getPageServiceModel.PageSize); ReadPageServiceModel readPageServiceModel = new(); foreach (Post post in posts) diff --git a/src/Services/DevHive.Services/Services/RateService.cs b/src/Services/DevHive.Services/Services/RateService.cs index 5e924ab..caf4b80 100644 --- a/src/Services/DevHive.Services/Services/RateService.cs +++ b/src/Services/DevHive.Services/Services/RateService.cs @@ -28,7 +28,7 @@ namespace DevHive.Services.Services { throw new NotImplementedException(); // if (!await this._postRepository.DoesPostExist(ratePostServiceModel.PostId)) - // throw new ArgumentException("Post does not exist!"); + // throw new ArgumentException("Post does not exist!"); // if (!await this._userRepository.DoesUserExistAsync(ratePostServiceModel.UserId)) // throw new ArgumentException("User does not exist!"); diff --git a/src/Web/DevHive.Web.Tests/CommentController.Tests.cs b/src/Web/DevHive.Web.Tests/CommentController.Tests.cs index 98397e7..7860f3c 100644 --- a/src/Web/DevHive.Web.Tests/CommentController.Tests.cs +++ b/src/Web/DevHive.Web.Tests/CommentController.Tests.cs @@ -66,7 +66,6 @@ namespace DevHive.Web.Tests [Test] public void AddComment_ReturnsBadRequestObjectResult_WhenCommentIsNotCreatedSuccessfully() { - Guid id = Guid.NewGuid(); CreateCommentWebModel createCommentWebModel = new() { Message = MESSAGE @@ -113,7 +112,6 @@ namespace DevHive.Web.Tests public void GetById_ReturnsTheComment_WhenItExists() { Guid id = Guid.NewGuid(); - ReadCommentServiceModel readCommentServiceModel = new() { Message = MESSAGE diff --git a/src/Web/DevHive.Web.Tests/UserController.Tests.cs b/src/Web/DevHive.Web.Tests/UserController.Tests.cs index 13f618e..e12738e 100644 --- a/src/Web/DevHive.Web.Tests/UserController.Tests.cs +++ b/src/Web/DevHive.Web.Tests/UserController.Tests.cs @@ -32,7 +32,6 @@ namespace DevHive.Web.Tests [Test] public void LoginUser_ReturnsOkObjectResult_WhenUserIsSuccessfullyLoggedIn() { - Guid id = Guid.NewGuid(); LoginWebModel loginWebModel = new() { UserName = USERNAME diff --git a/src/Web/DevHive.Web/Configurations/Extensions/ConfigureJwt.cs b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureJwt.cs index 03d4b11..8d387bd 100644 --- a/src/Web/DevHive.Web/Configurations/Extensions/ConfigureJwt.cs +++ b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureJwt.cs @@ -35,7 +35,6 @@ namespace DevHive.Web.Configurations.Extensions { OnTokenValidated = context => { - // TODO: add more authentication return Task.CompletedTask; } }; @@ -43,7 +42,6 @@ namespace DevHive.Web.Configurations.Extensions x.SaveToken = true; x.TokenValidationParameters = new TokenValidationParameters { - //ValidateIssuerSigningKey = false, IssuerSigningKey = new SymmetricSecurityKey(key), ValidateIssuer = false, ValidateAudience = false diff --git a/src/Web/DevHive.Web/Program.cs b/src/Web/DevHive.Web/Program.cs index 6982da9..fdb6889 100644 --- a/src/Web/DevHive.Web/Program.cs +++ b/src/Web/DevHive.Web/Program.cs @@ -1,23 +1,25 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Hosting; - -namespace DevHive.Web -{ - public class Program - { - private const int HTTP_PORT = 5000; - - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.ConfigureKestrel(opt => opt.ListenLocalhost(HTTP_PORT)); - webBuilder.UseStartup(); - }); - } -} +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace DevHive.Web +{ + #pragma warning disable IDE0055, S1118 + + public class Program + { + private const int HTTP_PORT = 5000; + + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.ConfigureKestrel(opt => opt.ListenLocalhost(HTTP_PORT)); + webBuilder.UseStartup(); + }); + } +} -- cgit v1.2.3