/** * 删除出数据源信息 * * @param id * @return * @throws Exception */ @RequestMapping(params = "action=delete", method = RequestMethod.GET) public String delete(int id) throws Exception { try { contactGroupService.delete(id); } catch (Exception e) { log.error(e); e.printStackTrace(); throw new Exception("不能删除,相关数据源正在使用该联系人组"); } return "redirect:" + List_ACTION; }
/** * 批量删除数据源信息 * * @param ids * @return * @throws IOException */ @RequestMapping( params = "action=deleteAll", method = {RequestMethod.POST, RequestMethod.GET}) public void deleteAll(HttpServletResponse response, String ids) throws IOException { if (!StringUtils.isBlank(ids)) { try { for (String id : ids.split(",")) { contactGroupService.delete(Integer.parseInt(id)); } HttpServletResponseUtil.writeObject2Response(response, "success"); } catch (IOException e) { log.error(e); HttpServletResponseUtil.writeObject2Response(response, "fail"); } } }