java常用、通用代码或配置

2021-06-09 03:03

阅读:357

标签:work   state   版本   mini   smi   map   query   使用   拦截器   

pom.xml

  支持springBoot

    parent

parent>
        groupId>org.springframework.bootgroupId>
        artifactId>spring-boot-starter-parentartifactId>
        version>2.4.1version>
parent>

    starter

dependency>
    groupId>org.springframework.bootgroupId>
    artifactId>spring-boot-starterartifactId>
dependency>

   支持springWeb

dependency>
    groupId>org.springframework.bootgroupId>
    artifactId>spring-boot-starter-webartifactId>
dependency>

支持mybatis【TODO】

dependency>
    groupId>org.mybatis.spring.bootgroupId>
    artifactId>mybatis-spring-boot-starterartifactId>
    
    version>1.3.0version>
dependency>


dependency>
    groupId>mysqlgroupId>
    artifactId>mysql-connector-javaartifactId>
dependency>

支持aop


dependency>
    groupId>org.springframework.bootgroupId>
    artifactId>spring-boot-starter-aopartifactId>
dependency>

 


properties或者yml常用配置

  服务端口

server:
  port: 2525

  视图前后缀配置

spring:
  mvc:
    view:
      prefix: /WEB-INF/views
      suffix: .jsp

  数据库yml【todo】

spring:
  datasource:
    # 使用druid数据源
    type: com.alibaba.druid.pool.DruidDataSource
    url: jdbc:mysql://localhost:3306/test21.2.27?serverTimezone=UTC
    username: root
    password: 123456
    driver-class-name: com.mysql.jdbc.Driver
    filters: stat
    maxActive: 20
    initialSize: 1
    maxWait: 60000
    minIdle: 1
    timeBetweenEvictionRunsMillis: 60000
    minEvictableIdleTimeMillis: 300000
    validationQuery: select 1 FROM DUAL
    testWhileIdle: true
    testOnBorrow: false
    testOnReturn: false
    poolPreparedStatements: true
    maxOpenPreparedStatements: 20

 

java常用、通用代码或配置

标签:work   state   版本   mini   smi   map   query   使用   拦截器   

原文地址:https://www.cnblogs.com/daydayhave/p/14503115.html


评论


亲,登录后才可以留言!