我有这个配置类
@Configuration
@ComponentScan(value ="com.cloudgatewayservice")
@PropertySources({@PropertySource("classpath:application.yml"),
@PropertySource("file:${prm.target.account.config}")})
public class AccountInstanceConfig {
@Autowired private Environment env;
@Bean public List<String> accountInstance() {
return Arrays.asList(env.getRequiredProperty("prm-account-instance").split("#"));
}
}
我需要拿到 accountInstance()
返回值,但我不知道怎么做。你能帮点忙吗?谢谢您。
1条答案
按热度按时间e7arh2l61#
你能用吗
@Autowired
注解?现场:
在构造函数中:
或与塞特: