|
@@ -114,6 +114,17 @@ namespace GxPress.Repository.Implement
|
|
|
/// <returns></returns>
|
|
|
public async Task<IEnumerable<ArticleGroupUserListResult>> GetListAsync(ArticleGroupUserSearchRequest request)
|
|
|
{
|
|
|
+ var result = new List<ArticleGroupUserListResult>();
|
|
|
+ var articleGroups = await _articleGroupRepository.GetAllAsync(Q.Where(nameof(Entity.ArticleGroup.IsSystemDefault), true));
|
|
|
+ foreach (var item in articleGroups)
|
|
|
+ result.Add(new ArticleGroupUserListResult
|
|
|
+ {
|
|
|
+ Id = 0,
|
|
|
+ ArticleGroupId = item.Id,
|
|
|
+ ArticleGroupName = item.Name,
|
|
|
+ IsSystemDefault = item.IsSystemDefault,
|
|
|
+ UserId = request.UserId
|
|
|
+ });
|
|
|
var list = await _repository.GetAllAsync(Q.Where(nameof(ArticleGroupUser.UserId), request.UserId));
|
|
|
var listArray = list.Select(n => _mapper.Map<ArticleGroupUserListResult>(n)).ToList();
|
|
|
foreach (var item in listArray)
|
|
@@ -121,8 +132,8 @@ namespace GxPress.Repository.Implement
|
|
|
var articleGroup = await _articleGroupRepository.GetAsync(item.ArticleGroupId);
|
|
|
item.ArticleGroupName = articleGroup.Name;
|
|
|
}
|
|
|
-
|
|
|
- return listArray;
|
|
|
+ result.AddRange(listArray);
|
|
|
+ return result;
|
|
|
}
|
|
|
}
|
|
|
}
|