Subversion Repositories SmartDukaan

Rev

Rev 33119 | Rev 33127 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33119 Rev 33122
Line 27... Line 27...
27
 
27
 
28
	@Override
28
	@Override
29
	public List<BrandCatalog> getBrands(int categoryId) {
29
	public List<BrandCatalog> getBrands(int categoryId) {
30
		List<BrandCategory> brandCategories = brandCategoryRepository.selectByCategoryId(categoryId);
30
		List<BrandCategory> brandCategories = brandCategoryRepository.selectByCategoryId(categoryId);
31
		List<Integer> brandIds = brandCategories.stream().map(x->x.getBrandId()).collect(Collectors.toList());
31
		List<Integer> brandIds = brandCategories.stream().map(x->x.getBrandId()).collect(Collectors.toList());
-
 
32
		Map<Integer, BrandCategory> brandCategoryMap = brandCategories.stream()
-
 
33
				.collect(Collectors.toMap(x -> x.getBrandId(), x -> x));
-
 
34
 
32
		List<BrandCatalog> brandCatalogList = brandCatalogRepository.selectByIds(brandIds);
35
		List<BrandCatalog> brandCatalogList = brandCatalogRepository.selectByIds(brandIds);
-
 
36
		for (BrandCatalog brand : brandCatalogList) {
-
 
37
			brand.setBrandCategory(brandCategoryMap.get(brand.getId()));
-
 
38
		}
33
		return brandCatalogList;
39
		return brandCatalogList;
34
	}
40
	}
35
 
41
 
36
	@Override
42
	@Override
37
	public List<BrandCatalog> getBrandsToDisplay(int categoryId) {
43
	public List<BrandCatalog> getBrandsToDisplay(int categoryId) {