基于SpringBoot+Vue高校竞赛管理系统的设计与实现

项目介绍:

高校竞赛管理系统管理系统按照操作主体分为管理员和用户。管理员的功能包括字典管理、论坛管理、竞赛公告管理、获奖管理、老师管理、评审管理、评审分配管理、评审打分管理、赛事管理、赛事提交管理、赛事报名管理、用户管理、专家管理、管理员管理。用户的功能等。该系统采用了Mysql数据库,Java语言,Spring Boot框架等技术进行编程实现。

高校竞赛管理系统管理系统可以提高高校竞赛管理系统信息管理问题的解决效率,优化高校竞赛管理系统信息处理流程,保证高校竞赛管理系统信息数据的安全,它是一个非常可靠,非常安全的应用程序。

功能介绍:

部分截图说明:

首页

获奖

赛事

个人中心

登录界面

评审管理

赛事管理

评审打分管理

部分代码:

复制代码
/**
 * 上传文件映射表
 */
@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);
		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);
	}
	
}

此源码非开源,若需要此源码可扫码添加微信或者qq: 2214904953进行咨询!

2600多套项目欢迎咨询

相关推荐
Hilaku7 分钟前
🔥这 10 个 Vue3 性能优化技巧,藏太深了,建议保存!
前端·javascript·vue.js
一只猫猫熊17 分钟前
Vue实战:手把手教你封装一个可拖拽并支持穿透操作的弹窗组件
前端·vue.js
spionbo18 分钟前
电脑文件搜索工具、和苹果电脑一样的功能,QuickLOOK-预览神器,能预览音频、视频、压缩文件、OFFICE三件套
后端
天天摸鱼的java工程师24 分钟前
Spring 事务传播机制你了解吗?事务嵌套时你遇到过什么坑?
java·后端·面试
xiaoming001827 分钟前
Django中使用流式响应,自己也能实现ChatGPT的效果
后端·python·chatgpt·django
满分观察网友z28 分钟前
我与Java IO的爱恨情仇:从“文件复制等到天荒地老”到“对象序列化秒存秒取”的顿悟之旅
后端
满分观察网友z28 分钟前
乱码、卡顿、崩溃?我用 Java IO '流'操作,搞定一个棘手的实时日志系统!
后端
武子康29 分钟前
大数据-14-Hive HQL 表连接查询 HDFS导入导出 逻辑运算 函数查询 全表查询
大数据·后端·apache hive
星辰大海的精灵29 分钟前
轻松玩转 Kubernetes 集群的工具包
后端·架构·kubernetes
import_random42 分钟前
[python]Flask(介绍+应用)
后端