Commit 2c8a2600a107ed5aa1a788ef665549d7e51b2e15

Authored by 芋道源码
Committed by Gitee
2 parents 6845f0e0 fcbcb283

!378 优化代码生成列表加载速度

Merge pull request !378 from 与或非/issues/20230116
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java
... ... @@ -237,10 +237,6 @@ public class CodegenServiceImpl implements CodegenService {
237 237 @Override
238 238 public List<DatabaseTableRespVO> getDatabaseTableList(Long dataSourceConfigId, String name, String comment) {
239 239 List<TableInfo> tables = databaseTableService.getTableList(dataSourceConfigId, name, comment);
240   - // 移除置顶前缀的表名 // TODO 未来做成可配置
241   - tables.removeIf(table -> table.getName().toUpperCase().startsWith("QRTZ_"));
242   - tables.removeIf(table -> table.getName().toUpperCase().startsWith("ACT_"));
243   - tables.removeIf(table -> table.getName().toUpperCase().startsWith("FLW_"));
244 240 // 移除已经生成的表
245 241 // 移除在 Codegen 中,已经存在的
246 242 Set<String> existsTables = CollectionUtils.convertSet(
... ...
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableServiceImpl.java
... ... @@ -52,7 +52,11 @@ public class DatabaseTableServiceImpl implements DatabaseTableService {
52 52 StrategyConfig.Builder strategyConfig = new StrategyConfig.Builder();
53 53 if (StrUtil.isNotEmpty(name)) {
54 54 strategyConfig.addInclude(name);
  55 + } else {
  56 + // 移除工作流和定时任务前缀的表名 // TODO 未来做成可配置
  57 + strategyConfig.addExclude("ACT_[\\S\\s]+|QRTZ_[\\S\\s]+|FLW_[\\S\\s]+");
55 58 }
  59 +
56 60 GlobalConfig globalConfig = new GlobalConfig.Builder().dateType(DateType.TIME_PACK).build(); // 只使用 Date 类型,不使用 LocalDate
57 61 ConfigBuilder builder = new ConfigBuilder(null, dataSourceConfig, strategyConfig.build(),
58 62 null, globalConfig, null);
... ...