package com.zmt.controller;
import com.zmt.pojo.ClassInfo;
import com.zmt.pojo.StudentInfo;
import com.zmt.pojo.UserInfo;
import com.zmt.service.ClassService;
import com.zmt.service.StudentService;
import com.zmt.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.util.List;
@Controller
public class StudentController {
@Autowired
private StudentService studentService;
@Autowired
private ClassService classService;
@Autowired
private UserService userService;
//添加班级
@RequestMapping("/addClass")
public String addClass(ClassInfo classInfo){
int result = classService.insertClass(classInfo);
if (result>0){
return "redirect:/allClass";//重定向到班级页面
}else {
return null;
}
}
//添加学生
@RequestMapping("/addStudent")
public String addStudent(StudentInfo studentInfo){
int result = studentService.save(studentInfo);
if (result>0){
return "redirect:/allStudent";//重定向到班级页面
}else {
return null;
}
}
//查询学生
@RequestMapping("/allStudent")
public String findAll(Model model){
List<StudentInfo> list = studentService.findAll();
model.addAttribute("list",list);
return "allStudent";
}
//查询班级
@RequestMapping(value = "/allClass",produces = "text/json;charset=utf-8")
@ResponseBody
public String findAllClass(Model model){
return classService.findAllclass();
}
//根据班级id查询学生信息
@RequestMapping("/findStudentByid")
public String findStudentByid(int id,Model model){
List<StudentInfo> list = studentService.findStudentByid(id);
model.addAttribute("list",list);
return "allStudent";
}
//登录
@RequestMapping("/tologin")
public String toLogin(UserInfo userInfo){
int result = userService.toLogin(userInfo);
if (result>0){
return "home";
}else {
return "login";
}
}
//查询所有用户
@RequestMapping("/allUser")
public String findUser(Model model){
List<UserInfo> list = userService.findUser();
model.addAttribute("list",list);
return "allUsers";
}
//添加用户
@RequestMapping("/addUser")
public String addUser(UserInfo userInfo){
int result = userService.addUser(userInfo);
if (result>0){
return "redirect:/allUser";//重定向到班级页面
}else {
return null;
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
ssm+redis学生管理的实现
共129个文件
xml:33个
class:26个
jar:25个
需积分: 9 1 下载量 12 浏览量
2022-03-08
18:33:32
上传
评论
收藏 30.58MB ZIP 举报
温馨提示
ssm+redis学生管理的实现
资源详情
资源评论
资源推荐
收起资源包目录
ssm+redis学生管理的实现 (129个子文件)
StudentController.class 3KB
StudentController.class 3KB
StudentInfo.class 2KB
StudentInfo.class 2KB
ClassServiceImpl.class 2KB
ClassServiceImpl.class 2KB
UserInfo.class 2KB
UserInfo.class 2KB
ClassInfo.class 1KB
ClassInfo.class 1KB
StudentServiceImpl.class 1KB
StudentServiceImpl.class 1KB
UserServiceImpl.class 1KB
UserServiceImpl.class 1KB
StudentService.class 494B
StudentService.class 494B
StudentInfoDao.class 490B
StudentInfoDao.class 490B
UserService.class 290B
UserService.class 290B
UserInfoDao.class 286B
UserInfoDao.class 286B
ClassInfoDao.class 280B
ClassInfoDao.class 280B
ClassService.class 219B
ClassService.class 219B
.gitignore 220B
SSM1-3.iml 81B
lombok-1.18.20.jar 1.84MB
aspectjweaver-1.8.13.jar 1.84MB
mybatis-3.5.2.jar 1.62MB
spring-web-5.1.9.RELEASE.jar 1.32MB
spring-core-5.1.9.RELEASE.jar 1.23MB
spring-data-redis-1.8.4.RELEASE.jar 1.17MB
spring-context-5.1.9.RELEASE.jar 1.05MB
mysql-connector-java-5.1.47.jar 984KB
spring-webmvc-5.1.9.RELEASE.jar 782KB
spring-beans-5.1.9.RELEASE.jar 658KB
mchange-commons-java-0.2.11.jar 592KB
jedis-2.9.0.jar 541KB
c3p0-0.9.5.2.jar 486KB
spring-data-commons-1.8.4.RELEASE.jar 449KB
fastjson-1.2.7.jar 407KB
jstl-1.2.jar 405KB
spring-jdbc-5.1.9.RELEASE.jar 395KB
spring-aop-5.1.9.RELEASE.jar 360KB
spring-expression-5.1.9.RELEASE.jar 274KB
spring-tx-5.1.9.RELEASE.jar 250KB
commons-pool2-2.4.2.jar 109KB
servlet-api-2.5.jar 103KB
mybatis-spring-2.0.2.jar 66KB
jsp-api-2.2.jar 49KB
spring-jcl-5.1.9.RELEASE.jar 23KB
StudentController.java 3KB
StudentInfo.java 2KB
UserInfo.java 1KB
StudentServiceImpl.java 1KB
ClassServiceImpl.java 1KB
ClassInfo.java 1KB
UserServiceImpl.java 782B
StudentInfoDao.java 451B
StudentService.java 333B
UserService.java 249B
UserInfoDao.java 245B
ClassInfoDao.java 216B
ClassService.java 211B
addStudent.jsp 2KB
addStudent.jsp 2KB
addUser.jsp 2KB
addUser.jsp 2KB
add.jsp 2KB
add.jsp 2KB
allClass.jsp 1KB
allClass.jsp 1KB
allStudent.jsp 1KB
allStudent.jsp 1KB
login.jsp 1KB
login.jsp 1KB
allUsers.jsp 1KB
allUsers.jsp 1KB
index.jsp 877B
index.jsp 877B
home.jsp 429B
home.jsp 429B
inputFiles.lst 865B
createdFiles.lst 449B
inputFiles.lst 0B
MANIFEST.MF 92B
database.properties 165B
database.properties 165B
database.properties 165B
redis.properties 146B
redis.properties 146B
redis.properties 146B
pom.properties 94B
SSM1-3.war 15.26MB
workspace.xml 16KB
pom.xml 5KB
spring-dao.xml 3KB
spring-dao.xml 3KB
共 129 条
- 1
- 2
月与清酒
- 粉丝: 85
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0