当前位置: 首页 > 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;括…...

Lombok 的 @Data 注解失效,未生成 getter/setter 方法引发的HTTP 406 错误

HTTP 状态码 406 (Not Acceptable) 和 500 (Internal Server Error) 是两类完全不同的错误&#xff0c;它们的含义、原因和解决方法都有显著区别。以下是详细对比&#xff1a; 1. HTTP 406 (Not Acceptable) 含义&#xff1a; 客户端请求的内容类型与服务器支持的内容类型不匹…...

脑机新手指南(八):OpenBCI_GUI:从环境搭建到数据可视化(下)

一、数据处理与分析实战 &#xff08;一&#xff09;实时滤波与参数调整 基础滤波操作 60Hz 工频滤波&#xff1a;勾选界面右侧 “60Hz” 复选框&#xff0c;可有效抑制电网干扰&#xff08;适用于北美地区&#xff0c;欧洲用户可调整为 50Hz&#xff09;。 平滑处理&…...

Linux简单的操作

ls ls 查看当前目录 ll 查看详细内容 ls -a 查看所有的内容 ls --help 查看方法文档 pwd pwd 查看当前路径 cd cd 转路径 cd .. 转上一级路径 cd 名 转换路径 …...

苍穹外卖--缓存菜品

1.问题说明 用户端小程序展示的菜品数据都是通过查询数据库获得&#xff0c;如果用户端访问量比较大&#xff0c;数据库访问压力随之增大 2.实现思路 通过Redis来缓存菜品数据&#xff0c;减少数据库查询操作。 缓存逻辑分析&#xff1a; ①每个分类下的菜品保持一份缓存数据…...

Caliper 配置文件解析:config.yaml

Caliper 是一个区块链性能基准测试工具,用于评估不同区块链平台的性能。下面我将详细解释你提供的 fisco-bcos.json 文件结构,并说明它与 config.yaml 文件的关系。 fisco-bcos.json 文件解析 这个文件是针对 FISCO-BCOS 区块链网络的 Caliper 配置文件,主要包含以下几个部…...

初学 pytest 记录

安装 pip install pytest用例可以是函数也可以是类中的方法 def test_func():print()class TestAdd: # def __init__(self): 在 pytest 中不可以使用__init__方法 # self.cc 12345 pytest.mark.api def test_str(self):res add(1, 2)assert res 12def test_int(self):r…...

深入浅出Diffusion模型:从原理到实践的全方位教程

I. 引言&#xff1a;生成式AI的黎明 – Diffusion模型是什么&#xff1f; 近年来&#xff0c;生成式人工智能&#xff08;Generative AI&#xff09;领域取得了爆炸性的进展&#xff0c;模型能够根据简单的文本提示创作出逼真的图像、连贯的文本&#xff0c;乃至更多令人惊叹的…...

uni-app学习笔记三十五--扩展组件的安装和使用

由于内置组件不能满足日常开发需要&#xff0c;uniapp官方也提供了众多的扩展组件供我们使用。由于不是内置组件&#xff0c;需要安装才能使用。 一、安装扩展插件 安装方法&#xff1a; 1.访问uniapp官方文档组件部分&#xff1a;组件使用的入门教程 | uni-app官网 点击左侧…...

倒装芯片凸点成型工艺

UBM&#xff08;Under Bump Metallization&#xff09;与Bump&#xff08;焊球&#xff09;形成工艺流程。我们可以将整张流程图分为三大阶段来理解&#xff1a; &#x1f527; 一、UBM&#xff08;Under Bump Metallization&#xff09;工艺流程&#xff08;黄色区域&#xff…...

[拓扑优化] 1.概述

常见的拓扑优化方法有&#xff1a;均匀化法、变密度法、渐进结构优化法、水平集法、移动可变形组件法等。 常见的数值计算方法有&#xff1a;有限元法、有限差分法、边界元法、离散元法、无网格法、扩展有限元法、等几何分析等。 将上述数值计算方法与拓扑优化方法结合&#…...