2023年5月17日

SpringBoot项目预加载数据——ApplicationRunner、CommandLineRunner、InitializingBean 、@PostConstruct区别

摘要: 0、参考、业务需求 参考: https://www.cnblogs.com/java-chen-hao/p/11835120.html#_label1 https://zhuanlan.zhihu.com/p/541268993 业务需求: 缓存数据字典数据、初始化线程池、提前加载好加密证书 1、方 阅读全文

posted @ 2023-05-17 15:47 C_C_菜园 阅读(310) 评论(0) 推荐(0)

SpringBoot配置两个一样的Bean,区分两个配置类——@Primary

摘要: 1、@Primary 作用: 指定默认bean。 当没有根据名字显示要注入哪个bean的时候,默认使用打了@Primary标签的bean 2、配置两个一样的bean @Configuration public class MyThymeLeafConfig { @Resource private A 阅读全文

posted @ 2023-05-17 14:10 C_C_菜园 阅读(1807) 评论(0) 推荐(0)

SpringBoot的@Resource和@Autowired+@Qualifier使用

摘要: 1、区别 参考: https://blog.csdn.net/xhbzl/article/details/126765893 https://blog.csdn.net/qq_40263124/article/details/124238530 2、使用 2.1、注入配置类 比如注入config的b 阅读全文

posted @ 2023-05-17 14:00 C_C_菜园 阅读(394) 评论(0) 推荐(0)

Java数字转中文数字——支持:Integer、BigDecimal

摘要: 1、效果 public static void main(String[] args) { System.out.println(int2chineseNum(3456)); System.out.println(int2chineseNum(-3456)); System.out.println( 阅读全文

posted @ 2023-05-17 11:38 C_C_菜园 阅读(243) 评论(0) 推荐(0)

导航