package com.example.demo.common;

import com.alibaba.fastjson.JSON;
import pers.jc.util.JCFileTool;

import java.io.File;

public class LocalTestConfig {
    private String localIp;
    private String dataBaseUsername;
    private String dataBasePassword;

    public String getLocalIp() {
        return localIp;
    }

    public void setLocalIp(String localIp) {
        this.localIp = localIp;
    }

    public String getDataBaseUsername() {
        return dataBaseUsername;
    }

    public void setDataBaseUsername(String dataBaseUsername) {
        this.dataBaseUsername = dataBaseUsername;
    }

    public String getDataBasePassword() {
        return dataBasePassword;
    }

    public void setDataBasePassword(String dataBasePassword) {
        this.dataBasePassword = dataBasePassword;
    }

    public static LocalTestConfig instance;
    public static void loadConfig() throws Exception {
        String path = JCFileTool.joinPath(JCFileTool.getRootPath(), "res", "LocalTest.json");
        String text = new JCFileTool().readStr(new File(path));
        instance = JSON.parseObject(text, LocalTestConfig.class);
    }
}
