Spring learning-2
以下所有代码均已脱敏
@Value
注解用法
格式:
@Value(${application.properties.key:defaultValue})
举例:
@Value("${top.cocobolo.flag:false}")
private String flag;
JsonProperty
注解用法
格式: @JsonProperty(value = “name”, required = false)
举例:
@JsonProperty("another_name")
private String name;
上述写法应该是从application.properties
配置文件中去找名为status
的属性值,inject给checkStatus,如果找不到该属性值,则给默认值false