Exemplo n.º 1
0
 /**
  * 查询产品详情
  *
  * @param id
  * @param model
  * @return
  */
 @RequestMapping("/selectById")
 public void selectById(String id, Model model, HttpServletResponse response) {
   try {
     Product product = productService.selectById(id);
     TryCatchMessage.tryCatchSearch(response, product);
     // model.addAttribute("product", product);
     // return "product/product_view";
   } catch (Exception e) {
     logger.error("查询产品详情出现异常" + e);
     throw new RuntimeException("查询产品详情出现异常");
   }
 }
Exemplo n.º 2
0
 /**
  * 分页查询产品
  *
  * @param model
  * @param qo
  * @return
  */
 @RequestMapping("/select")
 @ResponseBody
 public void selectProduct(
     @Valid ProductQo qo, BindingResult result, Model model, HttpServletResponse response) {
   try {
     Pagination<Product> selectProductPage = productService.selectProductPage(qo);
     TryCatchMessage.tryCatchSearch(response, selectProductPage);
     // model.addAttribute("ProductPage", selectProductPage);
     // return "product/product_list";
   } catch (Exception e) {
     logger.error("分页查询出出现异常" + e);
     throw new RuntimeException("分页查询出出现异常");
   }
 }