| | |
| | | public class PlusCodeGenerator { |
| | | |
| | | // 数据库配置 |
| | | private static final String DB_URL = "jdbc:postgresql://lunor.cn:5431/ruoyi-java"; |
| | | private static final String DB_USERNAME = "test"; |
| | | private static final String DB_PASSWORD = "chj123456"; |
| | | private static final String DB_URL = "jdbc:postgresql://localhost:5432/ruoyi-java"; |
| | | private static final String DB_USERNAME = "postgres"; |
| | | private static final String DB_PASSWORD = "root"; |
| | | |
| | | // 项目基础配置 |
| | | private static final String BASE_PACKAGE = "com.ruoyi"; |
| | |
| | | |
| | | public static void main(String[] args) { |
| | | String projectPath = System.getProperty("user.dir"); // 获取项目根路径 |
| | | String path = "basic-server"; // 模块名称 |
| | | String table = "supply"; // 表名,多个表逗号隔开 |
| | | String path = "ruoyi-system"; // 模块名称 |
| | | String table = "province,city,district"; // 表名,多个表逗号隔开 |
| | | |
| | | // 代码输出路径配置 |
| | | 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("chenhj") // 作者信息 |
| | | .outputDir(outputBasePath) // 代码输出目录 |
| | | .dateType(DateType.ONLY_DATE) // 日期类型 |
| | | .commentDate("yyyy-MM-dd") // 注释日期格式 |