SpringBoot
走马川行雪
这个作者很懒,什么都没留下…
展开
-
springboot连接数据库用户名密码加密
对数据库账号密码等信息进行加密,程序运行时进行解密。另一个种方式详见Gitee wj项目原创 2022-08-10 15:51:35 · 5800 阅读 · 0 评论 -
springboot启动成功后自动执行代码
1、通过实现ApplicationRunner接口:package com.bk.configs; import org.springframework.boot.ApplicationArguments;import org.springframework.boot.ApplicationRunner;import org.springframework.stereotype.Component; /** * Created by kangpeng on 2020-10-24. *原创 2020-10-24 10:41:28 · 806 阅读 · 0 评论 -
Java实现定时任务
一、普通Java项目实现定时任务1、Thread方式创建一个thread在while循环中重复运行,然后通过sleep方式控制每次循环的时间,实现简单的定时任务。//设置时间间隔为1秒final long timeInterval = 1000;Runnable runnable = new Runnable() { public void run() { ...原创 2019-07-31 10:25:57 · 2856 阅读 · 0 评论 -
Java去除json数据中的null空值问题
1、描述@JsonInclude(JsonInclude.Include.NON_NULL)标记是jackson包提供的json序列化方法,已经集成于Springboot2.0中,此方法的配置意在可以对实体json序列化的时候进行对应的数值处理。2、使用用注解的方式放在标记类或者属性@JsonInclude(JsonInclude.Include.NON_NULL)public ...原创 2019-08-01 09:08:19 · 11891 阅读 · 10 评论