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

Pt100查表法温度转换库:基于DIN 43760的嵌入式高精度实现

1. PT100 RTD库技术解析&#xff1a;面向工业级精度的嵌入式温度测量实现1.1 库定位与工程价值pt100rtd是一个专为嵌入式平台设计的高精度Pt100电阻温度检测器&#xff08;RTD&#xff09;转换库&#xff0c;其核心使命是将实测电阻值&#xff08;单位&#xff1a;Ω&#xff0…...

MacBook M1用户必看:OBS+B站直播保姆级配置指南(含Loopback替代方案)

MacBook M1芯片用户的高清直播实战指南&#xff1a;从OBS配置到音画优化 作为一名长期使用MacBook M1系列设备进行B站直播的内容创作者&#xff0c;我深刻理解苹果芯片用户在直播配置过程中遇到的各种"坑"。本文将分享一套经过实战验证的完整解决方案&#xff0c;特别…...

ThinkPHP8项目实战:Gitee流水线+CICD自动部署避坑指南(附完整配置)

ThinkPHP8项目实战&#xff1a;Gitee流水线CICD自动部署避坑指南&#xff08;附完整配置&#xff09; 在当今快节奏的软件开发环境中&#xff0c;自动化部署已成为提升团队效率的关键环节。对于使用ThinkPHP8框架的开发者而言&#xff0c;如何利用Gitee流水线实现从代码提交到C…...

GPS原理笔记三——GPS卫星轨道理论和计算

GPS原理笔记三——GPS卫星轨道理论和计算 3 GPS卫星轨道理论和计算3.1 空间坐标系3.1.1 惯性坐标系(ECI)3.1.2 地固坐标系(ECEF)3.1.3 WGS-84坐标系(WGS-84)3.1.4 直角坐标系间的旋转变换3.1.5 站心坐标系(ENU) 3.2 时间系统3.3 GPS卫星轨道理论3.4 卫星空间位置的计算3.5 卫星…...

AI大模型是什么?有什么用?

前言&#xff1a;到底什么是大模型&#xff1f;如果说深度学习是AI的“大脑”&#xff0c;那么大模型就是当前最强大、最通用、最颠覆认知的超级大脑。我们日常接触的ChatGPT、文心一言、GPT-4、通义千问、Claude、Gemini&#xff0c;全部属于大模型。用最简单的话定义&#xf…...

Pixel Dimension Fissioner降本提效实践:替代SaaS文本工具的开源方案

Pixel Dimension Fissioner降本提效实践&#xff1a;替代SaaS文本工具的开源方案 1. 为什么需要开源文本增强工具 在内容创作和营销领域&#xff0c;高质量的文本改写工具已经成为刚需。传统的SaaS文本工具虽然功能强大&#xff0c;但普遍存在以下问题&#xff1a; 高昂的订…...

Cheat Engine 7.0中文版安装包+详细使用教程(附游戏修改实战案例)

Cheat Engine 7.0中文版从入门到精通&#xff1a;游戏修改实战指南 在数字娱乐时代&#xff0c;游戏修改工具一直是玩家探索虚拟世界的得力助手。作为内存修改领域的瑞士军刀&#xff0c;Cheat Engine以其强大的功能和开源特性&#xff0c;成为从普通玩家到专业开发者的多面手工…...

网安密码学是学啥的?黑客应用方向及方法,学了就业怎么样_网络空间安全专业学习密码学

网安密码学&#xff0c;或称网络安全中的密码学&#xff0c;是指在网络安全领域应用密码学的理论和技术来保护信息免受未授权访问和篡改。密码学是网络安全的一个重要组成部分&#xff0c;它涵盖了信息加密、身份验证、数据完整性和数字签名等多个方面。 密码学是什么&#xff…...

【sap btp 添加postgres 数据库管理工具】

在项目中准备一个文件 准备文件&#xff1a;manifest.yml applications: - name: pgadmin-webmemory: 1Gdisk_quota: 1Ghealth-check-type: processdocker:image: dpage/pgadmin4:latestrandom-route: trueenv:PGADMIN_DEFAULT_EMAIL: adminadmin.comPGADMIN_DEFAULT_PASSWORD:…...

RH850 FCL库移植避坑指南:从零配置到实战操作(CS+工程适配版)

RH850 FCL库移植避坑指南&#xff1a;从零配置到实战操作&#xff08;CS工程适配版&#xff09; 在嵌入式开发领域&#xff0c;Renesas RH850系列微控制器凭借其高性能和可靠性&#xff0c;广泛应用于汽车电子和工业控制等关键领域。而FCL&#xff08;Flash Code Library&…...