是否生成DTO
This commit is contained in:
parent
919f727049
commit
00f83f0e2d
|
|
@ -23,13 +23,15 @@ public class Main {
|
|||
// packageName 指定生成代码项目
|
||||
// tableName 指定需要生成的表
|
||||
|
||||
// String servicePackageName = "system";
|
||||
// String servicePackageName = "account";
|
||||
// String servicePackageName = "product";
|
||||
// String packageName = "system";
|
||||
String packageName = "account";
|
||||
// String packageName = "product";
|
||||
// String packageName = "order";
|
||||
|
||||
String tableName = "tb_shop_table";
|
||||
String author = "zs";
|
||||
String tableName = "tb_shop_coupon_product";
|
||||
String author = "ww";
|
||||
//是否生成DTO实体 默认生成
|
||||
boolean isGenerateDto = true;
|
||||
|
||||
//配置数据源
|
||||
HikariDataSource dataSource = new HikariDataSource();
|
||||
|
|
@ -53,11 +55,13 @@ public class Main {
|
|||
serviceGenerator.generate();
|
||||
|
||||
//默认生成全参数DTO
|
||||
GlobalConfig dtoConfig = createDtoGlobalConfig(currentWorkingDirectory + "/cash-common/cash-common-service",
|
||||
basePackage + packageName, "tb", tableName);
|
||||
Generator dtoGenerator = new Generator(dataSource, dtoConfig);
|
||||
dtoConfig.setAuthor(author);
|
||||
dtoGenerator.generate();
|
||||
if(isGenerateDto){
|
||||
GlobalConfig dtoConfig = createDtoGlobalConfig(currentWorkingDirectory + "/cash-common/cash-common-service",
|
||||
basePackage + packageName, "tb", tableName);
|
||||
Generator dtoGenerator = new Generator(dataSource, dtoConfig);
|
||||
dtoConfig.setAuthor(author);
|
||||
dtoGenerator.generate();
|
||||
}
|
||||
}
|
||||
|
||||
public static GlobalConfig createGlobalConfigUseStyle(String projectPath, String packageName, String tablePrefix, String... tableNames) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue