• 大小: 23.54MB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2024-03-06
  • 语言: 其他
  • 标签: web  springmvc  mybatis  

资源简介

ssm集成的框架,包括图书的增删查改,借书,还书等功能的实现.在校期间做的一个毕设项目

资源截图

代码片段和文件信息

package cuit.ssm.controller;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import cuit.ssm.model.BookShelf;
import cuit.ssm.model.Bookinfo;
import cuit.ssm.model.Borrow;
import cuit.ssm.model.Log;
import cuit.ssm.model.Manager;
import cuit.ssm.model.Reader;
import cuit.ssm.service.AdminService;
import cuit.ssm.service.UserService;

@Controller
public class AdminController {

@Autowired
private AdminService adminService;
@Autowired
private UserService userService;

@RequestMapping(“admin“)
public String adminlogin(){
return “adminlogin“;
}

@RequestMapping(value=“adminLogin“ method=RequestMethod.POST)
public String adminLogin(Manager admin HttpServletRequest request HttpServletResponse response){
Log log=new Log();
log.setLogname(admin.getName());
log.setLogrole(admin.getRole());
log.setLogdate(new Date());
Manager realadmin = this.adminService.queryAdminInfo(admin.getName());
/*
 * 1.无此用户
 * 2.密码不正确
 * 3.登录成功,把登录信息写入Cookie
 */
String error=““;
if(realadmin == null){
error=“无此用户“;
request.setAttribute(“adminErrorInfo“error);
return “adminlogin“;
}else if(!(admin.getPwd().equals(realadmin.getPwd()))){
error= “密码错误“;
request.setAttribute(“adminErrorInfo“error);
return “adminlogin“;
}
else if(admin.getPwd().equals(realadmin.getPwd())){
if(admin.getRole()!=realadmin.getRole()) {
error= “权限错误“;
request.setAttribute(“adminErrorInfo“error);
return “adminlogin“;
}
}
if(admin.getRole()==1) {
adminService.save(log);
return “adminUI“;
}
else {
adminService.save(log);
return “sysadminUI“;
}


}

@RequestMapping(“admin_left“)
public String adminUIleft(){
return “admin_left“;
}
@RequestMapping(“sysadmin_left“)
public String sysadminUIleft(){
return “sysadmin_left“;
}

//增加图书
@RequestMapping(“addBook“)
public ModelAndView addBook(HttpServletRequest request HttpServletResponse response){

ModelAndView mv = new ModelAndView();
List bookshelfs=adminService.queryAllBookShelf();
request.setAttribute(“bookshelfs“bookshelfs );
mv.addobject(“functions“ “addBook“);
mv.setViewName(“admin_addBook“);

return mv;

}

@RequestMapping(value=“addBookdeal“ method=RequestMethod.POST)
public ModelAndView addBookdeal(Bookinfo book HttpServletRequest request HttpServletResponse r

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        1638  2018-05-02 15:48  .classpath
     目录           0  2018-08-28 09:09  .externalToolBuilders\
     文件         547  2018-05-02 15:29  .externalToolBuilders\org.eclipse.wst.validation.validationbuilder.launch
     文件        1450  2018-05-02 15:31  .project
     目录           0  2018-08-28 09:09  .settings\
     文件         575  2015-07-12 01:42  .settings\.jsdtscope
     文件         339  2018-05-02 23:57  .settings\org.eclipse.core.resources.prefs
     文件         736  2018-05-02 15:30  .settings\org.eclipse.jdt.core.prefs
     文件          90  2015-07-12 01:42  .settings\org.eclipse.m2e.core.prefs
     文件         587  2018-05-02 15:48  .settings\org.eclipse.wst.common.component
     文件         171  2018-05-02 15:31  .settings\org.eclipse.wst.common.project.facet.core.prefs.xml
     文件         340  2018-05-02 15:31  .settings\org.eclipse.wst.common.project.facet.core.xml
     文件         252  2015-07-12 01:42  .settings\org.eclipse.wst.common.project.facet.core.xml.bak
     文件          49  2015-07-12 01:42  .settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2015-07-12 01:42  .settings\org.eclipse.wst.jsdt.ui.superType.name
     文件          50  2015-07-12 01:42  .settings\org.eclipse.wst.validation.prefs
     目录           0  2018-08-28 09:09  logs\
     文件           0  2018-09-11 20:41  logs\ssm.log
     文件        3335  2018-05-08 19:59  pom.xml
     目录           0  2018-08-28 09:09  src\
     目录           0  2018-08-28 09:09  src\main\
     目录           0  2018-08-28 09:09  src\main\java\
     目录           0  2018-08-28 09:09  src\main\java\cuit\
     目录           0  2018-08-28 09:09  src\main\java\cuit\ssm\
     目录           0  2018-08-28 09:09  src\main\java\cuit\ssm\controller\
     文件       16875  2018-05-24 13:53  src\main\java\cuit\ssm\controller\AdminController.java
     文件        1067  2018-05-07 15:31  src\main\java\cuit\ssm\controller\LibraryController.java
     文件       10976  2018-05-12 22:00  src\main\java\cuit\ssm\controller\ReaderController.java
     文件        3840  2018-05-08 20:17  src\main\java\cuit\ssm\controller\UserController.java
     目录           0  2018-08-28 09:09  src\main\java\cuit\ssm\dao\
     文件         776  2018-05-03 19:10  src\main\java\cuit\ssm\dao\BookinfoMapper.java
............此处省略355个文件信息

评论

共有 条评论