2
0

fix: update code gen

This commit is contained in:
caiyuchao
2024-12-20 11:12:35 +08:00
parent cd3a860a34
commit a54834473d
2 changed files with 8 additions and 8 deletions

View File

@@ -19,13 +19,13 @@ import java.util.Collections;
public class GenPlusUtils {
// 生成代码输出路径
public static final String OUTPUT_PATH = "D://gencode/test4";
public static final String OUTPUT_PATH = "D://gencode";
// 模块名system/user
public static final String MODULE_NAME = "system";
// 数据库URL
public static final String URL = "jdbc:mysql://localhost:3306/wfc_system_db?useUnicode=true&useSSL=false&characterEncoding=utf8";
public static final String URL = "jdbc:mysql://localhost:3306/wfc_user_db?useUnicode=true&useSSL=false&characterEncoding=utf8";
// 表名
public static final String TABLE_NAME = "sys_rate_limit";
public static final String TABLE_NAME = "u_package";
public static void main(String[] args) {
@@ -34,7 +34,7 @@ public class GenPlusUtils {
builder.author("sys") // 设置作者
.enableSpringdoc()
.dateType(DateType.ONLY_DATE)
.outputDir("D://gencode"); // 指定输出目录
.outputDir(OUTPUT_PATH); // 指定输出目录
})
.dataSourceConfig(builder ->
builder.typeConvertHandler((globalConfig, typeRegistry, metaInfo) -> {
@@ -54,10 +54,10 @@ public class GenPlusUtils {
builder.parent("org.wfc") // 设置父包名
.moduleName(MODULE_NAME) // 设置父包模块名
.entity("domain")
.pathInfo(Collections.singletonMap(OutputFile.xml, "D://gencode")) // 设置mapperXml生成路径
.pathInfo(Collections.singletonMap(OutputFile.xml, OUTPUT_PATH)) // 设置mapperXml生成路径
)
.strategyConfig(builder ->
builder.addInclude("u_cdr_detail") // 设置需要生成的表名
builder.addInclude(TABLE_NAME) // 设置需要生成的表名
.addTablePrefix("t_", "c_") // 设置过滤表前缀
.controllerBuilder()
.enableRestStyle()