Springboot properties 配置List

Springboot properties 配置List< Entity>

  • properties:

    props.data[0].appId=1409781248
    props.data[0].appName=hello
    props.data[0].publicKey=MIIBIjsdfsdf2t24aAFEGDsef
    props.data[0].privateKey=MIIEvDGdfgtertsf
    
  • Java:

    @Data
    @Configuration
    @ConfigurationProperties(prefix = "props")
    public class AppProperties {
        private List data;
    
    //    private final AppProp app = new AppProp();
    
        @Data
        public static class AppProp {
            private String appId;
            private String appName;
            private String privateKey;
            private String publicKey;
        }
    
    }
    

你可能感兴趣的:(Springboot properties 配置List)