From 866a5a15b8b722bc78d065f73adc0c465f264f55 Mon Sep 17 00:00:00 2001 From: transtrike Date: Sat, 30 Jan 2021 18:45:18 +0200 Subject: IDFK --- src/DevHive.Data/Interfaces/Models/IRating.cs | 14 ++++++++++++++ src/DevHive.Data/Interfaces/Models/IUser.cs | 1 + .../Interfaces/Repositories/IRatingRepository.cs | 15 +++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 src/DevHive.Data/Interfaces/Models/IRating.cs create mode 100644 src/DevHive.Data/Interfaces/Repositories/IRatingRepository.cs (limited to 'src/DevHive.Data/Interfaces') diff --git a/src/DevHive.Data/Interfaces/Models/IRating.cs b/src/DevHive.Data/Interfaces/Models/IRating.cs new file mode 100644 index 0000000..4604a75 --- /dev/null +++ b/src/DevHive.Data/Interfaces/Models/IRating.cs @@ -0,0 +1,14 @@ +using DevHive.Data.Interfaces.Models; +using DevHive.Data.Models; + +namespace DevHive.Data.Interfaces.Models +{ + public interface IRating : IModel + { + Post Post { get; set; } + + int Likes { get; set; } + + int Dislikes { get; set; } + } +} diff --git a/src/DevHive.Data/Interfaces/Models/IUser.cs b/src/DevHive.Data/Interfaces/Models/IUser.cs index 08ce385..3e3ee7d 100644 --- a/src/DevHive.Data/Interfaces/Models/IUser.cs +++ b/src/DevHive.Data/Interfaces/Models/IUser.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using DevHive.Data.Models; +using DevHive.Data.RelationModels; namespace DevHive.Data.Interfaces.Models { diff --git a/src/DevHive.Data/Interfaces/Repositories/IRatingRepository.cs b/src/DevHive.Data/Interfaces/Repositories/IRatingRepository.cs new file mode 100644 index 0000000..de4e3f2 --- /dev/null +++ b/src/DevHive.Data/Interfaces/Repositories/IRatingRepository.cs @@ -0,0 +1,15 @@ +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 GetByPostId(Guid postId); + Task> GetRating(Guid postId); + + Task HasUserRatedThisPost(Guid userId, Guid postId); + } +} -- cgit v1.2.3