sprintboot(32) : web项目快速配置

pom.xml


    
        org.springframework.boot
        spring-boot-starter-parent
        2.1.9.RELEASE
         
    


    
        1.8
    

    
        
            org.springframework.boot
            spring-boot-starter-web
        
        
        
        
        
            mysql
            mysql-connector-java
            8.0.11
        
        
            org.mybatis.spring.boot
            mybatis-spring-boot-starter
            2.1.0
        
        
        
        
        
            org.apache.commons
            commons-lang3
            3.9
        
        
            org.apache.commons
            commons-collections4
            4.1
        
        
        
            com.alibaba
            fastjson
            1.2.24
        
        
        
            org.projectlombok
            lombok
            true
        
        
        
            org.quartz-scheduler
            quartz
            2.2.1
        
        
            org.springframework.boot
            spring-boot-starter-test
            test
        


        
            com.alibaba
            druid-spring-boot-starter
            1.2.1
        
        
            tk.mybatis
            mapper-spring-boot-starter
            2.1.5
        
        
            ch.ethz.ganymed
            ganymed-ssh2
            build210
        
        
        
            org.apache.sshd
            sshd-common
            2.7.0
        

        
        
            org.apache.sshd
            sshd-core
            2.7.0
        

        
        
            org.apache.sshd
            sshd-scp
            2.7.0
        
    

    
        
            
                src/main/java
                
                    **/*.yml
                    **/*.properties
                    **/*.xml
                
                false
            
            
                src/main/resources
                
                    **/*.yml
                    **/*.properties
                    **/*.xml
                
                false
            
        
        
            
                org.apache.maven.plugins
                maven-compiler-plugin
                
                    1.8
                    1.8
                    UTF-8
                
            
            
                org.springframework.boot
                spring-boot-maven-plugin
                
                    
                    com.alibaba.bkbox.handle.CenterDataHandleApplication
                    ZIP
                    true
                
                
                    
                        
                            repackage
                        
                    
                
            
            
                org.apache.maven.plugins
                maven-surefire-plugin
                
                    true
                
            
        
    

SystemController


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * @Auther: liyue
 * @Date: 2020/4/27 15:13
 * @Description:
 */
@RestController
public class SystemController {
 
    public final static String SUCCESS = "SUCCESS";
 
    @RequestMapping("/live")
    public String live() {
        return SUCCESS;
    }
}


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;


@SpringBootApplication(scanBasePackages = "cn.nordrassil.test")
@EnableScheduling
@EnableAsync
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

application.properties

spring.profiles.active=dev
logging.level.root=info
spring.application.name=test

#log
logging.path=logs

#数据库配置
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#logging.level.com.alibaba.bkbox.node.sender.dao.mapper=DEBUG
# 下面为连接池的补充设置,应用到上面所有数据源中# 初始化大小,最小,最大
spring.datasource.initialSize=5
spring.datasource.minIdle=5
spring.datasource.maxActive=50
# 配置获取连接等待超时的时间
spring.datasource.maxWait=60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
spring.datasource.timeBetweenEvictionRunsMillis=60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
spring.datasource.minEvictableIdleTimeMillis=300000
spring.datasource.validationQuery=SELECT 1 FROM DUAL
spring.datasource.testWhileIdle=true
spring.datasource.testOnBorrow=false
spring.datasource.testOnReturn=false
# 打开PSCache,并且指定每个连接上PSCache的大小
spring.datasource.poolPreparedStatements=true
spring.datasource.maxPoolPreparedStatementPerConnectionSize=20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
spring.datasource.filters=stat,wall,log4j
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&useSSL=false&characterEncoding=utf-8&serverTimezone=GMT%2b8&allowMultiQueries=true&tinyInt1isBit=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=123456

你可能感兴趣的:(#,springboot,springboot,web项目)