基于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多套项目欢迎咨询

相关推荐
IT码农-爱吃辣条2 分钟前
解决在uniapp真机运行上i18n变量获取不到问题
javascript·vue.js·uni-app
hrrrrb13 分钟前
【Java Web 快速入门】十、AOP
java·前端·spring boot
optimistic_chen23 分钟前
【Java EE进阶 --- SpringBoot】初识Spring(创建SpringBoot项目)
spring boot·后端·spring·java-ee·tomcat·mvc·idea
chxii27 分钟前
4.3 computed watch watchEffect
前端·javascript·vue.js
前端小巷子39 分钟前
Vue SSR原理
前端·vue.js·面试
活宝小娜1 小时前
新增和编辑共用弹窗模板
开发语言·前端·javascript·vue.js
阳光的男夹克1 小时前
Vue3 Element-plus 封装Select下拉复选框选择器
javascript·vue.js·ecmascript
IT毕设实战小研1 小时前
Java毕业设计选题推荐 |基于SpringBoot的健身爱好线上互动与打卡社交平台系统 互动打卡小程序系统
java·开发语言·vue.js·spring boot·vue·毕业设计·课程设计
程序员爱钓鱼3 小时前
Go语言实战案例:执行基本的增删改查
后端·google·go
long3163 小时前
java 工厂方法设计模式 FactoryMethod
java·开发语言·后端·设计模式