SpringBoot
文章平均质量分 89
郭亚航
这个作者很懒,什么都没留下…
展开
-
Springboot使用方法
1.常用注解 修饰类 @SpringBootApplication//标记这是个主程序类,并自动扫描该主类所在包及其子包中的类 @ConfigurationProperties(prefix = "zhangsan")//表示全局配置文件文件中zhangsan这个父节点下的子节点属性对应该bean类 @PropertySource(value={"classpath:jdbc.properties","classpath:spring.propertie...原创 2020-07-12 22:46:08 · 1611 阅读 · 1 评论 -
Springboot缓存与redis整合
Springboot缓存 Spring缓存抽象 重要概念以及缓存注解 Cache:缓存接口,定义缓存操作,实现又:RedisCache,EhCacheCache,ConcurrentMapCache等 CacheManager:缓存管理器,管理各种缓存组件 @Cacheable:修饰方法,能够根据方法的请求参数和返回结果进行缓存 @CacheEvict:修饰方法,清空缓存,例如从数据库删除某个用户,那就需要把相应原创 2020-07-05 22:27:47 · 356 阅读 · 0 评论 -
Springboot整合MyBatis进行数据库交互
Mybatis访问数据库 注解方式 创建项目 勾选mysql Driver; JDBC API;Mybatis 配置数据源 spring: datasource: url: jdbc:mysql://192.168.1.103:3306/jdbc?serverTimezone=Asia/Shanghai use...原创 2020-05-24 15:26:39 · 279 阅读 · 0 评论 -
1.自定义启动器starter
新建maven工程yahang-spring-boot-starter (starter是一个空JAR包,仅仅作为maven下载jar包的启动器) 新建maven工程yahang-spring-boot-starter-autoconfigure (实际工作的模块) yahang-spring-boot-starter作为一个启动器,设置依赖于yahang-spring-boot-starter-autoconfigure <dependency...原创 2020-05-24 11:49:03 · 197 阅读 · 0 评论