初始化内存定义全局变量
public static Map<String, String> regionMap = new HashMap<>();
1、实现CommandLineRunner类,重写run方法
2、实现InitializingBean类,重新afterPropertiesSet方法,但bean需要通过set构造方法注入
3、通过构造方法注入
@PostConstruct
public void init() {
log.info("----初始化系统参数----");
}
初始化内存定义全局变量
public static Map<String, String> regionMap = new HashMap<>();
1、实现CommandLineRunner类,重写run方法
2、实现InitializingBean类,重新afterPropertiesSet方法,但bean需要通过set构造方法注入
3、通过构造方法注入
@PostConstruct
public void init() {
log.info("----初始化系统参数----");
}
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。