Beispiel #1
0
 @RequestMapping(value = "/news/delete/{newsId}", method = RequestMethod.GET)
 public String deleteOneNews(
     Model model, @PathVariable("newsId") int newsId, RedirectAttributes redirectAttributes) {
   newsDao.deleteAll(new int[] {newsId});
   redirectAttributes.addFlashAttribute("Msg", "删除成功!");
   return "redirect:/admin/news/list";
 }
Beispiel #2
0
 /**
  * 批量或删除新闻
  *
  * @param model
  * @param id
  * @return
  */
 @RequestMapping(value = "/news/delete", method = RequestMethod.POST)
 public String deleteNews(
     Model model, @RequestParam(value = "id") int id[], RedirectAttributes redirectAttributes) {
   newsDao.deleteAll(id);
   redirectAttributes.addFlashAttribute("Msg", "删除成功!");
   return "redirect:/admin/news/list";
 }