| Line 386... |
Line 386... |
| 386 |
* <p>These are the ORIGINAL brands, held in Solr's oem_brand_s. Every hot-deal doc
|
386 |
* <p>These are the ORIGINAL brands, held in Solr's oem_brand_s. Every hot-deal doc
|
| 387 |
* reads "Hot Deal" in brand_ss, so that field would facet into one useless bucket.
|
387 |
* reads "Hot Deal" in brand_ss, so that field would facet into one useless bucket.
|
| 388 |
* The chip row is labelled simply "Brand" in both apps.
|
388 |
* The chip row is labelled simply "Brand" in both apps.
|
| 389 |
*/
|
389 |
*/
|
| 390 |
@RequestMapping(value = "/fofo/hotDeals/brands", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
390 |
@RequestMapping(value = "/fofo/hotDeals/brands", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 391 |
public ResponseEntity<?> getHotDealBrands(HttpServletRequest request) throws Exception {
|
391 |
public ResponseEntity<?> getHotDealBrands(HttpServletRequest request,
|
| - |
|
392 |
@RequestParam(value = "categoryId", required = false, defaultValue = "0") int categoryId) throws Exception {
|
| 392 |
List<Map<String, Object>> brands = new ArrayList<>();
|
393 |
List<Map<String, Object>> brands = new ArrayList<>();
|
| 393 |
for (Map.Entry<String, Integer> entry
|
394 |
for (Map.Entry<String, Integer> entry
|
| 394 |
: solrService.getHotDealBrandFacet(hotDealCatalogIds()).entrySet()) {
|
395 |
: solrService.getHotDealBrandFacet(hotDealCatalogIds(), categoryId).entrySet()) {
|
| 395 |
Map<String, Object> brand = new HashMap<>();
|
396 |
Map<String, Object> brand = new HashMap<>();
|
| 396 |
brand.put("brand", entry.getKey());
|
397 |
brand.put("brand", entry.getKey());
|
| 397 |
brand.put("count", entry.getValue());
|
398 |
brand.put("count", entry.getValue());
|
| 398 |
brands.add(brand);
|
399 |
brands.add(brand);
|
| 399 |
}
|
400 |
}
|