ConfigurationProperties for springboot uses

  springboot

Configuration file

demo:
  user: xxx
  password: xxx
  code: xxx

Example

@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;
    }
}

Only autowired is required for later use.