// Path: QuickProject-Util/src/main/java/chanedi/enums/DBDialectType.java
// public enum DBDialectType {
// 
//     MYSQL("mysql"), ORACLE("oracle"), H2("h2");
// 
//     private String type;
// 
//     private DBDialectType(String type) {
//         this.type = type;
//     }
// 
//     @Override
//     public String toString() {
//         return type;
//     }
// 
// }
// 
// Path: QuickProject-Generator/src/main/java/chanedi/generator/file/exception/GlobalConfigException.java
// public class GlobalConfigException extends ConfigException {
// 
//     private static final String errorMessage = "全局配置参数错误：";
// 
//     public GlobalConfigException(String configParam) {
//         super(errorMessage + configParam);
//     }
// 
//     public GlobalConfigException(String configParam, String message) {
//         super(errorMessage + configParam + "(" + message + ")");
//     }
// 
//     public GlobalConfigException(String configParam, Throwable cause) {
//         super(errorMessage + configParam, cause);
//     }
// 
//     public GlobalConfigException(String configParam, String message, Throwable cause) {
//         super(errorMessage + configParam + "(" + message + ")", cause);
//     }
// 
// }


import chanedi.enums.DBDialectType;
import chanedi.generator.file.exception.GlobalConfigException;
import lombok.Getter;
import lombok.Setter;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import java.io.File;
import java.io.IOException;
package chanedi.generator.file;



/**
 * @author Chanedi
 * 单例
 */
public final class GlobalConfig {

    @Getter
    private static GlobalConfig instance = new GlobalConfig();
    private ResourceLoader resourceLoader = new PathMatchingResourcePatternResolver();
    @Setter@Getter
    private String outProjectPath = "D:/gen";
    @Setter
    private String inputSqlPath = "classpath:/sql";
    @Setter
    private String tmplPath = "classpath:/tmpl/file";
    @Setter@Getter
    private String javaPackageName = "com.";
    @Setter@Getter
    private String javaPackagePath = "com/";
    @Setter@Getter
    private String typeMatchConfigPath = "classpath:/typeMatch";
    /** 表名命名法则（正则表达式），java类名请用"(\\w+)"表示。如："^T_(\w+)$"则表名为T_USER_INFO，java类名为UserInfo。默认为"(\\w+)$"（表名即类名，没有前缀） */
    @Setter@Getter
    private String beanNameRegex = "(\\w+)$";
    /** 为true则已存在的文件不重新生成。默认为true。 */
    @Setter@Getter
    private boolean ignoreExists = true;
    /**
     * 数据库方言，默认为ORACLE。
     * @see DBDialectType
     */
    @Setter@Getter
    private DBDialectType dbDialectType = DBDialectType.ORACLE;

    private GlobalConfig() {
        super();
    }

// Path: QuickProject-Util/src/main/java/chanedi/enums/DBDialectType.java
// public enum DBDialectType {
// 
//     MYSQL("mysql"), ORACLE("oracle"), H2("h2");
// 
//     private String type;
// 
//     private DBDialectType(String type) {
//         this.type = type;
//     }
// 
//     @Override
//     public String toString() {
//         return type;
//     }
// 
// }
// 
// Path: QuickProject-Generator/src/main/java/chanedi/generator/file/exception/GlobalConfigException.java
// public class GlobalConfigException extends ConfigException {
// 
//     private static final String errorMessage = "全局配置参数错误：";
// 
//     public GlobalConfigException(String configParam) {
//         super(errorMessage + configParam);
//     }
// 
//     public GlobalConfigException(String configParam, String message) {
//         super(errorMessage + configParam + "(" + message + ")");
//     }
// 
//     public GlobalConfigException(String configParam, Throwable cause) {
//         super(errorMessage + configParam, cause);
//     }
// 
//     public GlobalConfigException(String configParam, String message, Throwable cause) {
//         super(errorMessage + configParam + "(" + message + ")", cause);
//     }
// 
// }


// Path: QuickProject-Generator/src/main/java/chanedi/generator/file/GlobalConfig.java
import chanedi.enums.DBDialectType;
import chanedi.generator.file.exception.GlobalConfigException;
import lombok.Getter;
import lombok.Setter;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import java.io.File;
import java.io.IOException;

package chanedi.generator.file;



/**
 * @author Chanedi
 * 单例
 */
public final class GlobalConfig {

    @Getter
    private static GlobalConfig instance = new GlobalConfig();
    private ResourceLoader resourceLoader = new PathMatchingResourcePatternResolver();
    @Setter@Getter
    private String outProjectPath = "D:/gen";
    @Setter
    private String inputSqlPath = "classpath:/sql";
    @Setter
    private String tmplPath = "classpath:/tmpl/file";
    @Setter@Getter
    private String javaPackageName = "com.";
    @Setter@Getter
    private String javaPackagePath = "com/";
    @Setter@Getter
    private String typeMatchConfigPath = "classpath:/typeMatch";
    /** 表名命名法则（正则表达式），java类名请用"(\\w+)"表示。如："^T_(\w+)$"则表名为T_USER_INFO，java类名为UserInfo。默认为"(\\w+)$"（表名即类名，没有前缀） */
    @Setter@Getter
    private String beanNameRegex = "(\\w+)$";
    /** 为true则已存在的文件不重新生成。默认为true。 */
    @Setter@Getter
    private boolean ignoreExists = true;
    /**
     * 数据库方言，默认为ORACLE。
     * @see DBDialectType
     */
    @Setter@Getter
    private DBDialectType dbDialectType = DBDialectType.ORACLE;

    private GlobalConfig() {
        super();
    }

    public File getInputSqlFile() throws GlobalConfigException {