demo: user: xxx password: xxx code: xxx
@Component @ConfigurationProperties(prefix = "demo") public class IShareProperties { String user; String password; String code; public String getUser() { return loginId; } public void setUser(String user) { this.user = user; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
以後使用只須要autowired進去便可。this