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/ICloudService.cs | 16 ++++++++++++++ .../DevHive.Services/Interfaces/ICommentService.cs | 20 +++++++++++++++++ .../DevHive.Services/Interfaces/IFeedService.cs | 11 ++++++++++ .../Interfaces/ILanguageService.cs | 19 ++++++++++++++++ .../DevHive.Services/Interfaces/IPostService.cs | 20 +++++++++++++++++ .../DevHive.Services/Interfaces/IRateService.cs | 14 ++++++++++++ .../DevHive.Services/Interfaces/IRoleService.cs | 17 +++++++++++++++ .../Interfaces/ITechnologyService.cs | 19 ++++++++++++++++ .../DevHive.Services/Interfaces/IUserService.cs | 25 ++++++++++++++++++++++ 9 files changed, 161 insertions(+) create mode 100644 src/Services/DevHive.Services/Interfaces/ICloudService.cs create mode 100644 src/Services/DevHive.Services/Interfaces/ICommentService.cs create mode 100644 src/Services/DevHive.Services/Interfaces/IFeedService.cs create mode 100644 src/Services/DevHive.Services/Interfaces/ILanguageService.cs create mode 100644 src/Services/DevHive.Services/Interfaces/IPostService.cs create mode 100644 src/Services/DevHive.Services/Interfaces/IRateService.cs create mode 100644 src/Services/DevHive.Services/Interfaces/IRoleService.cs create mode 100644 src/Services/DevHive.Services/Interfaces/ITechnologyService.cs create mode 100644 src/Services/DevHive.Services/Interfaces/IUserService.cs (limited to 'src/Services/DevHive.Services/Interfaces') diff --git a/src/Services/DevHive.Services/Interfaces/ICloudService.cs b/src/Services/DevHive.Services/Interfaces/ICloudService.cs new file mode 100644 index 0000000..3ae7a24 --- /dev/null +++ b/src/Services/DevHive.Services/Interfaces/ICloudService.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace DevHive.Services.Interfaces +{ + public interface ICloudService + { + Task> UploadFilesToCloud(List formFiles); + + // Task> GetFilesFromCloud(List fileUrls); + + Task RemoveFilesFromCloud(List fileUrls); + } +} diff --git a/src/Services/DevHive.Services/Interfaces/ICommentService.cs b/src/Services/DevHive.Services/Interfaces/ICommentService.cs new file mode 100644 index 0000000..e7409a8 --- /dev/null +++ b/src/Services/DevHive.Services/Interfaces/ICommentService.cs @@ -0,0 +1,20 @@ +using System; +using System.Threading.Tasks; +using DevHive.Services.Models.Comment; + +namespace DevHive.Services.Interfaces +{ + public interface ICommentService + { + Task AddComment(CreateCommentServiceModel createPostServiceModel); + + Task GetCommentById(Guid id); + + Task UpdateComment(UpdateCommentServiceModel updateCommentServiceModel); + + Task DeleteComment(Guid id); + + Task ValidateJwtForCreating(Guid userId, string rawTokenData); + Task ValidateJwtForComment(Guid commentId, string rawTokenData); + } +} diff --git a/src/Services/DevHive.Services/Interfaces/IFeedService.cs b/src/Services/DevHive.Services/Interfaces/IFeedService.cs new file mode 100644 index 0000000..b507b3b --- /dev/null +++ b/src/Services/DevHive.Services/Interfaces/IFeedService.cs @@ -0,0 +1,11 @@ +using System.Threading.Tasks; +using DevHive.Services.Models; + +namespace DevHive.Services.Interfaces +{ + public interface IFeedService + { + Task GetPage(GetPageServiceModel getPageServiceModel); + Task GetUserPage(GetPageServiceModel model); + } +} diff --git a/src/Services/DevHive.Services/Interfaces/ILanguageService.cs b/src/Services/DevHive.Services/Interfaces/ILanguageService.cs new file mode 100644 index 0000000..fabbec2 --- /dev/null +++ b/src/Services/DevHive.Services/Interfaces/ILanguageService.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using DevHive.Services.Models.Language; + +namespace DevHive.Services.Interfaces +{ + public interface ILanguageService + { + Task CreateLanguage(CreateLanguageServiceModel createLanguageServiceModel); + + Task GetLanguageById(Guid id); + HashSet GetLanguages(); + + Task UpdateLanguage(UpdateLanguageServiceModel languageServiceModel); + + Task DeleteLanguage(Guid id); + } +} diff --git a/src/Services/DevHive.Services/Interfaces/IPostService.cs b/src/Services/DevHive.Services/Interfaces/IPostService.cs new file mode 100644 index 0000000..d35acfd --- /dev/null +++ b/src/Services/DevHive.Services/Interfaces/IPostService.cs @@ -0,0 +1,20 @@ +using System; +using System.Threading.Tasks; +using DevHive.Services.Models.Post; + +namespace DevHive.Services.Interfaces +{ + public interface IPostService + { + Task CreatePost(CreatePostServiceModel createPostServiceModel); + + Task GetPostById(Guid id); + + Task UpdatePost(UpdatePostServiceModel updatePostServiceModel); + + Task DeletePost(Guid id); + + Task ValidateJwtForCreating(Guid userId, string rawTokenData); + Task ValidateJwtForPost(Guid postId, string rawTokenData); + } +} diff --git a/src/Services/DevHive.Services/Interfaces/IRateService.cs b/src/Services/DevHive.Services/Interfaces/IRateService.cs new file mode 100644 index 0000000..359ef55 --- /dev/null +++ b/src/Services/DevHive.Services/Interfaces/IRateService.cs @@ -0,0 +1,14 @@ +using System; +using System.Threading.Tasks; +using DevHive.Data.Models; +using DevHive.Services.Models.Post.Rating; + +namespace DevHive.Services.Interfaces +{ + public interface IRateService + { + Task RatePost(RatePostServiceModel ratePostServiceModel); + + bool HasUserRatedThisPost(User user, Post post); + } +} 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); + } +} diff --git a/src/Services/DevHive.Services/Interfaces/ITechnologyService.cs b/src/Services/DevHive.Services/Interfaces/ITechnologyService.cs new file mode 100644 index 0000000..8f9510c --- /dev/null +++ b/src/Services/DevHive.Services/Interfaces/ITechnologyService.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using DevHive.Services.Models.Technology; + +namespace DevHive.Services.Interfaces +{ + public interface ITechnologyService + { + Task CreateTechnology(CreateTechnologyServiceModel technologyServiceModel); + + Task GetTechnologyById(Guid id); + HashSet GetTechnologies(); + + Task UpdateTechnology(UpdateTechnologyServiceModel updateTechnologyServiceModel); + + Task DeleteTechnology(Guid id); + } +} diff --git a/src/Services/DevHive.Services/Interfaces/IUserService.cs b/src/Services/DevHive.Services/Interfaces/IUserService.cs new file mode 100644 index 0000000..9e2b4e3 --- /dev/null +++ b/src/Services/DevHive.Services/Interfaces/IUserService.cs @@ -0,0 +1,25 @@ +using System; +using System.Threading.Tasks; +using DevHive.Common.Models.Identity; +using DevHive.Services.Models.Identity.User; + +namespace DevHive.Services.Interfaces +{ + public interface IUserService + { + Task LoginUser(LoginServiceModel loginModel); + Task RegisterUser(RegisterServiceModel registerModel); + + Task GetUserByUsername(string username); + Task GetUserById(Guid id); + + Task UpdateUser(UpdateUserServiceModel updateModel); + Task UpdateProfilePicture(UpdateProfilePictureServiceModel updateProfilePictureServiceModel); + + Task DeleteUser(Guid id); + + Task ValidJWT(Guid id, string rawTokenData); + + Task SuperSecretPromotionToAdmin(Guid userId); + } +} -- cgit v1.2.3