// TODO: 完善分类树的接口 完善从数据库读取的功能。 /// <summary> /// 获取分类列表树 /// </summary> /// <param name="input"></param> /// <returns></returns> public virtual async Task <List <CategoryDto> > GetAllListAsync(GetCategoryListDto input) { //var root = _categoryRepository.Where(x => x.ParentId == null).ToList(); // TODO: 把数据库查询 移到 Repository里面 var root = ObjectMapper.Map <List <Category>, List <CategoryDto> >( _categoryRepository.Where(x => x.ParentId == input.ParentId).ToList()); foreach (var ouDto in root) { await TraverseTreeAsync(ouDto, ouDto.Children); } return(root); }
public Task <PagedResultDto <CategoryDto> > GetListAsync(GetCategoryListDto input) { return(_service.GetListAsync(input)); }
public async Task <PagedResultDto <CategorySummaryDto> > GetSummaryListAsync(GetCategoryListDto input) { return(await _service.GetSummaryListAsync(input)); }
public Task <List <CategoryDto> > GetAllListAsync(GetCategoryListDto input) { return(_categoryAppService.GetAllListAsync(input)); }