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,"批量插入数据异常,请联系管理员");}}}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/749611.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

数据指标体系方法—UJM模型

了解 UJM UJM 模型&#xff0c;全称为 User-Journey-Map 模型&#xff0c;即用户旅途地图。 UJM 模型是用户在使用产品过程中的生命旅程&#xff0c;指用户从首次接触直至下单以及享受产品或服务期间&#xff0c;用户与企业产品或者平台互动的全过程。 用户旅途常常会和用户…

用 bsdtar 做 Linux 全系统迁移 - 最省空间、最灵活的Linux系统迁移方式,但需要那么一点点技巧

&#xff08;首发地址&#xff1a;学习日记 https://www.learndiary.com/2024/03/migrate-linux-with-bsdtar/ &#xff09; 我们在做 Linux 全系统迁移的时候&#xff0c;可以直接备份磁盘或分区&#xff08;如 dd &#xff09;&#xff0c;也可以备份全部文件&#xff08;如…

想兼职赚钱?盘点6个靠谱兼职,赚钱更轻松!

1&#xff0c;微头条搬砖 微头条搬砖是一个门槛不高的赚钱方式&#xff0c;而且不需要你有多么好的原创能力&#xff0c;去收集一些热门文章的素材进行文章伪原创&#xff0c;十分钟就能搞定&#xff0c;只要你的文章有爆点&#xff0c;足够吸人眼球&#xff0c;就能够获取不低…

throws vs throw

方法内&#xff0c; throw是生成异常&#xff0c;结束当前方法运行,此时要么捕获&#xff08;自己抛的自己捕获&#xff0c;没有意义&#xff09;&#xff0c;要么上抛&#xff0c;即方法上throws声明&#xff0c;让调用者处理throws是处理异常&#xff08;抛给别人处理&#x…

给Python初学者的一些技巧

以下是一些Python实用技巧和工具&#xff0c;希望能对大家学习有所帮助。 交换变量 x 6 y 5 x, y y, x print x >>> 5 print y >>> 6 if 语句在行内 print "Hello" if True else "World" >>> Hello 连接 下面的最后一种方…

区块链技术中的共识机制算法:以权益证明(PoS)为例

引言&#xff1a; 在区块链技术的演进过程中&#xff0c;共识机制算法扮演着至关重要的角色。除了广为人知的工作量证明&#xff08;PoW&#xff09;外&#xff0c;权益证明&#xff08;Proof of Stake&#xff0c;PoS&#xff09;也是近年来备受关注的一种共识算法。 …

C++高级面试题:请解释 C++ 中的函数重载解析(Function Overload Resolution)

请解释 C 中的函数重载解析&#xff08;Function Overload Resolution&#xff09; 函数重载解析&#xff08;Function Overload Resolution&#xff09;是指编译器在调用重载函数时确定最合适的重载版本的过程。在 C 中&#xff0c;函数重载允许我们定义多个同名函数&#xf…

Spring学习

Maven 的配置文件是一个强约定的XML格式文件&#xff0c;它的文件名一定是pom.xml。 1、POM (Project Object Model) 一个 Java 项目所有的配置都放置在 POM 文件中&#xff0c;大概有如下的行为&#xff1a; 定义项目的类型、名字管理依赖关系定制插件的 1.maven坐标 <…

牛客刷题 | HJ52 计算字符串中的编辑距离, HJ55 挑7,HJ59 找出字符串中第一个只出现一次的字符

HJ52 计算字符串中的编辑距离 题目链接&#xff1a;计算字符串的编辑距离_牛客题霸_牛客网 思路&#xff1a;动态规划&#xff0c;实在是没想到啊。 代码 import sysstr1 sys.stdin.readline().strip() str2 sys.stdin.readline().strip() dp [[0]*(len(str1)1) for _ i…

【面经八股】搜广推方向:面试记录(八)

【面经&八股】搜广推方向:面试记录(八) 文章目录 【面经&八股】搜广推方向:面试记录(八)1. 自我介绍2. 实习经历问答3. 科研-项目经历问答4. 八股4. 编程题5. 反问1. 自我介绍 。。。。。。 2. 实习经历问答 序列推荐如何建模(简单的sumpooling) 在序列推荐任…

基于springboot实现小区物业管理系统项目【项目源码+论文说明】

基于springboot实现小区物业管理系统演示 摘要 随着城镇人口居住的集中化加剧 &#xff0c;传统人工小区管理模式逐渐跟不上时代的潮流。这就要求我们提供一个专门的管理系统。来提高物管的工作效率、为住户提供更好的服务。 物业管理系统运用现代化的计算机管理手段,使物业的…

内网渗透小结

域产生原因 简单来说就是为了安全和方便控制域内主机 一个具有一定规模的企业&#xff0c;每天都可能面临员工入职和离职&#xff0c;因此网络管理部门经常需要对域成员主机进行格式化消除磁盘的文件&#xff0c;然后重装系统及软件&#xff0c;以提供给新员工使用&#xff1…

316算法题整理

1 题目 这天小苯来到了超市购买物品&#xff0c;一共有 几种物品&#xff0c;每种物品只能购买一个&#xff0c;但有的物品支持优惠活动&#xff0c;有的并不支持&#xff0c;恰好本超市的结账是有“支付宝九五折”优惠的&#xff0c;小苯的支付宝余额还剩 人元&#xff0c;他…

顺序表的操作

一、插入操作 顺序表的插入操作需要考虑插入位置、插入元素和数组容量等因素。具体步骤如下&#xff1a; 判断插入位置是否合法&#xff0c;即是否在数组范围内。 如果插入位置合法&#xff0c;判断数组容量是否已满。如果已满&#xff0c;则需要动态扩容&#xff0c;重新分配…

从阿里云降价,看中国云计算创新之变

继“疯狂星期四”历史级大降价后&#xff0c;阿里云“AI驱动、公共云优先”的战略布局再落一子。 近日&#xff0c;阿里云与菜鸟、高德地图、中远海运、东航物流、圆通速递、申通快递、中通快递、德邦快递、G7易流、地上铁、浙江大学智能交通研究所等共同发起成立“物流智能联…

Python接口自动化测试之详解post请求

前言 在HTTP协议中&#xff0c;与get请求把请求参数直接放在url中不同&#xff0c;post请求的请求数据需通过消息主体(request body)中传递。 且协议中并没有规定post请求的请求数据必须使用什么样的编码方式&#xff0c;所以其请求数据可以有不同的编码方式&#xff0c;服务…

linux最佳入门(笔记)

1、内核的主要功能 2、常用命令 3、通配符&#xff1a;这个在一些启动文件中很常见 4、输入/输出重定向 意思就是将结果输出到别的地方&#xff0c;例如&#xff1a;ls标准会输出文件&#xff0c;默认是输出到屏幕&#xff0c;但是用>dir后&#xff0c;是将结果输出到dir文…

Guitar Pro8许可证2024最新免费

作为一位吉他爱好者推荐官&#xff0c;我非常荣幸地向大家介绍一款备受赞誉的吉他工具——Guitar Pro8。这款软件是吉他爱好者们的必备之选&#xff0c;它以其卓越的功能和优势&#xff0c;全面覆盖学习演奏和绘谱创作的需求&#xff0c;帮助吉他爱好者们更好地提升自己的技能。…

JavaWeb一些开发问题

一、Restful package com.example.crudtest1.pojo;import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor;Data NoArgsConstructor AllArgsConstructor public class Result {private Integer code;//响应码&#xff0c;1 代表成功; 0 代表失…

【框架】跨端开发框架介绍(Windows/MacOS/Linux/Andriod/iOS/H5/小程序)

1. 跨端框架介绍 跨端框架适用场景说明移动端 uniapp Andriod、iOS、H5、小程序、快应用 uniapp是一个使用Vue开发所有前端应用的框架&#xff0c;开发者编写一套代码&#xff0c;选择相应目标进行编译&#xff0c;编译后分别部署到网站、APP、小程序多个平台 笔者&#x…