/*文章管理列表*/ @RequestMapping(“/findAllContent.do“) public String findAllContent(HttpServletRequest request Model model) { List allArticle = new ArrayList(); allArticle = adminService.findAllContent(); model.addAttribute(“article“ allArticle); return “contentMan“; }
/*删除文章*/ @RequestMapping(“deleteArticle.do“) public String deleteArticle(HttpServletRequest request) { String title = request.getParameter(“title“); adminService.deleteArticle(title); return “contentMan“; }
/*查看文章详情*/ @RequestMapping(“lookArticle.do“) public String lookArticle(HttpServletRequest request Model model) { String title = request.getParameter(“title“); Article article = adminService.lookArticle(title); List dArticles = new ArrayList(); dArticles.add(article); // for (Iterator iterator = dArticles.iterator(); iterator.hasNext();) { // Article string = (Article) iterator.next(); // System.out.println(string.gettitle()); // } model.addAttribute(“darticle“ dArticles); return “lookArticle“; }
/*用户管理*/ @RequestMapping(“/userManagement.do“) public String uerManagement(HttpServletRequest request Model model) { List allUser = new ArrayList(); allUser = adminService.findAllUser(); model.addAttribute(“allUser“ allUser); return “userManagement“; }
/*删除用户*/ @RequestMapping(“adminDeleteUser.do“) public String deleteUser(HttpServletRequest request Model model) { String username = request.getParameter(“username“); adminService.deleteUser(username); return “userManagement“; }
/*管理员管理*/ @RequestMapping(“adminManagement.do“) public String adminManagement(HttpServletRequest request Model model) { List admins = new ArrayList<>(); admins = adminService.findAllAdminUser(); model.addAttribute(
评论
共有 条评论