首页 > 其他分享 >230118_50_SpringBoot入门

230118_50_SpringBoot入门

时间:2023-01-18 23:22:16浏览次数:44  
标签:230118 name age 50 private dog person hello SpringBoot

yaml配置文件中,支持占位符配置

person:
name: bill${random.int}
age: 4
happy: true
birth: 2023/01/15
maps: {k1: v1,k2: v2}
hello: hello
lists:
- cat
- dog
- fish
dog:
name: ${person.hello:hi}
age: 2
person

@Component
@ConfigurationProperties(prefix = "person")
public class Person {

private String name;

private Integer age;

private Boolean happy;

private Date birth;
private Map<String,Object> maps;
private List

标签:230118,name,age,50,private,dog,person,hello,SpringBoot
From: https://www.cnblogs.com/wcwblog/p/17060848.html

相关文章