基于SpringBoot的高校学科竞赛平台

目录

前言

 一、技术栈

二、系统功能介绍

竞赛题库管理

竞赛信息管理

晋级名单管理

往年成绩管理

参赛申请管理

三、核心代码

1、登录模块

 2、文件上传模块

3、代码封装


前言

随着信息技术在管理上越来越深入而广泛的应用,管理信息系统的实施在技术上已逐步成熟。本文介绍了高校学科竞赛平台的开发全过程。通过分析高校学科竞赛平台管理的不足,创建了一个计算机管理高校学科竞赛平台的方案。文章介绍了高校学科竞赛平台的系统分析部分,包括可行性分析等,系统设计部分主要介绍了系统功能设计和数据库设计。

本高校学科竞赛平台有管理员,学生,领队老师,教师,管理员功能有个人中心,教师管理,学生管理,领队教师管理,竞赛类型管理,竞赛信息管理,学院管理,专业管理,获奖情况管理,系统管理等。

教师功能有个人中心,题目类型管理,竞赛题库管理,竞赛类型管理,竞赛信息管理,报名信息管理,竞赛评分管理,参赛名单管理,晋级名单管理,获奖名单管理,竞赛总结管理,报销清单管理,成绩申诉管理,参赛信息管理,参赛信息管理,往年成绩管理,获奖情况管理。

领队老师功能有个人中心,题目类型管理,竞赛题库管理,竞赛类型管理,竞赛信息管理,报名信息管理,竞赛评分管理,参赛名单管理,晋级名单管理,获奖名单管理,竞赛总结管理,报销清单管理,成绩申诉管理,参赛信息管理,参赛信息管理,往年成绩管理,获奖情况管理。

学生功能有个人中心,竞赛题库管理,竞赛类型管理,竞赛信息管理,报名信息管理,竞赛评分管理,参赛名单管理,晋级名单管理,获奖名单管理,竞赛总结管理,报销清单管理,成绩申诉管理,参赛信息管理,参赛信息管理,往年成绩管理,获奖情况管理。因而具有一定的实用性。

本站是一个B/S模式系统,采用SSM框架,MYSQL数据库设计开发,充分保证系统的稳定性。系统具有界面清晰、操作简单,功能齐全的特点,使得高校学科竞赛平台管理工作系统化、规范化。本系统的使用使管理人员从繁重的工作中解脱出来,实现无纸化办公,能够有效的提高高校学科竞赛平台管理效率。

 一、技术栈

末尾获取源码
SpringBoot+Vue+JS+ jQuery+Ajax...

二、系统功能介绍

竞赛题库管理

高校学科竞赛平台的系统管理员可以管理竞赛题库,可以对竞赛题库信息添加修改删除以及查询操作。

竞赛信息管理

系统管理员可以查看竞赛信息进行添加,修改,删除以及查询操作。

 

晋级名单管理

管理员可以对晋级名单信息进行修改,删除以及查询操作。

往年成绩管理

教师可以对往年成绩信息进行修改操作,还可以对往年成绩信息进行查询。

 

参赛申请管理

教师可以对学生提交的参赛申请进行审核。

三、核心代码

1、登录模块

 
package com.controller;import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;/*** 登录相关*/
@RequestMapping("users")
@RestController
public class UserController{@Autowiredprivate UserService userService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@PostMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null || !user.getPassword().equals(password)) {return R.error("账号或密码不正确");}String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());return R.ok().put("token", token);}/*** 注册*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}userService.insert(user);return R.ok();}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 密码重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null) {return R.error("账号不存在");}user.setPassword("123456");userService.update(user,null);return R.ok("密码已重置为:123456");}/*** 列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/list")public R list( UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();ew.allEq(MPUtil.allEQMapPre( user, "user")); return R.ok().put("data", userService.selectListView(ew));}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") String id){UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 获取用户的session用户信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Long id = (Long)request.getSession().getAttribute("userId");UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 保存*/@PostMapping("/save")public R save(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}userService.insert(user);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);userService.updateById(user);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){userService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}

 2、文件上传模块

package com.controller;import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;/*** 上传文件映射表*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{@Autowiredprivate ConfigService configService;/*** 上传文件*/@RequestMapping("/upload")public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {if (file.isEmpty()) {throw new EIException("上传文件不能为空");}String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}String fileName = new Date().getTime()+"."+fileExt;File dest = new File(upload.getAbsolutePath()+"/"+fileName);file.transferTo(dest);FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload"+"/"+fileName));if(StringUtils.isNotBlank(type) && type.equals("1")) {ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));if(configEntity==null) {configEntity = new ConfigEntity();configEntity.setName("faceFile");configEntity.setValue(fileName);} else {configEntity.setValue(fileName);}configService.insertOrUpdate(configEntity);}return R.ok().put("file", fileName);}/*** 下载文件*/@IgnoreAuth@RequestMapping("/download")public ResponseEntity<byte[]> download(@RequestParam String fileName) {try {File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}File file = new File(upload.getAbsolutePath()+"/"+fileName);if(file.exists()){/*if(!fileService.canRead(file, SessionManager.getSessionUser())){getResponse().sendError(403);}*/HttpHeaders headers = new HttpHeaders();headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);    headers.setContentDispositionFormData("attachment", fileName);    return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);}} catch (IOException e) {e.printStackTrace();}return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);}}

3、代码封装

package com.utils;import java.util.HashMap;
import java.util.Map;/*** 返回数据*/
public class R extends HashMap<String, Object> {private static final long serialVersionUID = 1L;public R() {put("code", 0);}public static R error() {return error(500, "未知异常,请联系管理员");}public static R error(String msg) {return error(500, msg);}public static R error(int code, String msg) {R r = new R();r.put("code", code);r.put("msg", msg);return r;}public static R ok(String msg) {R r = new R();r.put("msg", msg);return r;}public static R ok(Map<String, Object> map) {R r = new R();r.putAll(map);return r;}public static R ok() {return new R();}public R put(String key, Object value) {super.put(key, value);return this;}
}

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

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

【信创】麒麟v10(arm)-mysql8-mongo-redis-oceanbase

Win10/Win11 借助qume模拟器安装arm64麒麟v10 前言 近两年的国产化进程一直在推进&#xff0c;基于arm架构的国产系统也在积极发展&#xff0c;这里记录一下基于麒麟v10arm版安装常见数据库的方案。 麒麟软件介绍: 银河麒麟高级服务器操作系统V10 - 国产操作系统、银河麒麟、中…

redis解压+windows安装+无法启动:1067

Redis下载安装图文教程&#xff08;Windows版_超详细&#xff09; 标题若遇到安装后无法启动&#xff1a;1067 排查方法如下&#xff1a; 1.查询是否有服务占用端口 查看6379的端口也没有被占用&#xff08;netstat -ano | findstr :6379&#xff09; 若有&#xff0c;kill掉…

【Linux】IO操作

IO 典型 IO 模型阻塞 IO非阻塞 IO信号驱动 IO异步 IO常见问题 多路转接模型select 模型poll 模型epoll 模型 典型 IO 模型 IO 操作指的就是数据的输入输出操作&#xff1b;IO 过程可以分为两个步骤&#xff1a;等待 IO 就绪、数据拷贝 阻塞 IO 发起 IO 操作&#xff0c;若当…

UE5 虚幻引擎 详解蓝图通信 必备的知识技能之一!!!

目录 0 引言1 直接蓝图通信1.1 在关卡蓝图中直接拖拽Actor1.2 Get Actor of Class/Get All Actors of Class 2 事件分发器2.1 创建事件分发器2.2 绑定事件分发器2.3 调用事件分发器 3 蓝图接口3.1 使用步骤3.2 为什么要使用蓝图接口 4 蓝图转换 0 引言 问题&#xff1a;为什么需…

图像处理与计算机视觉--第四章-图像滤波与增强-第一部分

目录 1.灰度图亮度调整 2.图像模板匹配 3.图像裁剪处理 4.图像旋转处理 5.图像邻域与数据块处理 学习计算机视觉方向的几条经验: 1.学习计算机视觉一定不能操之过急&#xff0c;不然往往事倍功半&#xff01; 2.静下心来&#xff0c;理解每一个函数/算法的过程和精髓&…

Vue中如何进行图表绘制

Vue中的图表绘制&#xff1a;数据可视化的艺术 数据可视化是现代Web应用程序的重要组成部分之一。Vue.js作为一种流行的JavaScript框架&#xff0c;提供了许多强大的工具和库&#xff0c;用于在前端应用程序中创建各种图表和数据可视化。本文将深入探讨在Vue中进行图表绘制的方…

怒刷LeetCode的第16天(Java版)

目录 第一题 题目来源 题目内容 解决方法 方法一&#xff1a;迭代 方法二&#xff1a;模拟 方法三&#xff1a;循环模拟 方法四&#xff1a;传递 第二题 题目来源 题目内容 解决方法 方法一&#xff1a;回溯 方法二&#xff1a;枚举优化 第三题 题目来源 题目…

差分放大器的精髓:放大差模信号 抑制共模信号

参考如图基本的差分放大电路&#xff0c;在R1R2 R3R4的条件下&#xff0c;其输出与输入的关系为 &#xff1a; 具体推导过程参考&#xff1a;差分运算放大器的放大倍数的计算及结论_正在黑化的KS的博客-CSDN博客 由这个式子我们可以发现&#xff0c;差分放大器放大的是同相端与…

stable diffusion和gpt4-free快速运行

这是一个快速搭建环境并运行的教程 stable diffusion快速运行gpt快速运行 包含已经搭建好的环境和指令&#xff0c;代码等运行所需。安装好系统必备anaconda、conda即可运行。 stable diffusion快速运行 github: AUTOMATIC1111/稳定扩散网络UI&#xff1a;稳定扩散网页用户界…

STL upper_bound和lower_bound函数

声明&#xff1a; 首先包含头文件#include<algorithm> 这里的两个函数所运用的对象必须是非递减的序列&#xff08;也就是数组&#xff0c;数组必须是非递减的&#xff09;&#xff0c;只有这样才可以使用upper_bound和lower_bound这两个函数。 还有一点&#xff0c;就…

(七)Flask之路由转换器

引子&#xff1a; from flask import Flaskapp Flask(__name__)# 通过使用<int>转换器&#xff0c;可以捕获URL中的整数值&#xff0c;并将其作为参数传递给视图函数。 app.route(/index/<int:nid>, methods[GET, POST]) def index(nid):print(nid)return Indexi…

软件测试之Python基础学习

目录 一、Python基础 Python简介、环境搭建及包管理 Python简介 环境搭建 包管理 Python基本语法 缩进(Python有非常严格的要求) 一行多条语句 断行 注释 变量 基本数据类型(6种) 1. 数字Number 2. 字符串String 3. 列表List 4. 元组Tuple 序列相关操作方法 …

黑豹程序员-架构师学习路线图-百科:Git/Gitee(版本控制)

文章目录 1、什么是版本控制2、特点3、发展历史4、SVN和Git比较5、Git6、GitHub7、Gitee&#xff08;国产&#xff09;8、Git的基础命令 1、什么是版本控制 版本控制系统&#xff08; Version Control &#xff09;版本控制是一种管理和跟踪软件开发过程中的代码变化的系统。它…

树莓派4B串口通信配置方式

目录 1树莓派4B的安装&#xff1a; 1.1安装Serial与使用 1.1.1安装serial 1.1.2打开串口 1.2设置硬件串口为GPIO串口&#xff08;修改串口映射关系&#xff09; 1.2.1修改配置文件 2.1minicom串口 2.1.1安装minicom 这篇博客源于&#xff1a;工创赛。需要让树莓派与STM…

JDK11优化了哪些功能以及新增了哪些特性功能|JDK各个版本的特性分析

一、前言 上一期讲了JDK10的一些新特性&#xff0c;需要回顾的朋友们可以去该专栏回顾一下 这一期讲一讲JDK11的一些新功能 二、新增特性 以下是JDK 11的一些新增或变化的特性&#xff1a; 1. 纯字符串类型的 HTTP 客户端: JDK 11 引入了一个新的 HTTP 协议的客户端 API&…

【Java】super 关键字用法

目录 this与super区别 1.访问成员变量-示例代码 继承中构造方法的访问特点 2.访问构造方法-示例代码&#xff1a; 继承中成员方法访问特点 3.访问成员方法-示例代码&#xff1a; super 关键字的用法和 this 关键字相似 this : 代表本类对象的引用super : 代表父类存储空间…

使用 Elastic 输入包自定义你的数据摄取

作者&#xff1a;Ishleen Kaur Elastic 通过集成&#xff08;integrations&#xff09;实现了外部数据源和 Elastic Observability Solution 之间数据流的收集、转换和分析。 集成包通过封装多个组件来实现这一点&#xff0c;包括代理配置 (agent configuration)、数据收集输入…

利用DMA的触发循环实现eTMR的PWM周期计数

利用DMA的触发循环实现对eTMR的PWM周期计数 文章目录 利用DMA的触发循环实现对eTMR的PWM周期计数引言分析问题eTMR的调试模式ModulizationFTM的多次重载事件终极大招-使用触发链 解决问题确认DMAMUX中的eTMR相关触发源eTMR产生触发信号 软件总结参考文献 引言 最近在同客户一起…

Docker学习_镜像和容器篇

简介 Docker是一种容器化的技术&#xff0c;可以实现在一台宿主机电脑上运行多个不同的容器&#xff0c;每个容器之间都相互独立&#xff0c;具有完整的一套文件&#xff0c;网络和端口。 可以将其理解为一种虚拟机技术&#xff0c;只不过和VMware等虚拟化技术不同&#xff0…