springboot集成shiro集成mybatis-plus、redis、quartz定时任务
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了springboot集成shiro集成mybatis-plus、redis、quartz定时任务,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2888字,纯文字阅读大概需要5分钟。
内容图文
![springboot集成shiro集成mybatis-plus、redis、quartz定时任务](/upload/InfoBanner/zyjiaocheng/899/a6c5c040648249ff96a59c8015c03058.jpg)
完整项目代码位于码云上,点击获取:Git地址
主要介绍一下重点配置地方:
一、application.yml文件
server:
port: 8084
servlet:
context-path: /test
spring:
## quartz定时任务,采用数据库方式
quartz:
job-store-type: jdbc
#json 时间戳统一转换
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
aop:
proxy-target-class: true
mvc:
static-path-pattern: /**
resource:
static-locations: classpath:/static/,classpath:/public/
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
datasource:
druid:
stat-view-servlet:
loginUsername: root
loginPassword: fatpig1234
dynamic:
druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
# 连接池的配置信息
# 初始化大小,最小,最大
initial-size: 5
min-idle: 5
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
# 打开PSCache,并且指定每个连接上PSCache的大小
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
filters: stat,wall,slf4j
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource:
master:
url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8
username: root
password: 11111
driver-class-name: com.mysql.jdbc.Driver
#redis 配置
redis:
database: 0
host: 127.0.0.1
lettuce:
pool:
max-active: 8 #最大连接数据库连接数,设 0 为没有限制
max-idle: 8 #最大等待连接中的数量,设 0 为没有限制
max-wait: -1ms #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
min-idle: 0 #最小等待连接中的数量,设 0 为没有限制
shutdown-timeout: 100ms
password: ''
port: 6379
#mybatis plus 设置
mybatis-plus:
mapper-locations: classpath*:org/fatpig/modules/**/xml/*Mapper.xml
#文件上传根目录 设置
uploadpath: D://upload/image
#文件上传临时目录
uploadtemp: D://upload/temp
二、创建redis,mybatis、shiro的配置文件
a、mybatisConfig文件
@Configuration
@MapperScan(value={"自己的mapper文件路径"})
public class MybatisPlusConfig {
/**
* 分页插件
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}
b、ShiroConfig配置文件
主要是配置自己的拦截路径规则
内容总结
以上是互联网集市为您收集整理的springboot集成shiro集成mybatis-plus、redis、quartz定时任务全部内容,希望文章能够帮你解决springboot集成shiro集成mybatis-plus、redis、quartz定时任务所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。