Subversion Repositories SmartDukaan

Rev

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

Rev 24577 Rev 24578
Line 416... Line 416...
416
	public ResponseEntity<?> getBrandsToDisplay(HttpServletRequest request,  @RequestParam(required = false, defaultValue = "0") int categoryId) {
416
	public ResponseEntity<?> getBrandsToDisplay(HttpServletRequest request,  @RequestParam(required = false, defaultValue = "0") int categoryId) {
417
		UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
417
		UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
418
		List<DBObject> brandsDisplay = mongoClient.getBrandsToDisplay(categoryId);
418
		List<DBObject> brandsDisplay = mongoClient.getBrandsToDisplay(categoryId);
419
		if(EMAIL_BLOCKED_BRANDS.containsKey(userInfo.getEmail())) {
419
		if(EMAIL_BLOCKED_BRANDS.containsKey(userInfo.getEmail())) {
420
			List<String> blockedBrands = EMAIL_BLOCKED_BRANDS.get(userInfo.getEmail());
420
			List<String> blockedBrands = EMAIL_BLOCKED_BRANDS.get(userInfo.getEmail());
421
			brandsDisplay.stream().filter(x->{
-
 
422
				return blockedBrands.contains(x.get("name").toString());
421
			brandsDisplay = brandsDisplay.stream().filter(x->!blockedBrands.contains(x.get("name"))).collect(Collectors.toList());
423
			});
-
 
424
		}
422
		}
425
		return new ResponseEntity<>(brandsDisplay, HttpStatus.OK);
423
		return new ResponseEntity<>(brandsDisplay, HttpStatus.OK);
426
	}
424
	}
427
 
425
 
428
	@RequestMapping(value = "/banners/{bannerType}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
426
	@RequestMapping(value = "/banners/{bannerType}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)