zhanghua
2025-04-14 1cad14bca191807e18705c3a5526eda8151be439
ycl-generator/src/main/java/com/ycl/MysqlGenerator.java
@@ -11,7 +11,7 @@
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import com.ycl.base.BaseController;
import com.ycl.controller.BaseController;
import java.util.ArrayList;
@@ -57,9 +57,9 @@
        // 全局配置
        GlobalConfig gc = new GlobalConfig();
        String projectPath = System.getProperty("user.dir");
        gc.setOutputDir(projectPath + "/ycl-generator/src/main/java");
        gc.setAuthor("wl");//作者
        final String projectPath = System.getProperty("user.dir");
        gc.setOutputDir(projectPath + "/ycl-smoke/src/main/java");
        gc.setAuthor("lyq");//作者
        gc.setBaseResultMap(true); //mapper.xml 生成 ResultMap
        gc.setBaseColumnList(true); //mapper.xml 生成 ColumnList
//        gc.setSwagger2(true);
@@ -83,7 +83,7 @@
//        pc.setModuleName(scanner("模块名"));
        pc.setModuleName(null);
        pc.setParent("com.ycl");
        String packageName = scanner("请输入包名");
        final String packageName = scanner("请输入包名");
        //自定义所在包的名称  基本没必要
        pc.setEntity(PN_ENTITY + PN_DELIMITER + packageName);
        pc.setController(PN_CONTROLLER + PN_DELIMITER + packageName);
@@ -108,7 +108,7 @@
//             String templatePath = "/templates/mapper.xml.vm";
        // 自定义输出配置
        List<FileOutConfig> focList = new ArrayList<>();
        List<FileOutConfig> focList = new ArrayList<FileOutConfig>();
        // 自定义配置会被优先输出
        focList.add(new FileOutConfig(templatePath) {
            @Override
@@ -116,7 +116,7 @@
                // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
//                return projectPath + "/coinyee-contract-generator/src/main/resources/mapper/" + pc.getModuleName()
//                        + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
                return projectPath + "/ycl-generator/src/main/resources/mapper/"
                return projectPath + "/ycl-smoke/src/main/resources/mapper/"
                        + packageName + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
            }
        });
@@ -158,7 +158,7 @@
        //去除字段前缀
        strategy.setFieldPrefix("");
        List<TableFill> tableFills = new ArrayList<>();
        List<TableFill> tableFills = new ArrayList<TableFill>();
        TableFill createTimeFill = new TableFill("createTime", FieldFill.INSERT);
        TableFill modifiedTimeFill = new TableFill("modifiedTime", FieldFill.UPDATE);