java实体类
//java 属性,冒号后未默认值,yml中没有时取此处时间
@Value("${xxx.endTime:2025-01-01 00:00:00}")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
yml文件
xxx:
endTime: '2023-01-01 00:00:00'
原文链接
https://blog.youkuaiyun.com/Bruce1114/article/details/126145197