![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springboot
一小昊
看到困难就看不到目标,看到目标就看不到困难。
展开
-
Redisson分布式锁使用
1.引入依赖 <dependency> <groupId>org.redisson</groupId> <artifactId>redisson</artifactId> <version>3.16.0</version> </dependency>2.配置文件application.ymlspring:原创 2022-05-18 13:51:15 · 272 阅读 · 0 评论 -
JsonFormat注解解决LocalDateTime前端传入时间格式问题
注解@JsonFormat主要是后台到前台的时间格式的转换注解@DataFormAT主要是前后到后台的时间格式的转换@DateTimeFormat(pattern = "yyyy-MM-dd")@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")private Date symstarttime; @DateTimeFormat(pattern = "yyyy-MM-dd")@JsonFormat(pattern = "yy原创 2021-06-25 16:39:27 · 1772 阅读 · 0 评论 -
linux下获取resources下文件
使用ResourceUtils的getFile方法在本机电脑时可行的,但部署到linux就获取不到了File logoFile = ResourceUtils.getFile("classpath:logo.png");使用如下方式ClassPathResource cpr = new ClassPathResource("image"+File.separator+"logo.png");InputStream in = cpr.getInputStream();...原创 2021-05-26 08:53:27 · 2029 阅读 · 0 评论 -
分段计时器StopWatch使用
StopWatch需要依赖spring-core这个jar包主要作用记录开始时间点记录结束时间点输出执行时间及各个时间段的占比 public static void main(String[] args) { StopWatch sw = new StopWatch("test"); sw.start("task1"); // do something try { Thread.sleep(100); } catch (InterruptedException e) {原创 2020-11-13 09:55:00 · 1232 阅读 · 0 评论 -
maven search阿里云地址
https://maven.aliyun.com/mvn/search原创 2020-11-13 09:51:39 · 639 阅读 · 0 评论 -
使用maven命令将第三方jar包导入maven库
需要引入如下jar文件 <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc8</artifactId> <version>19.0</version> </dependency>把jar包放到D盘根目录...原创 2020-04-14 11:19:18 · 100 阅读 · 0 评论 -
springboot项目引用第三方jar包
springboot项目引用第三方jar包1.在项目文件下创建lib文件夹(和src文件夹同级)把需要的jar包放入lib文件夹中如上图所示2.在pom.xml中引入 <dependency> <groupId>javaee</groupId> <artifactId>javaee</artifactId> ...原创 2020-04-11 16:26:03 · 1197 阅读 · 0 评论 -
Illegal unquoted character ((CTRL-CHAR, code 9)): has to be escaped using backslash to be included i
Illegal unquoted character ((CTRL-CHAR, code 9)): has to be escaped using backslash to be included in string value有时候会在json转换的时候出现这个错误,解决方法如下,比如:{ "id":100, "name":"zhngsan", "note":{ "aaa":11...原创 2019-11-05 14:16:44 · 23523 阅读 · 0 评论 -
springboot+swagger的使用
springboot+swagger的使用首先pom.xml添加依赖 <dependency> <groupId>io.swagger</groupId> <artifactId>swagger-annotations</artifactId> <version>1.5.21</version&g...原创 2019-10-30 11:39:51 · 318 阅读 · 0 评论 -
springboot的启动自动执行任务实现CommandLineRunner接口
Springboot项目启动自动执行任务CommandLineRunner接口Spring boot的CommandLineRunner接口主要用于实现在应用初始化后,去执行一段代码块逻辑,这段初始化代码在整个应用生命周期内只会执行一次。***CommandLineRunner接口的作用***平常开发中有可能需要实现在项目启动后执行的功能,SpringBoot提供的一种简单的实现方案就是添加...原创 2019-10-12 10:04:26 · 454 阅读 · 0 评论