Example #1
0
 @RequestMapping(
     value = {"/mi/shop/search/page/json/{curPage}"},
     method = {RequestMethod.GET})
 @ResponseBody
 public Object getMiSearchPageJson(
     HttpServletRequest request, @PathVariable Integer curPage, Integer pageSize, String name) {
   ShopQueryModel command = new ShopQueryModel();
   command.setTargetPage(curPage);
   command.setPageSize(pageSize);
   command.setSearchKeyword(name);
   CommonPageObject<ShopModel> shops = shopService.strictQuery(command);
   return PageUtil.convert2ResultMap(shops);
 }
Example #2
0
 @RequestMapping(
     value = "/shop/search/-{searchKeyword}-",
     method = {RequestMethod.GET})
 public String toSearch(HttpServletRequest request, @PathVariable String searchKeyword) {
   ShopQueryModel command = new ShopQueryModel();
   command.setTargetPage(PageUtil.BEGIN_PAGE);
   command.setPageSize(PageUtil.DEFAULT_PAGE_SIZE);
   command.setSearchKeyword(searchKeyword);
   List<ShopModel> list = shopService.strictList(command);
   for (ShopModel shop : list) {
     shop.setPreViewUrl(
         aossService.addImgParams(
             shop.getPreViewUrl(), Constants.ALIYUN_OSS_IMAGE_PARAMS_TYPE_NORMAL_PRE_IMG));
   }
   int total = shopService.strictCount(command);
   request.setAttribute("results", list);
   request.setAttribute("total", total);
   return "ui/shop/search";
 }
Example #3
0
 @RequestMapping(
     value = "/shop/search/json/{searchKeyword}-{targetPage}-{pageSize}",
     method = {RequestMethod.GET})
 @ResponseBody
 public Object toSearchJson(
     HttpServletRequest request,
     @PathVariable String searchKeyword,
     @PathVariable Integer targetPage,
     @PathVariable Integer pageSize) {
   ShopQueryModel command = new ShopQueryModel();
   command.setTargetPage(targetPage);
   command.setPageSize(pageSize);
   command.setSearchKeyword(searchKeyword);
   List<ShopModel> list = shopService.strictList(command);
   for (ShopModel shop : list) {
     shop.setPreViewUrl(
         aossService.addImgParams(
             shop.getPreViewUrl(), Constants.ALIYUN_OSS_IMAGE_PARAMS_TYPE_NORMAL_PRE_IMG));
   }
   Map<String, Object> result = ResultMapUtil.getResultMap();
   result.put("results", list);
   return result;
 }