基于SpringBoot的CSGO赛事管理系统

news2024/10/6 8:27:07

末尾获取源码
开发语言:Java
Java开发工具:JDK1.8
后端框架:SpringBoot
前端:采用JSP技术开发
数据库:MySQL5.7和Navicat管理工具结合
服务器:Tomcat8.5
开发软件:IDEA / Eclipse
是否Maven项目:是


目录

一、项目简介

二、系统功能

三、系统项目截图

3.1前台首页

3.2后台管理

四、核心代码

4.1登录相关

4.2文件上传

4.3封装


一、项目简介

基于SpringBoot的CSGO赛事管理系统利用网络沟通、计算机信息存储管理,有着与传统的方式所无法替代的优点。比如计算检索速度特别快、可靠性特别高、存储容量特别大、保密性特别好、可保存时间特别长、成本特别低等。在工作效率上,能够得到极大地提高,延伸至服务水平也会有好的收获,有了网络,基于SpringBoot的CSGO赛事管理系统的各方面的管理更加科学和系统,更加规范和简便。


二、系统功能

本基于SpringBoot的CSGO赛事管理系统主要包括三大功能模块,即管理员、游戏战队和品牌方。

(1)管理员模块:首页、个人中心、参赛战队管理、合作方管理、赛事信息管理、申请合作管理、赛事报名管理、系统管理。 

(2)参赛战队:首页、个人中心、赛事信息管理、赛事报名管理。

(3)合作方:首页、个人中心、赛事信息管理、申请合作管理。



三、系统项目截图

3.1前台首页

前台有赛事信息、赛事通知、个人中心、后台管理。 

在赛事信息中用户可以查看比赛信息

 在赛事通知用户可以查看相关信息

 前台登录页面,如果没有账号可以选择注册

 注册页面输入相关信息点击注册即可成功

3.2后台管理

 参赛战队后台有首页、个人中心、赛事信息管理、赛事报名管理。

后台登录页面,没有账号的也可以在此注册

管理员登录后有用户管理、合作方管理、赛事信息管理、申请合作管理、赛事报名管理、系统管理等相关功能模块

合作方管理管理员需要审核相关信息并且通过合作方的申请,合作方的账号才能正常登录

赛事信息管理管理员可以操作赛事信息删除、修改和查看详情

添加新的赛事信息行程

申请合作管理员可以在该页面查看合作方申请的合作。


四、核心代码

4.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{
	
	@Autowired
	private UserService userService;
	
	@Autowired
	private 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();
    }
}

4.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{
	@Autowired
    private 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);
	}
	
}

4.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.coloradmin.cn/o/23314.html

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

相关文章

为研发效能而生|一场与 Serverless 的博弈

2022 年 11 月 3 日&#xff0c;第三届云原生编程挑战赛即将迎来终极答辩&#xff0c;18 支战队、32 位云原生开发者入围决赛&#xff0c;精彩即将开启。 云原生编程挑战赛项目组特别策划了《登顶之路》系列选手访谈&#xff0c;期待通过参赛选手的故事&#xff0c;看到更加生…

第1章 计算机系统概述

1.1 操作系统的基本概念 1.1.1 操作系统的概念 操作系统是计算机系统中最基本的系统软件。 操作系统&#xff08;Operating System&#xff0c;OS&#xff09;是指控制和管理整个计算机系统的硬件与软件资源&#xff0c;合理地组织、调度计算机的工作与资源的分配&#xff0c;进…

锐捷端口安全实验配置

端口安全分为IPMAC绑定、仅IP绑定、仅MAC绑定 配置端口安全是注意事项 如果设置了IPMAC绑定或者仅IP绑定&#xff0c;该交换机还会动态学习下联用户的MAC地址 如果要让IPMAC绑定或者仅IP绑定的用户生效&#xff0c;需要先让端口安全学习到用户的MAC地址&#xff0c;负责绑定不生…

如何参与一个开源项目!

今天教大家如何给开源项目提交pr&#xff0c;成为一名开源贡献者。pr是 Pull Request 的缩写&#xff0c;当你在github上发现一个不错的开源项目&#xff0c;你可以将其fork到自己的仓库&#xff0c;然后再改动一写代码&#xff0c;再提交上去&#xff0c;如果项目管理员觉得你…

【建议收藏】回收站数据恢复如何操作?3个方案帮你恢复删除的文件

在使用电脑时&#xff0c;我们经常会清理不需要的文件数据。电脑回收站被清空了&#xff0c;但是里面有我们重要的数据&#xff0c;回收站数据恢复如何操作&#xff1f;不如试试下面的3个方案&#xff0c;一起来了解一下回收站数据恢复吧&#xff01; 一、注册表恢复回收站数据…

电脑视频转换成mp4格式,视频格式转换器转换

怎么把电脑视频转换成mp4格式&#xff1f;使用视频转换器&#xff0c;可以转换来自各种设备的音视频格式&#xff0c;包括相机、手机、视频播放器、电视、平板电脑等。因此&#xff0c;音视频爱好者都可以使用它在各种设备上播放或在社交平台上分享。 主要人群及作用&#xff1…

BHQ-2 NHS,916753-62-3作为各种荧光共振能量转移DNA检测探针中淬灭部分

英文名称&#xff1a;BHQ-2 NHS CAS&#xff1a;916753-62-3 外观&#xff1a;深紫色粉末 分子式&#xff1a;C29H29N7O8 分子量&#xff1a;603.59 储存条件&#xff1a;-20C&#xff0c;在黑暗中 结构式&#xff1a; 凯新生物产品简介&#xff1a; 黑洞猝灭剂-2&#…

pytorch初学笔记(九):神经网络基本结构之卷积层

目录 一、torch.nn.CONV2D 1.1 参数介绍 1.2 stride 和 padding 的可视化 1.3 输入、输出通道数 1.3.1 多通道输入 1.3.2 多通道输出 二、卷积操作练习 2.1 数据集准备 2.2 自定义神经网络 2.3 卷积操作控制台输出结果 2.4 tensorboard可视化 三、完整代码 一、torc…

NestJS 使用体验 | 不如 Spring Boot

本博客站点已全量迁移至 DevDengChao 的博客 https://blog.dengchao.fun , 后续的新内容将优先在自建博客站进行发布, 欢迎大家访问. 文章目录前言正文开发体验运行体验总结相关内容推广前言 公司里近期在尝试部署一些业务到阿里云的函数计算上, 受之前迁移已有的 Spring Boot…

TestStand-调试VI

文章目录调试VI调试VI 在LabVIEW PASS/FAIL TEST步骤中放置一个断点。 ExecuteRun MainSequence。执行在LabVIEW PASS/FAIL处暂停测试步骤。 3.完成以下步骤来调试LabVIEW PASS/FAIL TEST VI步骤。 a.在TestStand的调试工具栏上单击step into&#xff08;步进&#xff09;…

System V IPC+消息队列

多进程与多线程 使用有名管道实现双向通信时&#xff0c;由于读管道是阻塞读的&#xff0c;为了不让“读操作”阻塞“写操作”&#xff0c;使用了父子进程来多线操作&#xff0c; 1&#xff09;父进程这条线&#xff1a;读管道1 2&#xff09;子进程这条线&#xff1a;写管道2…

【二叉树的顺序结构:堆 堆排序 TopK]

努力提升自己&#xff0c;永远比仰望别人更有意义 目录 1 二叉树的顺序结构 2 堆的概念及结构 3 堆的实现 3.1 堆向下调整算法 3.2 堆向上调整算法 3.3堆的插入 3.4 堆的删除 3.5 堆的代码实现 4 堆的应用 4.1 堆排序 4.2 TOP-K问题 总结&#xff1a; 1 二叉树的顺序结…

分享几招教会你怎么给图片加边框

大家平时分享图片的时候&#xff0c;会不会喜欢给照片加点装饰呢&#xff1f;比如加些边框、文字或者水印之类的。我就喜欢给图片加上一些边框&#xff0c;感觉加了边框的照片像裱在相框中的感觉似的&#xff0c;非常有趣。那么你知道如何给图片加边框吗&#xff1f;不知道的话…

【Nginx】01-什么是Nginx?Nginx技术的功能及其特性介绍

目录1. 介绍1.1 常见服务器的对比1&#xff09;IIS2&#xff09;Tomcat3&#xff09;Apache4&#xff09;Lighttpd1.2 Nginx的优点(1) 速度更快、并发更高(2) 配置简单、扩展性强(3) 高可靠性(4) 热部署(5) 成本低、BSD许可证2. Nginx常用功能2.1 基本HTTP服务2.2 高级HTTP服务…

华为数通2022年11月 HCIP-Datacom-H12-821 第二章

142.以下关于状态检测防火墙的描述&#xff0c;正确是哪一项&#xff1f; A.状态检测防火墙需要对每个进入防火墙的数据包进行规则匹配 B.因为UDP协议为面向无连接的协议&#xff0c;因此状态检测型防火墙无法对UDP报文进行状态表的匹配 C.状态检测型防火墙只需要对该连接的第一…

性能测试-CPU性能分析,IO密集导致系统负载高

目录 IO密集导致系统负载高 使用top命令-观察服务器资源状态 使用vmstat命令-观察服务器资源状态 使用pidstat命令-观察服务器资源状态 使用iostat命令-观察服务器资源状态 IO密集导致系统负载高 stress-ng -i 10 --hdd 1 --timeout 100-i :有多少个工作者进行&#…

函数的极限:如何通过 δ 和 ϵ 来定义一个连续的函数

连续的定义 维基百科给出的定义&#xff1a; 连续函数&#xff08;英语&#xff1a;Continuous function&#xff09;是指函数在数学上的属性为连续。直观上来说&#xff0c;连续的函数就是当输入值的变化足够小的时候&#xff0c;输出的变化也会随之足够小的函数。 所以不要直…

51单总线控制SV-5W语音播报模块

单总线控制SV-5W语音播报模块SV-5W语音播报模块SV-5W语音播报模块简介工作模式说明模块配置接线驱动部分代码效果展示SV-5W语音播报模块 SV-5W语音播报模块简介 DY-SV5W是一款智能语音模块&#xff0c;集成IO分段触发&#xff0c;UART串口控制&#xff0c;ONE_line单总线串口控…

macOS monterey 12.6.1安装homebrew + nginx + php + mysql

效果图 主要步骤 安装homebrew使用brew安装nginxphpmysql详细步骤 参考“Homebrew国内如何自动安装&#xff08;国内地址&#xff09;&#xff08;Mac & Linux&#xff09;”安装brew&#xff0c; 命令&#xff1a; /bin/zsh -c "$(curl -fsSL https://gitee.com/cu…

[附源码]java毕业设计网上学车预约系统

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…