Created all endpoints and DTO to achievements
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using BeReadyBackend.Models;
|
||||
|
||||
namespace BeReadyBackend.Specifications.Achievements;
|
||||
|
||||
public class GetAchievementByIdSpec : SingleResultSpecification<Achievement>
|
||||
{
|
||||
public GetAchievementByIdSpec(int achievementId)
|
||||
{
|
||||
Query
|
||||
.Where(x => x.Id == achievementId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using BeReadyBackend.Models;
|
||||
|
||||
namespace BeReadyBackend.Specifications.UserAchievements;
|
||||
|
||||
public class GetUserAchievementByIdSpec : SingleResultSpecification<UserAchievement>
|
||||
{
|
||||
public GetUserAchievementByIdSpec(int userId, int achievementId)
|
||||
{
|
||||
Query
|
||||
.Where(x => x.UserId == userId && x.AchievementId == achievementId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using Ardalis.Specification;
|
||||
using BeReadyBackend.Models;
|
||||
|
||||
namespace BeReadyBackend.Specifications.UserAchievements;
|
||||
|
||||
public class GetUserAchievementByUserIdSpec : Specification<UserAchievement>
|
||||
{
|
||||
public GetUserAchievementByUserIdSpec(int userId)
|
||||
{
|
||||
Query
|
||||
.Include(x => x.Achievement)
|
||||
.Where(x => x.UserId == userId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using BeReadyBackend.Models;
|
||||
|
||||
namespace BeReadyBackend.Specifications.Users;
|
||||
|
||||
public class GetUserByIdSpec : SingleResultSpecification<User>
|
||||
{
|
||||
public GetUserByIdSpec(int userId)
|
||||
{
|
||||
Query
|
||||
.Where(x => x.Id == userId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user