当前位置: 首页 > news >正文

Java项目:55 springboot基于SpringBoot的在线视频教育平台的设计与实现015

作者主页:舒克日记

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

文中获取源码

项目介绍

在线视频教育平台分为管理员和用户、教师三个角色的权限模块。

管理员所能使用的功能主要有:首页、个人中心、用户管理、教师管理、课程信息管理、课程类型管理、我的收藏管理、系统管理、订单管理等。

用户可以实现首页、个人中心、课程信息管理、我的收藏管理、订单管理等。

教师可以实现首页、个人中心、课程信息管理、我的收藏管理等。

环境要求

1.运行环境:最好是java jdk1.8,我们在这个平台上运行的。其他版本理论上也可以。

2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;

3.tomcat环境:Tomcat7.x,8.X,9.x版本均可

4.硬件环境:windows7/8/10 4G内存以上;或者Mac OS;

5.是否Maven项目:是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven.项目

6.数据库:MySql5.7/8.0等版本均可;

技术栈

运行环境:jdk8 + tomcat9 + mysql5.7 + windows10

服务端技术:Spring Boot+ Mybatis +VUE

使用说明

1.使用Navicati或者其它工具,在mysql中创建对应sq文件名称的数据库,并导入项目的sql文件;

2.使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;

3.将项目中config-propertiesi配置文件中的数据库配置改为自己的配置,然后运行;

运行指导

idea导入源码空间站顶目教程说明(Vindows版)-ssm篇:

http://mtw.so/5MHvZq

源码看好后直接在网站付款下单即可,付款成功会自动弹出百度网盘链接,网站地址:http://codegym.top。

其它问题请关注公众号:IT小舟,关注后发送消息即可,都会给您回复的。若没有及时回复请耐心等待,通常当天会有回复

运行截图

文档截图微信截图_20240309170526

项目截图

1

4

5

2

7

8

代码


package com.controller;import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;/*** 津贴* 后端接口* @author* @email
*/
@RestController
@Controller
@RequestMapping("/jintie")
public class JintieController {private static final Logger logger = LoggerFactory.getLogger(JintieController.class);private static final String TABLE_NAME = "jintie";@Autowiredprivate JintieService jintieService;@Autowiredprivate TokenService tokenService;@Autowiredprivate DictionaryService dictionaryService;//字典表@Autowiredprivate GonggaoService gonggaoService;//公告@Autowiredprivate JixiaoService jixiaoService;//绩效@Autowiredprivate XinziService xinziService;//套账@Autowiredprivate YuangongService yuangongService;//用户@Autowiredprivate YuangongKaoqinService yuangongKaoqinService;//员工考勤@Autowiredprivate YuangongKaoqinListService yuangongKaoqinListService;//员工考勤详情@Autowiredprivate UsersService usersService;//管理员/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永不会进入");else if("用户".equals(role))params.put("yuangongId",request.getSession().getAttribute("userId"));CommonUtil.checkMap(params);PageUtils page = jintieService.queryPage(params);//字典表数据转换List<JintieView> list =(List<JintieView>)page.getList();for(JintieView c:list){//修改对应字典表字段dictionaryService.dictionaryConvert(c, request);}return R.ok().put("data", page);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id, HttpServletRequest request){logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);JintieEntity jintie = jintieService.selectById(id);if(jintie !=null){//entity转viewJintieView view = new JintieView();BeanUtils.copyProperties( jintie , view );//把实体数据重构到view中//级联表 用户//级联表YuangongEntity yuangong = yuangongService.selectById(jintie.getYuangongId());if(yuangong != null){BeanUtils.copyProperties( yuangong , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney", "yuangongId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表view.setYuangongId(yuangong.getId());}//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody JintieEntity jintie, HttpServletRequest request){logger.debug("save方法:,,Controller:{},,jintie:{}",this.getClass().getName(),jintie.toString());String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永远不会进入");else if("用户".equals(role))jintie.setYuangongId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));Wrapper<JintieEntity> queryWrapper = new EntityWrapper<JintieEntity>().eq("yuangong_id", jintie.getYuangongId()).eq("jintie_name", jintie.getJintieName()).eq("jintie_types", jintie.getJintieTypes());logger.info("sql语句:"+queryWrapper.getSqlSegment());JintieEntity jintieEntity = jintieService.selectOne(queryWrapper);if(jintieEntity==null){jintie.setInsertTime(new Date());jintie.setCreateTime(new Date());jintieService.insert(jintie);return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 后端修改*/@RequestMapping("/update")public R update(@RequestBody JintieEntity jintie, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {logger.debug("update方法:,,Controller:{},,jintie:{}",this.getClass().getName(),jintie.toString());JintieEntity oldJintieEntity = jintieService.selectById(jintie.getId());//查询原先数据String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
//        else if("用户".equals(role))
//            jintie.setYuangongId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));if("".equals(jintie.getJintieFile()) || "null".equals(jintie.getJintieFile())){jintie.setJintieFile(null);}if("".equals(jintie.getJintieContent()) || "null".equals(jintie.getJintieContent())){jintie.setJintieContent(null);}jintieService.updateById(jintie);//根据id更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Integer[] ids, HttpServletRequest request){logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());List<JintieEntity> oldJintieList =jintieService.selectBatchIds(Arrays.asList(ids));//要删除的数据jintieService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 批量上传*/@RequestMapping("/batchInsert")public R save( String fileName, HttpServletRequest request){logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);Integer yuangongId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//.eq("time", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))try {List<JintieEntity> jintieList = new ArrayList<>();//上传的东西Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段Date date = new Date();int lastIndexOf = fileName.lastIndexOf(".");if(lastIndexOf == -1){return R.error(511,"该文件没有后缀");}else{String suffix = fileName.substring(lastIndexOf);if(!".xls".equals(suffix)){return R.error(511,"只支持后缀为xls的excel文件");}else{URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径File file = new File(resource.getFile());if(!file.exists()){return R.error(511,"找不到上传文件,请联系管理员");}else{List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件dataList.remove(0);//删除第一行,因为第一行是提示for(List<String> data:dataList){//循环JintieEntity jintieEntity = new JintieEntity();
//                            jintieEntity.setYuangongId(Integer.valueOf(data.get(0)));   //员工 要改的
//                            jintieEntity.setJintieUuidNumber(data.get(0));                    //津贴编号 要改的
//                            jintieEntity.setJintieName(data.get(0));                    //津贴标题 要改的
//                            jintieEntity.setJintieFile(data.get(0));                    //附件 要改的
//                            jintieEntity.setJintieTypes(Integer.valueOf(data.get(0)));   //津贴类型 要改的
//                            jintieEntity.setJintieJine(data.get(0));                    //津贴金额 要改的
//                            jintieEntity.setJintieContent("");//详情和图片
//                            jintieEntity.setInsertTime(date);//时间
//                            jintieEntity.setCreateTime(date);//时间jintieList.add(jintieEntity);//把要查询是否重复的字段放入map中//津贴编号if(seachFields.containsKey("jintieUuidNumber")){List<String> jintieUuidNumber = seachFields.get("jintieUuidNumber");jintieUuidNumber.add(data.get(0));//要改的}else{List<String> jintieUuidNumber = new ArrayList<>();jintieUuidNumber.add(data.get(0));//要改的seachFields.put("jintieUuidNumber",jintieUuidNumber);}}//查询是否重复//津贴编号List<JintieEntity> jintieEntities_jintieUuidNumber = jintieService.selectList(new EntityWrapper<JintieEntity>().in("jintie_uuid_number", seachFields.get("jintieUuidNumber")));if(jintieEntities_jintieUuidNumber.size() >0 ){ArrayList<String> repeatFields = new ArrayList<>();for(JintieEntity s:jintieEntities_jintieUuidNumber){repeatFields.add(s.getJintieUuidNumber());}return R.error(511,"数据库的该表中的 [津贴编号] 字段已经存在 存在数据为:"+repeatFields.toString());}jintieService.insertBatch(jintieList);return R.ok();}}}}catch (Exception e){e.printStackTrace();return R.error(511,"批量插入数据异常,请联系管理员");}}}

相关文章:

Java项目:55 springboot基于SpringBoot的在线视频教育平台的设计与实现015

作者主页&#xff1a;舒克日记 简介&#xff1a;Java领域优质创作者、Java项目、学习资料、技术互助 文中获取源码 项目介绍 在线视频教育平台分为管理员和用户、教师三个角色的权限模块。 管理员所能使用的功能主要有&#xff1a;首页、个人中心、用户管理、教师管理、课程信…...

说下你对TCP以及TCP三次握手四次挥手的理解?

参考自简单理解TCP三次握手四次挥手 什么是TCP协议&#xff1f; TCP( Transmission control protocol )即传输控制协议&#xff0c;是一种面向连接、可靠的数据传输协议&#xff0c;它是为了在不可靠的互联网上提供可靠的端到端字节流而专门设计的一个传输协议。 面向连接&a…...

wsl-oracle 安装 omlutils

wsl-oracle 安装 omlutils 1. 安装 cmake 和 gcc-c2. 安装 omlutils3. 使用 omlutils 创建 onnx 模型 1. 安装 cmake 和 gcc-c sudo dnf install -y cmake gcc-c2. 安装 omlutils pip install omlutils-0.10.0-cp312-cp312-linux_x86_64.whl不需要安装 requirements.txt&…...

Python类属性和对象属性大揭秘!

​ 在Python中&#xff0c;对象和类紧密相连&#xff0c;它们各自拥有一些属性&#xff0c;这些属性在我们的编程中起着至关重要的作用。那么&#xff0c;什么是类属性和对象属性呢&#xff1f;别急&#xff0c;让我慢慢给你解释。 类属性 首先&#xff0c;类属性是定义在类本…...

北斗卫星在桥隧坡安全监测领域的应用及前景展望

北斗卫星在桥隧坡安全监测领域的应用及前景展望 北斗卫星系统是中国独立研发的卫星导航定位系统&#xff0c;具有全球覆盖、高精度定位和海量数据传输等优势。随着卫星导航技术的快速发展&#xff0c;北斗卫星在桥隧坡安全监测领域正发挥着重要的作用&#xff0c;并为相关领域…...

如何通过堡垒机JumpServer使用VisualCode 连接服务器进行开发

前言&#xff1a;应用场景 我们经常会碰到需要远程登录到内网服务器进行开发的场景&#xff0c;一般的做法都是通过VPN登录回局域网&#xff0c;然后配置ftp或者ssh使用开发工具链接到服务器上进行开发。如果没有出现问题&#xff0c;那么一切都正常&#xff0c;但到了出现问题…...

【Linux】进程优先级

&#x1f30e;进程的优先级 文章目录&#xff1a; 进程状态 优先级相关       什么是优先级       为什么要有优先级       进程的优先级 调整进程优先级       调整优先级       优先级极限测试 Linux的调度与切换 总结 前言&#xff1a; 进程…...

Fair Data Exchange:区块链实现的原子式公平数据交换

1. 引言 2024年斯坦福大学和a16z crypto research团队 论文 Atomic and Fair Data Exchange via Blockchain 中&#xff0c;概述了一种构建&#xff08;包含过期EIP-4844 blobs的&#xff09;fair data-markets的协议。该论文源自a16z crypto的暑期实习计划&#xff0c;与四名…...

详解优雅版线程池ThreadPoolTaskExecutor和ThreadPoolTaskExecutor的装饰器

代码示例在最后。 认识一下ThreadPoolTaskExecutor org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor这是由Sping封装的加强版线程池&#xff0c;其实是Spring使用装饰者模式对ThreadPoolExecutor进一步优化。 它不仅拥有ThreadPoolExecutor所有的核心参数…...

Vue3+TS+Vite 找不到模块“@/components/xxx/xxx”或其相应的类型声明

引入vue文件时文件是存在的&#xff0c;引入路径也是对的&#xff0c;报找不到模块&#xff0c;有一些解决方案是在tsconfig.json里面做一些配置&#xff0c;大家可以自行百度&#xff08;不知道是不是我百度的不对&#xff0c;我的没有解决&#xff09;还有一种是在项目根目录…...

Vue3-响应式基础:单文件和组合式文件

单文件&#xff1a;html <!DOCTYPE html> <html> <head><title>响应式基础</title> </head> <body><div id"app" ><!-- dynamic parameter:同样在指令参数上也可以使用一个 JavaScript 表达式&#xff0c;需要包…...

DVWA-File Upload文件上传

什么是文件上传漏洞&#xff1f; 黑客利用文件上传后服务器解析处理文件的漏洞上传一个可执行的脚本文件&#xff0c;并通过此脚本文件获得了执行服务器端命令的能力。 造成文件上传漏洞的原因: 1.服务器配置不当 2.开源编辑器上传漏洞 3.本地文件上传限制被绕过 4.过滤不严格被…...

python之word操作

#pip install python-docx import docx import os pathos.path.abspath(__file__) file_pathos.path.join(path,"大题.docx") print(path) print(file_path) objdocx.Document("大题.docx") #第一个段落 p1obj.paragraphs[2] # print(p1.text) #所有段落 #…...

Linux下新增有root权限的用户

步骤&#xff1a; 1.以 root 用户身份登录到 CentOS 服务器。 2.使用以下命令创建新用户&#xff08;将 newuser 替换为您想要创建的用户名&#xff09;&#xff1a; sudo adduser username 3.为新用户设置密码&#xff1a; sudo passwd username 按照提示输入新增用户密码 …...

RPC通信原理(一)

RPC通信原理 RPC的概念 如果现在我有一个电商项目&#xff0c;用户要查询订单&#xff0c;自然而然是通过Service接口来调用订单的实现类。 我们把用户模块和订单模块都放在一起&#xff0c;打包成一个war包&#xff0c;然后再tomcat上运行&#xff0c;tomcat占有一个进程&am…...

修改/etc/resolve.conf重启NetworkManager之后自动还原

我ping 百度报错&#xff1a; [rootk8snode1 ~]# ping baidu.com ping: baidu.com: Name or service not known很明显&#xff0c;这是DNS解析问题。 于是我修改 /etc/resolv.conf 文件后&#xff0c;执行完sudo systemctl restart NetworkManager&#xff0c;/etc/resolv.con…...

Web前端依赖版本管理最佳实践

本文需要读者懂一点点前端的构建知识&#xff1a; 1. package.json文件的作用之一是管理外部依赖&#xff1b;2. .npmrc是npm命令默认配置&#xff0c;放在工程根目录。 Web前端构建一直都是一个不难&#xff0c;但是非常烦人的问题&#xff0c;在DevOps、CI/CD领域。 烦人的是…...

多线程进阶

一.常见的锁策略 这里所讲的锁&#xff0c;不是一把具体的锁&#xff0c;而是锁的特性 1.乐观锁和悲观锁 悲观乐观是对锁冲突大小的预测 若预测锁冲突概率不大&#xff0c;就可能会少一些工作&#xff0c;那就是乐观锁&#xff1b;反之就是悲观锁 总是假设最坏的情况&…...

总结linux常用命令

Linux常用命令总结如下&#xff1a; 文件与目录操作&#xff1a; ls&#xff1a;列出目录内容cd&#xff1a;改变当前目录pwd&#xff1a;显示当前工作目录mkdir&#xff1a;创建新目录cp&#xff1a;复制文件或目录rm&#xff1a;删除文件或目录mv&#xff1a;移动或重命名文件…...

C++ 枚举

C 枚举 5.4.1普通枚举 枚举的定义&#xff1a;&#xff0c;枚举类型是通过enum关键字定义的&#xff0c;比如定义颜色类型 enum Color {RED, // 默认值为0GREEN, // 默认值为1BLUE // 默认值为2 }; Color myColor RED;注意&#xff1a; &#xff08;1&#xff09;括…...

Vue2在一个页面内动态切换菜单显示对应的路由组件

项目的需求是在一个页面内动态获取导航菜单&#xff0c;导航菜单切换的时候显示对应的路由页面&#xff0c;类似于tab切换的形式&#xff0c;切换的导航菜单和页面左侧导航菜单是同一个路由组件&#xff0c;只是放到了一个页面上&#xff0c;显示的个数不同&#xff0c;所有是动…...

执行任务赚积分C卷(JavaPythonC++Node.jsC语言)

现有N个任务需要处理,同一时间只能处理一个任务,处理每个任务所需要的时间固定为1。 每个任务都有最晚处理时间限制和积分值,在最晚处理时间点之前处理完成任务才可获得对应的积分奖励。 可用于处理任务的时间有限,请问在有限的时间内,可获得的最多积分。 输入描述 第一…...

接口测试之文件下载

在工作中对于下载接口&#xff0c;经常会有这样的疑问&#xff1a;这类接口一般功能比较稳定&#xff0c;但是又比较重要&#xff0c;需要占用回归测试时间&#xff0c;有没有可替代的方式&#xff1f; 答案肯定是有的&#xff0c;可以从接口测试/UI自动化测试介入&#xff0c…...

算法思想总结:双指针算法

一、移动零 . - 力扣&#xff08;LeetCode&#xff09; 移动零 该题重要信息&#xff1a;1、保持非0元素的相对位置。2、原地对数组进行操作 思路&#xff1a;双指针算法 class Solution { public:void moveZeroes(vector<int>& nums){int nnums.size();for(int cur…...

python中的zip函数

1.zip&#xff08;&#xff09;同时迭代多个列表、字典等 使用zip()可以同时迭代多个可迭代对象&#xff0c;如列表、字典。 注意&#xff1a;当若干个可迭代对象的长度不相等时&#xff0c;zip()函数会停止在最短的可迭代对象。 例子&#xff1a; # 定义可迭代对象 numbers …...

Element 选择季度组件

<template><el-dialogtitle"选择季度":show-close"false":close-on-click-modal"false":close-on-press-escape"false":visible"visiable"class"dialog list"append-to-body><div><div>&…...

4.MongoDB中16个常用CURD

基本的CURD 作为一个非专业的DBA&#xff0c;我们只需要会一些基本的curd就行&#xff0c;专业的内容还是需要专业的人去干的。CRUD 也就是增删改查&#xff0c;这是数据库最基本的功能&#xff0c;查询还支持全文检索&#xff0c;GEO 地理位置查询等。 01创建库 无需单独创…...

Tomcat数据源笔记

Tomcat数据源笔记 连接池的概念 连接池是一种由容器提供的机制&#xff0c;用于管理数据库连接对象的集合。连接池的主要作用是在应用程序需要与数据库进行交互时&#xff0c;提供可复用的连接对象&#xff0c;从而减少每次建立数据库连接的开销。 连接池的工作原理 连接池的…...

Spring-Kafka笔记整理

引入依赖<dependency><groupId>org.springframework.kafka</groupId><artifactId>spring-kafka</artifactId> </dependency>配置application.propertiesspring.kafka.bootstrap-servers192.168.99.51:9092编写kafka的配置类Configuration …...

已解决org.apache.hadoop.hdfs.protocol.QuotaExceededException异常的正确解决方法,亲测有效!!!

已解决org.apache.hadoop.hdfs.protocol.QuotaExceededException异常的正确解决方法&#xff0c;亲测有效&#xff01;&#xff01;&#xff01; 目录 问题分析 报错原因 解决思路 解决方法 总结 博主v&#xff1a;XiaoMing_Java 问题分析 在使用Hadoop分布式文件系统&a…...