application.yml读取属性值

application.yml读取属性值

1、application.yml设置

application.yml读取属性值

 

 

2、编写配置类

package com.hgchain.neo4j.data.configure;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author bai
 */
@Component
@ConfigurationProperties(prefix = "kettle-repository")
@Data
public class KettleMysqlRepProperties {

    private String name;
    private String access;
    private String type;
    private String host;
    private String db;
    private String user;
    private String pass;
    private String port;


}

  3、使用

application.yml读取属性值

 

application.yml读取属性值

上一篇:uni-app调用wifi接口


下一篇:基于jQuery解决ios10以上版本缩放问题