赞
踩
<!--mysql driver--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> <!-- 数据源druid启动器 --> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>1.1.21</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-log4j2</artifactId> </dependency> <!--mybatis的springboot启动器--> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.1.1</version> </dependency> <!--jdbc方式连接mysql--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency>
<!--thymeleaf-spring5-->
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring5</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-java8time</artifactId>
</dependency>
<!--shiro整合spring-->
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>1.4.1</version>
</dependency>
<!--shiro thymeleaf整合-->
<dependency>
<groupId>com.github.theborakompanioni</groupId>
<artifactId>thymeleaf-extras-shiro</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
server: port: 8811 spring: thymeleaf: # 模板缓存。 cache: false # 使用alibaa的druid的数据源 datasource: type: com.alibaba.druid.pool.DruidDataSource username: root password: 123456 url: jdbc:mysql://localhost:3306/sjk?userSSL=true&userUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai driver-class-name: com.mysql.cj.jdbc.Driver druid: initial-size: 5 # 初始化大小 min-idle: 5 # 最小 max-active: 50 # 最大 max-wait: 60000 # 配置获取连接等待超时的时间 time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 min-evictable-idle-time-millis: 300000 # 指定一个空闲连接最少空闲多久后可被清除,单位是毫秒 validationQuery: select 'x' test-while-idle: true # 当连接空闲时,是否执行连接测试 test-on-borrow: false # 当从连接池借用连接时,是否测试该连接 test-on-return: false # 在连接归还到连接池时是否测试该连接 filters: config,wall,stat # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 poolPreparedStatements: true # 打开PSCache,并且指定每个连接上PSCache的大小 maxPoolPreparedStatementPerConnectionSize: 20 maxOpenPreparedStatements: 20 # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 connectionProperties: druid.stat.slowSqlMillis=200;druid.stat.logSlowSql=true;config.decrypt=false # 合并多个DruidDataSource的监控数据 #use-global-data-source-stat: true #WebStatFilter配置,说明请参考Druid Wiki,配置_配置WebStatFilter web-stat-filter: enabled: true #是否启用StatFilter默认值true url-pattern: /* exclusions: /druid/*,*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico session-stat-enable: true session-stat-max-count: 10 #StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置 stat-view-servlet: enabled: true #是否启用StatViewServlet默认值true url-pattern: /druid/* reset-enable: true login-username: admin login-password: 123456 # mybatis配置 mybatis: type-aliases-package: top.yc9064.pojo mapper-locations: classpath:mapper/*.xml
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。