| Line 103... |
Line 103... |
| 103 |
|
103 |
|
| 104 |
@Autowired
|
104 |
@Autowired
|
| 105 |
private RoleManager roleManagerService;
|
105 |
private RoleManager roleManagerService;
|
| 106 |
|
106 |
|
| 107 |
List<String> filterableParams = Arrays.asList("brand");
|
107 |
List<String> filterableParams = Arrays.asList("brand");
|
| 108 |
static Map<String, List<String>> EMAIL_BLOCKED_BRANDS = new HashMap<>();
|
108 |
public static final Map<String, List<String>> EMAIL_BLOCKED_BRANDS = new HashMap<>();
|
| 109 |
|
109 |
|
| 110 |
static {
|
110 |
static {
|
| 111 |
EMAIL_BLOCKED_BRANDS.put("sachinindri2006@gmail.com", Arrays.asList("Vivo"));
|
111 |
EMAIL_BLOCKED_BRANDS.put("sachinindri2006@gmail.com", Arrays.asList("Vivo"));
|
| 112 |
EMAIL_BLOCKED_BRANDS.put("akamboj828@gmail.com", Arrays.asList("Vivo"));
|
112 |
EMAIL_BLOCKED_BRANDS.put("akamboj828@gmail.com", Arrays.asList("Vivo"));
|
| 113 |
}
|
113 |
}
|
| Line 202... |
Line 202... |
| 202 |
mandatoryQ.add(String.format("+{!parent which=\"hot_deals_b=true\"} tagId_i:(%s)",
|
202 |
mandatoryQ.add(String.format("+{!parent which=\"hot_deals_b=true\"} tagId_i:(%s)",
|
| 203 |
StringUtils.join(tagIds, " ")));
|
203 |
StringUtils.join(tagIds, " ")));
|
| 204 |
} else {
|
204 |
} else {
|
| 205 |
mandatoryQ.add(
|
205 |
mandatoryQ.add(
|
| 206 |
String.format("+{!parent which=\"id:catalog*\"} tagId_i:(%s)", StringUtils.join(tagIds, " ")));
|
206 |
String.format("+{!parent which=\"id:catalog*\"} tagId_i:(%s)", StringUtils.join(tagIds, " ")));
|
| 207 |
|
- |
|
| 208 |
}
|
207 |
}
|
| 209 |
params.put("q", StringUtils.join(mandatoryQ, " "));
|
208 |
params.put("q", StringUtils.join(mandatoryQ, " "));
|
| 210 |
params.put("fl", "*, [child parentFilter=id:catalog*]");
|
209 |
params.put("fl", "*, [child parentFilter=id:catalog*]");
|
| 211 |
params.put("sort", "rank_i asc, create_s desc");
|
210 |
params.put("sort", "rank_i asc, create_s desc");
|
| 212 |
params.put("start", String.valueOf(offset));
|
211 |
params.put("start", String.valueOf(offset));
|
| Line 219... |
Line 218... |
| 219 |
throw new ProfitMandiBusinessException("", "", "Could not connect to host");
|
218 |
throw new ProfitMandiBusinessException("", "", "Could not connect to host");
|
| 220 |
}
|
219 |
}
|
| 221 |
JSONObject solrResponseJSONObj = new JSONObject(response).getJSONObject("response");
|
220 |
JSONObject solrResponseJSONObj = new JSONObject(response).getJSONObject("response");
|
| 222 |
JSONArray docs = solrResponseJSONObj.getJSONArray("docs");
|
221 |
JSONArray docs = solrResponseJSONObj.getJSONArray("docs");
|
| 223 |
dealResponse = getCatalogResponse(docs, hotDeal);
|
222 |
dealResponse = getCatalogResponse(docs, hotDeal);
|
| - |
|
223 |
if(EMAIL_BLOCKED_BRANDS.containsKey(userInfo.getEmail())) {
|
| - |
|
224 |
dealResponse.stream().filter(x->EMAIL_BLOCKED_BRANDS.get(userInfo.getEmail()).contains(x.getBrand()));
|
| - |
|
225 |
}
|
| 224 |
} else {
|
226 |
} else {
|
| 225 |
return responseSender.badRequest(
|
227 |
return responseSender.badRequest(
|
| 226 |
new ProfitMandiBusinessException("Retailer id", userInfo.getUserId(), "NOT_FOFO_RETAILER"));
|
228 |
new ProfitMandiBusinessException("Retailer id", userInfo.getUserId(), "NOT_FOFO_RETAILER"));
|
| 227 |
}
|
229 |
}
|
| 228 |
return responseSender.ok(dealResponse);
|
230 |
return responseSender.ok(dealResponse);
|