• SSM SpringBoot vue限房摇号系统


    SSM SpringBoot vue限房摇号系统

    SSM限房摇号系统功能介绍

    首页 房源信息 我的收藏 登录注册 个人中心

    后台管理 登录注册 个人中心 户型信息管理 面积信息管理 地段信息管理
    房企信息管理 房源信息管理 用户管理 轮候序号管理 房源申购管理
    我的摇号管理 我的收藏管理 管理员管理

    使用技术
    功能展示

    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

    在这里插入图片描述

    FileController文件上传下载
    package com.controller;
    
    import java.io.File;
    import java.io.IOException;
    import java.util.Date;
    
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    import org.apache.commons.io.FileUtils;
    import org.apache.commons.io.IOUtils;
    import org.apache.commons.lang3.StringUtils;
    import org.springframework.beans.factory.annotation.Autowired;
    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,HttpServletRequest request) throws Exception {
    		if (file.isEmpty()) {
    			throw new EIException("上传文件不能为空");
    		}
    		String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
    		String fileName = new Date().getTime()+"."+fileExt;
    		File dest = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+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 void download(@RequestParam String fileName, HttpServletRequest request, HttpServletResponse response) {
    		try {
    			File file = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);
    			if (file.exists()) {
    				response.reset();
    				response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName+"\"");
    				response.setHeader("Cache-Control", "no-cache");
    				response.setHeader("Access-Control-Allow-Credentials", "true");
    				response.setContentType("application/octet-stream; charset=UTF-8");
    				IOUtils.write(FileUtils.readFileToByteArray(file), response.getOutputStream());
    			}
    
    		} catch (IOException e) {
    			e.printStackTrace();
    		}
    	}
    	
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83

    spring-mvc.xml配置文件上传大小

    
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
           xmlns:mvc="http://www.springframework.org/schema/mvc"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
    
        <mvc:default-servlet-handler/>
    
        
        <context:component-scan base-package="com.controller"/>
    
        
        <mvc:annotation-driven>
            
        mvc:annotation-driven>
        
        <mvc:resources mapping="/resources/**" location="/resources/"/>
        
        <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="prefix" value="/WEB-INF/pages/"/>
            <property name="suffix" value=".jsp"/>
        bean>
        
        
        <mvc:interceptors>
            <mvc:interceptor>
                <mvc:mapping path="/**"/>
                <mvc:exclude-mapping path="/upload"/>
                <bean class="com.interceptor.AuthorizationInterceptor"/>
            mvc:interceptor>
        mvc:interceptors>
    
        
        <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
            
            <property name="maxUploadSize" value="32505856"/>
        bean>
    
    beans>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    运行

    创建数据库, 然后修改数据库连接相关信息。

    配置tomcat运行

    前台访问地址:http://localhost:8080/ssm/front/index.html

    后台访问地址:http://localhost:8080/ssm/admin/dist/index.html

    管理员账号:liang 密码:liang

  • 相关阅读:
    3288S Android11 适配红外遥控功能(超详细)
    自然语言处理(NLP)—— 主题建模
    架构师:构建高可用服务治理Consul集群与Kong网关管理
    国庆day1
    【MySQL】4、MySQL备份与恢复
    React整理杂记(一)
    springboot+mybatis-plus+element ui生成二维码
    steam搬砖项目,csgo游戏搬砖熟练操作后,可以月入过万~
    国内优秀的多用户商城系统盘点(2022年整理)
    上述代码的程序具体流程是什么
  • 原文地址:https://blog.csdn.net/yinjl123/article/details/126794075