refactor: Entfernen der right_group-Eigenschaft aus der Representation-Entität
- Die Spalte `right_group` aus der `Representation`-Entität entfernt, um die Zuordnung von Benutzern oder Gruppen zu spezifischen Gruppen zu entfernen. - Stattdessen wurde die `group`-Eigenschaft hinzugefügt, um flexible Zuordnungen zu ermöglichen. - Ermöglicht nun `user-user`, `user-group`, `group-user` und `group-group` Repräsentationen.
This commit is contained in:
@@ -6,6 +6,6 @@ namespace DigitalData.UserManager.Application.Contracts
|
||||
{
|
||||
public interface IUserRepService : IBaseService<UserRepCreateDto, UserRepReadDto, UserRepUpdateDto, UserRep>
|
||||
{
|
||||
Task<DataResult<IEnumerable<UserRepReadDto>>> ReadAllAsync(bool withUser = false, bool withRepGroup = false, bool withRightGroup = false, bool withRepUser = false, int? userId = null);
|
||||
Task<DataResult<IEnumerable<UserRepReadDto>>> ReadAllAsync(bool withUser = false, bool withRepGroup = false, bool withGroup = false, bool withRepUser = false, int? userId = null, int? groupId = null);
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,7 @@ namespace DigitalData.UserManager.Application.DTOs.UserRep
|
||||
public record UserRepCreateDto(
|
||||
int UserId,
|
||||
int? RepGroupId,
|
||||
int RightGroupId,
|
||||
string AddedWho,
|
||||
int? GroupId,
|
||||
int RepUserId
|
||||
) : BaseCreateDto();
|
||||
}
|
||||
@@ -8,13 +8,13 @@ namespace DigitalData.UserManager.Application.DTOs.UserRep
|
||||
int Id,
|
||||
int UserId,
|
||||
int? RepGroupId,
|
||||
int RightGroupId,
|
||||
int? GroupId,
|
||||
string AddedWho,
|
||||
string ChangedWho,
|
||||
int? RepUserId,
|
||||
UserReadDto? User,
|
||||
GroupReadDto? RepGroup,
|
||||
GroupReadDto? RightGroup,
|
||||
GroupReadDto? Group,
|
||||
UserReadDto? RepUser,
|
||||
DateTime? AddedWhen,
|
||||
DateTime? ChangedWhen
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace DigitalData.UserManager.Application.DTOs.UserRep
|
||||
public record UserRepUpdateDto(
|
||||
int UserId,
|
||||
int? RepGroupId,
|
||||
int RightGroupId,
|
||||
int? GroupId,
|
||||
int RepUserId
|
||||
) : BaseUpdateDto();
|
||||
}
|
||||
@@ -15,9 +15,9 @@ namespace DigitalData.UserManager.Application.Services
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<DataResult<IEnumerable<UserRepReadDto>>> ReadAllAsync(bool withUser = false, bool withRepGroup = false, bool withRightGroup = false, bool withRepUser = false, int? userId = null)
|
||||
public async Task<DataResult<IEnumerable<UserRepReadDto>>> ReadAllAsync(bool withUser = false, bool withRepGroup = false, bool withGroup = false, bool withRepUser = false, int? userId = null, int? groupId = null)
|
||||
{
|
||||
var urs = await _repository.ReadAllAsync(withUser, withRepGroup, withRightGroup, withRepUser, userId);
|
||||
var urs = await _repository.ReadAllAsync(withUser, withRepGroup, withGroup, withRepUser, userId, groupId);
|
||||
var urReadDTOs = _mapper.MapOrThrow<IEnumerable<UserRepReadDto>>(urs);
|
||||
return Result.Success(urReadDTOs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user