| | |
| | | |
| | | // 项目基础配置 |
| | | private static final String BASE_PACKAGE = "com.ruoyi"; |
| | | private static final String MODULE_NAME = "basic"; // 模块名 |
| | | private static final String MODULE_NAME = "business"; // 模块名 |
| | | |
| | | public static void main(String[] args) { |
| | | String projectPath = System.getProperty("user.dir"); // 获取项目根路径 |
| | | String path = "basic-server"; // 模块名称 |
| | | String table = "coal_info"; // 表名,多个表逗号隔开 |
| | | String path = "main-business"; // 模块名称 |
| | | String table = "inspection_task"; // 表名,多个表逗号隔开 |
| | | String author = "ld"; // 作者信息 |
| | | |
| | | // 代码输出路径配置 |
| | | String outputBasePath = Paths.get(projectPath, path, "src", "main", "java").toString(); |
| | |
| | | // 代码生成核心配置 |
| | | FastAutoGenerator.create(DB_URL, DB_USERNAME, DB_PASSWORD) |
| | | .globalConfig(builder -> { |
| | | builder.author("ld") // 作者信息 |
| | | builder.author(author) // 作者信息 |
| | | .outputDir(outputBasePath) // 代码输出目录 |
| | | .dateType(DateType.ONLY_DATE) // 日期类型 |
| | | .commentDate("yyyy-MM-dd") // 注释日期格式 |
| | |
| | | )); // 基类字段 |
| | | customMap.put("idType", "AUTO"); // 主键类型 |
| | | customMap.put("superEntityClass", "com.ruoyi.common.core.domain.MyBaseEntity"); // 基类全路径 |
| | | customMap.put("author", "ruoyi"); // 作者信息 |
| | | customMap.put("author", author); // 作者信息 |
| | | customMap.put("packageName", BASE_PACKAGE + "." + MODULE_NAME); // 包名 |
| | | customMap.put("tableName", table); // 表名 |
| | | |