Java项目:SpringBoot课程在线学习系统

作者主页:夜未央5788

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

采用SpringBoot+Spring+Mybatis+Thyeleaf实现的在线学习系统,一共2个角色:管理员与学生。
管理员角色功能:
登录系统后可以管理所有用户信息,管理角色信息,添加修改管理课件信息,学生学习培训批次管理,成绩导入管理

学生角色功能:
登录系统后可以查询自己的个人信息,查询课件列表学习,查询我的培训记录,查询自己的成绩

采用SpringBoot框架实现,前台模板用的thymeleaf,数据库层采用mybatis框架,注解模式
 

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 
4.数据库:MySql 5.7版本;
5.是否Maven项目:是;

技术栈

SpringBoot+Spring+Mybatis+Thymeleaf+JQuery+Mysql

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中application.properties配置文件中的数据库配置改为自己的配置;
4. 运行项目,项目运行成功后,访问地址http://localhost:8080/th/login
管理员账号密码: admin/admin
学生登录账号密码: 1314/123456

运行截图

管理员角色

 学生角色

 相关代码

课程控制器

@Controller
@RequestMapping("th")
public class CourseController {
	@Autowired
	private Courseinfoservice courseservice;
	//课程列表
	@RequestMapping("/listcourse")
    public String selectRole(ModelMap map,Courseinfo course) {
		List<Courseinfo> course1=courseservice.selectcourse(course);
		System.out.println(course1);
		map.addAttribute("courseinfo", course1);
        return "thymeleaf/course/listcourse";
    }
	   //添加课程页面
	   @RequestMapping("/addcourse")
	    public String addcourse(Courseinfo course,ModelMap map) {
	        return "thymeleaf/course/addcourse";
	    }
	   //提交添加课程页面
	   @RequestMapping("/addcourse1")
	    public String addcourse1(Courseinfo course,ModelMap map) {
		   System.out.println(course);
		    courseservice.addcourse(course);
	        return "thymeleaf/error/success";
	    }
	   //删除
	   @RequestMapping("/deletecourse")
	    public String deletecourse(Courseinfo course,ModelMap map) {
		   Courseinfo course1=courseservice.selecto(course);
		   courseservice.deletecourse(course);
	    	map.addAttribute("courseinfo", course1);
	        return "thymeleaf/error/success";
	    }
	   //修改界面
	   @RequestMapping("/updatecourse")
	    public String updatecourse(Courseinfo course,ModelMap map) {
		   Courseinfo course1=courseservice.selecto(course);
	    	map.addAttribute("courseinfo",course1);
	        return "thymeleaf/course/updatecourse";
	    }
	   //提交修改界面
	   @RequestMapping("/updatecourse1")
	    public String updatecourse1(Courseinfo course,ModelMap map) {
		   Courseinfo course1=courseservice.selecto(course);
		   courseservice.updatecourse(course);
	    	map.addAttribute("courseinfo",course1);
	        return "thymeleaf/error/success";
	    }
}

考试分数控制器

@Controller
@RequestMapping("th")
public class ExamscoreController {
	@Autowired
	private Examscoreservice examxcore;
	@Autowired
	private Sysservice sysservice;
	@Autowired
	private Batchservice batchservice;
	//批量上传
   @RequestMapping("/muchscore")
   public String muchscore(ModelMap map) {
       return "thymeleaf/examscore/exclexam";
   }
   //提交上传成绩
   @RequestMapping("/muchscore1")
   public String muchscore1(MultipartFile file) throws IOException{
	   List<Map<String,String>> list=ExcelUtil.getList(file.getInputStream());
	   for(Map<String,String> score : list){
			Examscore e=new Examscore();
			e.setScore(Integer.parseInt(score.get("Score").toString()));
			e.setSysUserId(Integer.parseInt(score.get("SysUserId").toString()));
			e.setStudyBatchId(Integer.parseInt(score.get("StudyBatchId").toString()));
			examxcore.insertscore(e);
		}
       return "thymeleaf/error/success";
   }
   //列表成绩
   @RequestMapping("/listscore")
   public String listscore(ModelMap map,Sysuser user,Studybatch studybatch,Examscore score) {
	   List<Sysuser> user1=sysservice.selectUser(user);
	   map.addAttribute("sysuser", user1);
	   List<Studybatch> selectbatch=batchservice.selectbatch(studybatch);
	   map.addAttribute("batch", selectbatch);
	   List<Examscore> score1=examxcore.selectscore(score);
	   map.addAttribute("score", score1);
       return "thymeleaf/examscore/listscore";
   }
   //删除成绩
   @RequestMapping("/deletescore")
   public String deletescore(ModelMap map,Examscore score) {
	   examxcore.deletescore(score);
       return "thymeleaf/error/success";
   }
   //修改分数页面
   @RequestMapping("/updatescore")
   public String updatescore(ModelMap map,Examscore score) {
	   Examscore score1=examxcore.scoreone(score);
	   map.addAttribute("score", score1);
       return "thymeleaf/examscore/updatescore";
   }
 //提交修改分数页面
   @RequestMapping("/updatescore1")
   public String updatescore1(ModelMap map,Examscore score,int Score,int Id) {
	   Examscore score1=examxcore.scoreone(score);
	   examxcore.updatescore(Score, Id);
	   map.addAttribute("score", score1);
       return "thymeleaf/error/success";
   }
}

学生控制器

@Controller
@RequestMapping("th")
public class StudentController {
     @Autowired
    private Sysservice sysservice;
	 @Autowired
	private Courseresoureservice recoureservice;
	 @Autowired
	private Studyrecordservice recordservice;
	 @Autowired
	private Batchservice batchservice;
	 @Autowired
	private Examscoreservice examxcore;
	 //基本信息查询
	@RequestMapping("/studentmessage")
    public String studentmessage(ModelMap map,Sysuser user) {
		Sysuser user1=sysservice.selectone(user);
		map.addAttribute("sysuser", user1);
        return "thymeleaf/student/studentmessage";
    }
	//课件列表
    @RequestMapping("/studentresoure") 
    public String studentresoure(ModelMap map,Courseresoure resoure) {
    	List<Courseresoure> resoure1=recoureservice.selectresoure(resoure);
    	map.addAttribute("courseresoure", resoure1);
        return "thymeleaf/student/studentresoure";
    }
    //学习课件
    @RequestMapping("/study")
    public String study(ModelMap map,Courseresoure resoure) {
    	Courseresoure resoure1=recoureservice.resoure(resoure);
    	resoure1.setFileName("http://localhost:8081/upload/"+resoure1.getFileName());
    	resoure1.setCoverPath("http://localhost:8081/upload/"+resoure1.getCoverPath());
    	map.addAttribute("resoure", resoure1);
        return "thymeleaf/student/study";
    }
    //批次信息记录
    @RequestMapping("/batchmessage")
    public String batchmessage(ModelMap map,Studybatch studybatch,Sysuser user,Userbatch userbatch,Coureseresourebatch resoure) {
    	Sysuser user1=sysservice.selectone(user);
		map.addAttribute("sysuser", user1);
		List<Studybatch> selectbatch=batchservice.selectbatch(studybatch);
		map.addAttribute("batch", selectbatch);
    	Userbatch userbatch1=batchservice.userone(userbatch);
    	map.addAttribute("userbatch", userbatch1);
    	Coureseresourebatch resoure1=batchservice.resoureone(resoure);
    	map.addAttribute("resoure", resoure1);
        return "thymeleaf/student/studybatch";
    }
    //进入学习
	@RequestMapping("/studyview")
    public String studyview(ModelMap map,Studybatch studybatch,Coureseresourebatch resoure1,Courseresoure resoure,Userbatch userbatch) {
		Coureseresourebatch resoure2=batchservice.resoureone(resoure1);
		map.addAttribute("batchresoure", resoure2);
      if(studybatch.getId()==resoure2.getBatchId())
      {
    	  Courseresoure resoure3=recoureservice.studyresoure(resoure);
    	  map.addAttribute("recourseview", resoure3);
    	  Userbatch user1=batchservice.userone(userbatch);
    	  map.addAttribute("user", user1);
    	  if(resoure2.getCourseResoureId()==resoure3.getId()) {
    		resoure3.setFileName("http://localhost:8081/upload/"+resoure3.getFileName());
    	    resoure3.setCoverPath("http://localhost:8081/upload/"+resoure3.getCoverPath());
    	    map.addAttribute("studview", resoure3);
    	  }
      }
        return "thymeleaf/student/studyview";
    }
	//记录提交
	@RequestMapping("/studyrecord")
    public String studyrecord(ModelMap map,Studyrecord record) {
		recordservice.insertrecord(record);
        return "thymeleaf/error/success";
    }
	//成绩查询
	@RequestMapping("/examscore")
    public String examscore(ModelMap map,Sysuser user,Studybatch studybatch,Examscore score) {
		Sysuser user1=sysservice.selectone(user);
		map.addAttribute("sysuser", user1);
		Studybatch exambatch=batchservice.exambatch(studybatch);
		map.addAttribute("exambatch", exambatch);
		Examscore score1=examxcore.studyscore(score);
		if(user.getId()==score1.getSysUserId()&& exambatch.getId()==score1.getStudyBatchId()) {
			
			map.addAttribute("scoreexam", score1);
		}
		 return "thymeleaf/student/studyrecord";
    }
}

角色控制器

@Controller
@RequestMapping("th")
public class RoleController {
	@Autowired
	private Sysroleservice roleservice;
	//角色列表
	@RequestMapping("/listrole")
    public String selectRole(ModelMap map,Sysrole role) {
		List<Sysrole> role1=roleservice.selectRole(role);
		System.out.println(role1);
		map.addAttribute("sysrole", role1);
        return "thymeleaf/role/listrole";
    }
	//修改状态
    @RequestMapping("/updaterolez")
    public String updatez(ModelMap map,Sysrole role) {
    	Sysrole role1=roleservice.selectone(role);
    	int Status=role1.getStatus();
    	int Id=role1.getId();
    	System.out.println(role1.getStatus());
    	if(Status==0)
    	{
    		Status=Status+1;
    	}
    	else {
    		Status=Status-1;
    	}
    	roleservice.updatez(Status, Id);
    	map.addAttribute("sysrole", role1);
        return "thymeleaf/error/success";
    }
    //修改角色界面
    @RequestMapping("/updatej")
    public String updatej(Sysrole role,ModelMap map) {
    	Sysrole role1=roleservice.selectone(role);
    	map.addAttribute("sysrole", role1);
        return "thymeleaf/role/updaterole";
    }
    //修改提交页面
    @RequestMapping(value="/updatemj")
    public String updatemj(Sysrole role,ModelMap map) {
    	Sysrole role1=roleservice.selectone(role);
    	roleservice.update(role);
    	map.addAttribute("sysrole", role1);
        return "thymeleaf/error/success";
    }
    //删除角色
    @RequestMapping("/deleterole")
    public String deleterole(Sysrole role,ModelMap map) {
    	Sysrole role1=roleservice.selectone(role);
    	roleservice.deleterole(role);
    	map.addAttribute("sysrole", role1);
        return "thymeleaf/error/success";
    }
   //添加角色界面
    @RequestMapping("/addrole")
    public String addrole(Sysrole role,ModelMap map) {
        return "thymeleaf/role/addrole";
    }
    //提交增加页面
    @RequestMapping("/addrolet")
    public String addrolet(Sysrole role,ModelMap map) {
    	roleservice.addrole(role);
        return "thymeleaf/error/success";
    }
}

如果也想学习本系统,下面领取。回复:014springboot

  • 0
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
以下是一个简单的Python刷课代码的例子,使用了pyautogui库和win32api库: ```python import time import pyautogui import win32api import win32con # 设置窗口标题和坐标 window_title = '课件学习 - Google Chrome' hwnd = win32gui.FindWindow(win32con.NULL, window_title) if hwnd == 0: print('%s not found' % window_title) exit() else: print('hwnd = %x' % (hwnd)) window_left, window_top, window_right, window_bottom = win32gui.GetWindowRect(hwnd) # 点击播放按钮 play_button_x = window_left + 100 play_button_y = window_top + 100 win32api.SetCursorPos((play_button_x, play_button_y)) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, play_button_x, play_button_y, 0, 0) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, play_button_x, play_button_y, 0, 0) # 等待视频播放 time.sleep(10) # 暂停视频 pause_button_x = window_left + 100 pause_button_y = window_top + 100 win32api.SetCursorPos((pause_button_x, pause_button_y)) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, pause_button_x, pause_button_y, 0, 0) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, pause_button_x, pause_button_y, 0, 0) # 关闭窗口 close_button_x = window_right - 50 close_button_y = window_top + 10 win32api.SetCursorPos((close_button_x, close_button_y)) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, close_button_x, close_button_y, 0, 0) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, close_button_x, close_button_y, 0, 0) ``` 该代码可以实现自动打开指定窗口并播放视频,然后暂停视频并关闭窗口。你可以根据自己的需要修改代码中的窗口标题和坐标,以及点击的按钮坐标。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜未央5788

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值