spring boot
文章平均质量分 58
Leeong_
这个作者很懒,什么都没留下…
展开
-
SpringBoot整合SpringSecurity 入门篇超级简单
1.pom添加jar包引用 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId></dependency><dependency> <groupId>org.springframework.boot</groupId> &原创 2021-07-09 21:36:21 · 228 阅读 · 0 评论 -
SpringBoot是如何加载application.properties配置文件的?
1.一个问题引发的思考 我在resouce下面增加了两个文件app.key,app.pub,application.properties 添加对应配置 jwt.private.key=classpath:app.key jwt.public.key=classpath:app.pub Config类中配置了对文件的引用 @Value("${jwt.public.key}") RSAPublicKey key; 结果启动后提示 java.io.FileNotFoundException:原创 2021-07-08 19:34:47 · 1156 阅读 · 0 评论 -
SpringBoot 开发实战 | 第四节 SpringBoot整合validation校验
1.引入jar包<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId></dependency><!-- fastjson --><dependency> <groupId>com.alibaba</groupId原创 2021-07-05 20:14:38 · 236 阅读 · 0 评论 -
linux下SpringBoot优雅更新、停机、发布
#!/bin/bash# 定义变量today=`date +%y%m%d`pid=app=demo-servicejarFile=${app}.jarsourcePath=/home/code/springboot/#更新代码,启动带上分支可以切换到指定分支cd ${sourcePath}/demo/if [ -n "$1" ] ;then echo "you have input is $1" git checkout $1fiecho '当前分支::'git原创 2021-07-03 09:58:38 · 403 阅读 · 0 评论 -
SpringBoot 开发实战 | 第三节 mybatis-plus 分页、复杂条件查询
1.定义mybatis-plus的配置文件该配置文件主要是配置了自带的分页插件PaginationInnerInterceptor,同时把对dao的扫码路径也转移到该配置文件中,启动类的dao扫描就可以删除了。@Configuration@MapperScan("com.leeong.demo.dao")public class MybatisPlusConfig { @Bean public MybatisPlusInterceptor mybatisPlusInterceptor原创 2021-06-27 09:20:51 · 505 阅读 · 0 评论 -
SpringBoot 开发实战 | 第二节 SpringBoot 整合 mybatis-plus
1.说明第二节的代码是以第一节代码为基础的。可通过第一节或者gitee的地址来获取第一节地址:https://blog.csdn.net/libankling2008/article/details/117790889gitee地址:https://gitee.com/null_484_1073/springboot.git2. 修改pom配置# 新增<dependency> <groupId>com.baomidou</groupId> <arti原创 2021-06-11 20:39:42 · 1104 阅读 · 2 评论 -
SpringBoot 开发实战 | 第一节 快速搭建SpringBoot crud 开发框架
1. 下载通用模板从https://start.spring.io/ 下载公共模板,右侧添加web,mysql,mybatis相关的类,下载后导入到idea中2. 配置application.properties配置端口、环境、数据源、mybatis相关配置server.port=8080spring.profiles.active=dev# datasourcespring.datasource.url=jdbc:mysql://127.0.0.1:3306/ds0?allowMulti原创 2021-06-10 21:19:31 · 348 阅读 · 1 评论 -
springboot @Cacheable 的实现原理
1. springboot cache 的使用 a.pom引入jar spring-boot-starter-cache b.启动类增加注解@EnableCaching c.需要缓存的方法增加注解 @Cacheable(cacheNames = "com:xxx",key = "''+#id")图12. Cacheable 的实现原理猜测 实现原理是什么呢?脑海第一反应应该当然是大名鼎鼎是AOP、动态代理、Interceptor 这些概念,那我们怎么去验证呢?3. Cacheab原创 2021-06-05 10:27:57 · 3932 阅读 · 0 评论