gpt4 book ai didi

java - Spring @Value 到数据结构

转载 作者:行者123 更新时间:2023-12-01 11:13:39 25 4
gpt4 key购买 nike

我的属性文件是这样的

customer1.username = "";
customer1.passwword ="";
customer1.integratorkey=""

customer2.username = "";
customer2.passwword ="";
customer2.integratorkey=""

有没有一种方法可以使用@Value注释并将值加载到数据结构中,其中包含所有六个值

最佳答案

带有@Value注释的Java代码:

 @Value("${customer1.username}")
private String customer1Username;

关于java - Spring @Value 到数据结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32097958/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com