package com.zt.controller;
import com.zt.pojo.select;
import com.zt.pojo.student;
import com.zt.service.SelectService;
import com.zt.service.StudentService;
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 javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.PrintWriter;
@Controller
public class StudentController {
@Resource
private StudentService studentService;
@Resource
private SelectService selectService;
// 修改个人信息
@RequestMapping(value = "/updateStudentInfo",method = RequestMethod.POST)
public void updateStudentInfo(@RequestParam(value = "name") String name,
@RequestParam(value = "password") String password,
@RequestParam(value = "sex") String sex,
@RequestParam(value = "major") String major,
HttpServletRequest request, HttpServletResponse response){
HttpSession session = null;
PrintWriter out = null;
try{
out = response.getWriter();
session = request.getSession();
String id = ((student)session.getAttribute("student")).getS_id();
boolean ch = studentService.updateService(id,name,sex,password,major);
if(ch) out.print("success");
else out.print("error");
out.flush();
}catch (IOException e){
e.printStackTrace();
}finally {}
out.close();
}
// 选课操作
@RequestMapping(value = "/selectCourse",method = RequestMethod.POST)
public void selectCourse(@RequestParam(value = "id") String c_id,
@RequestParam(value = "point") int point,
HttpServletRequest request,HttpServletResponse response){
PrintWriter out = null;
try{
out = response.getWriter();
HttpSession session = request.getSession();
String s_id = ((student)session.getAttribute("student")).getS_id();
String result = selectService.selectCourse(new select(s_id,c_id,point));
out.print(result);
out.flush();
}catch (IOException e){
e.printStackTrace();
}finally {}
out.close();
}
// 修改积分操作
@RequestMapping(value = "/updatePoint",method = RequestMethod.POST)
public void updatePoint(@RequestParam(value = "id") String c_id,
@RequestParam(value = "point") int point,
HttpServletRequest request,HttpServletResponse response){
PrintWriter out = null;
try{
out = response.getWriter();
HttpSession session = request.getSession();
String s_id = ((student)session.getAttribute("student")).getS_id();
select select = new select(s_id,c_id,point);
selectService.updatePoint(select);
out.print("success");
out.flush();
}catch (IOException e){
e.printStackTrace();
}finally {}
out.close();
}
// 退课操作
@RequestMapping(value = "/removeSelect",method = RequestMethod.POST)
public void removeSelect(@RequestParam(value = "id") String c_id,
HttpServletRequest request,HttpServletResponse response){
PrintWriter out = null;
try{
out = response.getWriter();
HttpSession session = request.getSession();
String s_id = ((student)session.getAttribute("student")).getS_id();
selectService.removeCourse(s_id,c_id);
out.print("success");
out.flush();
}catch (IOException e){
e.printStackTrace();
}finally {}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
springboot+mybatis学生选课系统.zip
共164个文件
xml:84个
java:27个
js:16个
需积分: 5 0 下载量 99 浏览量
2023-12-24
21:35:01
上传
评论
收藏 710KB ZIP 举报
温馨提示
springboot+mybatis学生选课系统
资源推荐
资源详情
资源评论
收起资源包目录
springboot+mybatis学生选课系统.zip (164个子文件)
bootstrap.css 143KB
bootstrap.min.css 118KB
bootstrap-theme.css 26KB
bootstrap-theme.min.css 23KB
bootstrap-modal.css 8KB
index.css 3KB
login.css 471B
glyphicons-halflings-regular.eot 20KB
index.html 4KB
info.html 3KB
course.html 3KB
select.html 3KB
index.html 2KB
index.html 2KB
login.html 1KB
menu.html 1KB
dialog.html 838B
user.html 349B
CoursesProject.iml 9KB
StudentController.java 4KB
SelectServiceImpl.java 3KB
CreatePageController.java 3KB
VerificationController.java 3KB
VisitController.java 2KB
vcourse.java 2KB
student.java 2KB
teacher.java 2KB
course.java 1KB
StudentServiceImpl.java 1KB
CourseServiceImpl.java 1KB
select.java 951B
admin.java 789B
TeacherServiceImpl.java 746B
StudentDao.java 725B
AdminServiceImpl.java 720B
PageTest.java 674B
SelectDao.java 615B
SelectService.java 476B
StudentService.java 387B
Application.java 295B
CourseDao.java 291B
CourseService.java 236B
TeacherDao.java 207B
AdminDao.java 204B
TeacherService.java 146B
AdminService.java 144B
jquery-ui.js 426KB
jquery-3.2.1.js 262KB
jquery-3.1.1.min.js 85KB
jquery-3.2.1.min.js 85KB
bootstrap.js 68KB
bootstrap.min.js 36KB
student.js 2KB
jquery.timer.js 2KB
menu.js 2KB
course.js 1KB
login.js 1KB
select.js 759B
info.js 741B
npm.js 484B
login.js 456B
dialog.js 111B
bootstrap.min.css.map 529KB
bootstrap.css.map 380KB
bootstrap-theme.css.map 47KB
bootstrap-theme.min.css.map 25KB
user.png 11KB
title2.png 5KB
title3.png 4KB
error.png 3KB
title.png 3KB
course2.png 3KB
course.png 2KB
menu.png 825B
application.properties 885B
glyphicons-halflings-regular.svg 106KB
glyphicons-halflings-regular.ttf 44KB
glyphicons-halflings-regular.woff 23KB
glyphicons-halflings-regular.woff2 18KB
uiDesigner.xml 9KB
pom.xml 2KB
selectMapper.xml 923B
studentMapper.xml 805B
Maven__org_springframework_boot_spring_boot_starter_data_redis_1_4_3_RELEASE.xml 781B
Maven__org_springframework_boot_spring_boot_test_autoconfigure_1_4_3_RELEASE.xml 781B
Maven__org_springframework_boot_spring_boot_starter_thymeleaf_1_4_3_RELEASE.xml 774B
Maven__org_springframework_boot_spring_boot_starter_logging_1_4_3_RELEASE.xml 760B
Maven__org_springframework_boot_spring_boot_starter_tomcat_1_4_3_RELEASE.xml 753B
Maven__org_springframework_boot_spring_boot_autoconfigure_1_4_3_RELEASE.xml 746B
Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_1_3_0.xml 742B
Maven__org_springframework_boot_spring_boot_starter_test_1_4_3_RELEASE.xml 739B
Maven__org_springframework_boot_spring_boot_starter_jdbc_1_4_3_RELEASE.xml 739B
Maven__org_springframework_boot_spring_boot_starter_web_1_4_3_RELEASE.xml 732B
Maven__org_springframework_data_spring_data_commons_1_12_6_RELEASE.xml 711B
Maven__org_springframework_data_spring_data_keyvalue_1_1_6_RELEASE.xml 711B
Maven__org_springframework_spring_context_support_4_3_5_RELEASE.xml 705B
Maven__org_springframework_boot_spring_boot_starter_1_4_3_RELEASE.xml 704B
Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_1_3_0.xml 700B
Maven__org_springframework_data_spring_data_redis_1_7_6_RELEASE.xml 690B
Maven__org_springframework_boot_spring_boot_test_1_4_3_RELEASE.xml 683B
共 164 条
- 1
- 2
资源评论
zero2100
- 粉丝: 160
- 资源: 2464
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功