@Test public void testCalc(){ try { get("/web/commodityCalc/29",""); } catch (Exception e) { e.printStackTrace(); } }
@RequestMapping("/commodityCalc/{id}") public String calc(@PathVariable("id") Long id, Model model) { final LotteryInfo lotteryInfo = lotteryInfoService.selectLottery(id); model.addAttribute("info", lotteryInfo == null ? new LotteryInfo() : lotteryInfo); if (null == lotteryInfo) { final Commoditys commoditys = cService.getDetails(id); if (commoditys == null) { model.addAttribute("buyTotalNumber", "未能获取到相关信息"); } else model.addAttribute("buyTotalNumber", commoditys.getBuyTotalNumber()); } return "calc"; }
WebController { @RequestMapping("/commodityCalc/{id}") public String calc(@PathVariable("id") Long id, Model model) { final LotteryInfo lotteryInfo = lotteryInfoService.selectLottery(id); model.addAttribute("info", lotteryInfo == null ? new LotteryInfo() : lotteryInfo); if (null == lotteryInfo) { final Commoditys commoditys = cService.getDetails(id); if (commoditys == null) { model.addAttribute("buyTotalNumber", "未能获取到相关信息"); } else model.addAttribute("buyTotalNumber", commoditys.getBuyTotalNumber()); } return "calc"; } }
WebController { @RequestMapping("/commodityCalc/{id}") public String calc(@PathVariable("id") Long id, Model model) { final LotteryInfo lotteryInfo = lotteryInfoService.selectLottery(id); model.addAttribute("info", lotteryInfo == null ? new LotteryInfo() : lotteryInfo); if (null == lotteryInfo) { final Commoditys commoditys = cService.getDetails(id); if (commoditys == null) { model.addAttribute("buyTotalNumber", "未能获取到相关信息"); } else model.addAttribute("buyTotalNumber", commoditys.getBuyTotalNumber()); } return "calc"; }  }
WebController { @RequestMapping("/commodityCalc/{id}") public String calc(@PathVariable("id") Long id, Model model) { final LotteryInfo lotteryInfo = lotteryInfoService.selectLottery(id); model.addAttribute("info", lotteryInfo == null ? new LotteryInfo() : lotteryInfo); if (null == lotteryInfo) { final Commoditys commoditys = cService.getDetails(id); if (commoditys == null) { model.addAttribute("buyTotalNumber", "未能获取到相关信息"); } else model.addAttribute("buyTotalNumber", commoditys.getBuyTotalNumber()); } return "calc"; }  @RequestMapping("/commodityInfo/{id}") String commodityInfo(@PathVariable("id") Long id, Map<String, Object> model); @RequestMapping("/commodityCalc/{id}") String calc(@PathVariable("id") Long id, Model model); @RequestMapping("/activities") String getActivities(Model model); @RequestMapping("/share/view/{id}") String share(@PathVariable Long id, Model model); }
WebController { @RequestMapping("/commodityCalc/{id}") public String calc(@PathVariable("id") Long id, Model model) { final LotteryInfo lotteryInfo = lotteryInfoService.selectLottery(id); model.addAttribute("info", lotteryInfo == null ? new LotteryInfo() : lotteryInfo); if (null == lotteryInfo) { final Commoditys commoditys = cService.getDetails(id); if (commoditys == null) { model.addAttribute("buyTotalNumber", "未能获取到相关信息"); } else model.addAttribute("buyTotalNumber", commoditys.getBuyTotalNumber()); } return "calc"; }  @RequestMapping("/commodityInfo/{id}") String commodityInfo(@PathVariable("id") Long id, Map<String, Object> model); @RequestMapping("/commodityCalc/{id}") String calc(@PathVariable("id") Long id, Model model); @RequestMapping("/activities") String getActivities(Model model); @RequestMapping("/share/view/{id}") String share(@PathVariable Long id, Model model);  }