From 7a1e9b29aa74f0ae130f462af7bf2b1f15d17b3c Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期五, 05 七月 2024 09:56:07 +0800 Subject: [PATCH] bug修改 --- code-generator/src/test/java/CodeGeneratorTests.java | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/code-generator/src/test/java/CodeGeneratorTests.java b/code-generator/src/test/java/CodeGeneratorTests.java index b7d0e92..114f066 100644 --- a/code-generator/src/test/java/CodeGeneratorTests.java +++ b/code-generator/src/test/java/CodeGeneratorTests.java @@ -2,15 +2,19 @@ import com.baomidou.mybatisplus.core.toolkit.StringPool; import com.baomidou.mybatisplus.generator.AutoGenerator; import com.baomidou.mybatisplus.generator.InjectionConfig; -import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.DataSourceConfig; +import com.baomidou.mybatisplus.generator.config.FileOutConfig; +import com.baomidou.mybatisplus.generator.config.GlobalConfig; +import com.baomidou.mybatisplus.generator.config.PackageConfig; +import com.baomidou.mybatisplus.generator.config.StrategyConfig; +import com.baomidou.mybatisplus.generator.config.TemplateConfig; import com.baomidou.mybatisplus.generator.config.po.LikeTable; import com.baomidou.mybatisplus.generator.config.po.TableFill; import com.baomidou.mybatisplus.generator.config.po.TableInfo; import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; -import org.junit.Test; - import java.util.ArrayList; import java.util.List; +import org.junit.Test; /** * 通过指定 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) 可达到加速的效果。 @@ -71,7 +75,6 @@ pc.setMapper("mapper"); pc.setService("service"); - // 自定义mapping文件生成路径配置 InjectionConfig cfg = new InjectionConfig() { @Override @@ -107,14 +110,12 @@ //templateConfig.setController(null); //mpg.setTemplate(templateConfig); - // 策略配置 StrategyConfig strategy = new StrategyConfig(); //设置字段和表名的是否把下划线完成驼峰命名规则 strategy.setNaming(NamingStrategy.underline_to_camel); strategy.setEntitySerialVersionUID(true); strategy.setEntityColumnConstant(false); - //设置生成的实体类继承的父类 // strategy.setSuperEntityClass(BaseModel.class); @@ -144,7 +145,7 @@ // strategy.setTablePrefix(pc.getModuleName() + ""); // strategy.setLikeTable(new LikeTable("room")); //strategy.setLikeTable(new LikeTable("member")); - strategy.setLikeTable(new LikeTable("tb_basic_data_config"));// 生成表名 + strategy.setLikeTable(new LikeTable("tb_data_screen_score"));// 生成表名 // strategy.setLikeTable(new LikeTable("t_hotel"));// 生成表名 // strategy.setLikeTable(new LikeTable("t_scan_message"));// 生成表名 // strategy.setNotLikeTable(new LikeTable("tb_dept"));// 不生成表名 -- Gitblit v1.7.1