Created all endpoints to manage groups
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using Ardalis.Specification;
|
||||
using BeReadyBackend.Models;
|
||||
|
||||
namespace BeReadyBackend.Specifications.Groups;
|
||||
|
||||
public class GetGroupRankSpec : Specification<UserGroup>
|
||||
{
|
||||
public GetGroupRankSpec(int id)
|
||||
{
|
||||
Query
|
||||
.Where(x => x.GroupId == id)
|
||||
.OrderByDescending(x => x.Score);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using BeReadyBackend.Models;
|
||||
|
||||
namespace BeReadyBackend.Specifications.Groups;
|
||||
|
||||
public class GetUserGroupDetailsByIdSpec : Specification<UserGroup>
|
||||
{
|
||||
public GetUserGroupDetailsByIdSpec(int groupId)
|
||||
{
|
||||
Query
|
||||
.Where(x => x.GroupId == groupId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using Ardalis.Specification;
|
||||
using BeReadyBackend.Models;
|
||||
|
||||
namespace BeReadyBackend.Specifications.Groups;
|
||||
|
||||
public class GetUserInGroupByIdsSpec : SingleResultSpecification<UserGroup>
|
||||
{
|
||||
public GetUserInGroupByIdsSpec(int groupId, int userId)
|
||||
{
|
||||
Query
|
||||
.Include(x => x.Group)
|
||||
.Where(x => x.GroupId == groupId && x.UserId == userId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user