Пример #1
0
 @RequestMapping(value = "/get/offers", method = RequestMethod.GET)
 public @ResponseBody String getOffers(
     final HttpServletRequest request,
     final HttpServletResponse response,
     @RequestParam("label") String label,
     @RequestParam("pageNo") String pageNo)
     throws KUException {
   log.info("getting offers for :: " + label);
   List<String> labels = new ArrayList<String>();
   if (!StringUtil.isEmptyString(label)) {
     if (label.contains("-")) {
       labels.addAll(Arrays.asList(label.split("-")));
     } else {
       labels.add(label);
     }
   }
   if (!StringUtil.isEmptyString(pageNo)) {
     int endLimit = Integer.parseInt(pageNo) * Constants.OFFER_TO_LOAD;
     int startLimit = endLimit - Constants.OFFER_TO_LOAD;
     String content = offerManager.getOffersContent(labels, startLimit, Constants.OFFER_TO_LOAD);
     return content;
   } else {
     return "";
   }
 }