| Line 45... |
Line 45... |
| 45 |
}
|
45 |
}
|
| 46 |
|
46 |
|
| 47 |
@RequestMapping(value = "/todayOffers", method = RequestMethod.GET)
|
47 |
@RequestMapping(value = "/todayOffers", method = RequestMethod.GET)
|
| 48 |
public ResponseEntity<?> getTodayOffers(HttpServletRequest request, @RequestParam String brand) throws ProfitMandiBusinessException {
|
48 |
public ResponseEntity<?> getTodayOffers(HttpServletRequest request, @RequestParam String brand) throws ProfitMandiBusinessException {
|
| 49 |
UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
|
49 |
UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
|
| 50 |
int fofoId = userInfo.getRetailerId();
|
50 |
int fofoId = userInfo == null ? 0 : userInfo.getRetailerId();
|
| 51 |
logger.info("todayOffers fofoId: {}", fofoId);
|
51 |
logger.info("todayOffers fofoId: {}", fofoId);
|
| 52 |
if (fofoId <= 0) {
|
52 |
if (fofoId <= 0) {
|
| 53 |
return responseSender.ok(new ArrayList<>());
|
53 |
return responseSender.ok(new ArrayList<>());
|
| 54 |
}
|
54 |
}
|
| 55 |
List<TodayOfferModel> todayOfferModels = todayOfferService.findAllTodayOffer(brand, fofoId);
|
55 |
List<TodayOfferModel> todayOfferModels = todayOfferService.findAllTodayOffer(brand, fofoId);
|