如何把静态常量放在yml配置文件中

application.yml
RSA:
pubKeyText : 123

在代码中
@Value("${RSA.pubKeyText}")
String PublicKey;
调用时直接取
System.out.println(PublicKey);
posted @ 2020-07-31 12:48  下饭  阅读(1058)  评论(0编辑  收藏  举报