——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7、Node.js≥14
开发工具 后端:eclipse/idea/myeclipse/sts等均可配置运行 前端:WebStorm/VSCode/HBuilderX等均可
❗没学过node.js的不要搞前后端分离项目
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明 管理员:
老师:
学生:
基于javaweb的SpringBoot在线学习系统在线学习平台(学生、教师、管理员)(java+springboot+maven+vue+elementui+mysql)
登录页:http://localhost:8080/#/login
1 2 3 4 5 6 7 8 管理员 admin 123456 老师 t1 123456 学生 s1 123456
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 @RequestMapping("/list") public Result list (@RequestBody UserSubjectVo userSubjectVo) { userSubjectVo.setPage((userSubjectVo.getPage() - 1 ) * userSubjectVo.getPageSize()); Map<String, Object> page = userSubjectService.queryPage(userSubjectVo); return Result.success(page); } @RequestMapping("/info/{id}") public Result info (@PathVariable("id") Integer id) { UserSubjectEntity userSubject = userSubjectService.getById(id); return Result.success(userSubject); } @RequestMapping("/save") public Result save (@RequestBody UserSubjectEntity userSubject) { boolean save = userSubjectService.save(userSubject); if (save) { return Result.successCode(); } return Result.failureCode(); } @RequestMapping("/update") public Result update (@RequestBody UserSubjectEntity userSubject) { boolean update = userSubjectService.updateById(userSubject); if (update) { return Result.successCode(); } return Result.failureCode(); } @RequestMapping("/delete") public Result delete (@RequestBody Integer[] ids) { boolean b = userSubjectService.removeByIds(Arrays.asList(ids)); if (b) { return Result.successCode();
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 @RestController @RequestMapping("study/videoTotal") public class VideoTotalController { @Value("${file.imagePath}") private String imagePath; @Autowired private VideoTotalService videoTotalService; @Autowired private VideosService videosService; @RequestMapping("/list") public Result list (@RequestBody VideoTotalVo videoTotalVo) { videoTotalVo.setPage((videoTotalVo.getPage() - 1 ) * videoTotalVo.getPageSize()); Map<String, Object> page = videoTotalService.queryPage(videoTotalVo); return Result.success(page);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 @RequestMapping("/registry") public Result registry (@RequestBody UserEntity user) { boolean save = userService.save(user); if (save) { UserRoleEntity userRoleEntity = new UserRoleEntity(); userRoleEntity.setUserId(user.getId()); userRoleEntity.setRoleId(3 ); userRoleService.save(userRoleEntity); return Result.successCode(); } return Result.failureCode(); } @RequestMapping("/update") public Result update (@RequestBody UserVo userVo) { boolean b; if (userVo.getUserEntity() == null ) { UserEntity userEntity = new UserEntity(); userEntity.setId(userVo.getId()); userEntity.setUserName(userVo.getUserName()); userEntity.setSex(userVo.getSex()); b = userService.updateById(userEntity); } else { b = userService.updateById(userVo.getUserEntity()); } if (b) { if (userVo.getClassId() != null ) { QueryWrapper<UserClassEntity> userClassQueryWrapper = new QueryWrapper<>(); if (userVo.getUserEntity() != null ) { userClassQueryWrapper.eq("user_id" , userVo.getUserEntity().getId()); } else { userClassQueryWrapper.eq("user_id" , userVo.getId()); } userClassService.remove(userClassQueryWrapper); UserClassEntity userClassEntity = new UserClassEntity(); userClassEntity.setClassId(userVo.getClassId()); if (userVo.getUserEntity() != null ) { userClassEntity.setUserId(userVo.getUserEntity().getId()); } else { userClassEntity.setUserId(userVo.getId()); } userClassService.save(userClassEntity); }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 @RestController @RequestMapping("study/class") public class ClassController { @Autowired private ClassService classService; @Autowired private UserClassService userClassService; @RequestMapping("/list") public Result list (@RequestBody ClassVo classVo) { classVo.setPage((classVo.getPage() - 1 ) * classVo.getPageSize()); Map<String, Object> page = classService.queryPage(classVo); return Result.success(page); } @RequestMapping("/findList") public Result findList (@RequestBody ClassVo classVo) { List<HashMap> page = classService.findList(classVo);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 boolean save = homeworkService.save(homework); if (save) { return Result.successCode(); } return Result.failureCode(); } @RequestMapping("/update") public Result update (@RequestBody HomeworkEntity homework) { boolean b = homeworkService.updateById(homework); if (b) { return Result.successCode(); } return Result.failureCode(); } @RequestMapping("/delete") public Result delete (@RequestBody HomeworkEntity homework) { boolean b = homeworkService.removeById(homework.getId()); if (b){ QueryWrapper<UserDoHomeworkEntity> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("homework_id" ,homework.getId()); boolean remove = userDoHomeworkService.remove(queryWrapper); return Result.successCode(); } return Result.failureCode(); } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 */ @RequestMapping("/info/{id}") public Result info (@PathVariable("id") Integer id) { ApplicantEntity applicant = applicantService.getById(id); return Result.success(applicant); } @RequestMapping("/save") public Result save (@RequestBody ApplicantEntity applicant) { boolean save = applicantService.save(applicant); if (save) { return Result.successCode(); } return Result.failureCode(); } @RequestMapping("/update") public Result update (@RequestBody ApplicantVo applicantVo) { ApplicantEntity applicantEntity = new ApplicantEntity(); applicantEntity.setStatus(applicantVo.getStatus()); applicantEntity.setId(applicantVo.getId()); boolean b = applicantService.updateById(applicantEntity); if (b) { if (applicantVo.getStatus() == 2 ) { QueryWrapper<UserClassEntity> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("user_id" , applicantVo.getUserId()); List<UserClassEntity> list = userClassService.list(queryWrapper); if (list.size() > 0 ) { return Result.failure("该学生已经加入了班级" ); } UserClassEntity userClassEntity = new UserClassEntity(); userClassEntity.setClassId(applicantVo.getClassId()); userClassEntity.setUserId(applicantVo.getUserId()); userClassService.save(userClassEntity); } return Result.successCode(); } return Result.failureCode(); } @RequestMapping("/delete") public Result delete (@RequestBody Integer[] ids) { applicantService.removeByIds(Arrays.asList(ids)); return Result.successCode();
——————————PayStart——————————
项目链接: https://javayms.github.io?id=351523331012201gj https://javayms.pages.dev?id=351523331012201gj