diff --git a/orion-ops-launch/src/main/java/com/orion/ops/launch/generator/CodeGenerator.java b/orion-ops-launch/src/main/java/com/orion/ops/launch/generator/CodeGenerator.java index d265f752..93fe73de 100644 --- a/orion-ops-launch/src/main/java/com/orion/ops/launch/generator/CodeGenerator.java +++ b/orion-ops-launch/src/main/java/com/orion/ops/launch/generator/CodeGenerator.java @@ -18,6 +18,7 @@ import com.orion.ops.framework.mybatis.core.domain.BaseDO; import com.orion.ops.framework.mybatis.core.mapper.IMapper; import com.orion.ops.launch.generator.engine.VelocityTemplateEngine; import com.orion.ops.launch.generator.template.Table; +import com.orion.ops.launch.generator.template.Template; import org.apache.ibatis.annotations.Mapper; import java.io.File; @@ -41,7 +42,7 @@ public class CodeGenerator { // 作者 String author = Const.ORION_AUTHOR; // 模块 - String module = "infra"; + String module = "asset"; // 生成的表 Table[] tables = { // Template.create("preference", "用户偏好", "preference") @@ -55,6 +56,11 @@ public class CodeGenerator { // .values("value", 1, 2) // .color("blue", "green") // .build(), + Template.create("host_key", "主机秘钥", "host") + .vue("asset", "host-key") + .enableCardView() + .enableDrawerForm() + .build() }; // jdbc 配置 - 使用配置文件 File yamlFile = new File("orion-ops-launch/src/main/resources/application-dev.yaml"); diff --git a/orion-ops-launch/src/main/java/com/orion/ops/launch/generator/engine/VelocityTemplateEngine.java b/orion-ops-launch/src/main/java/com/orion/ops/launch/generator/engine/VelocityTemplateEngine.java index f1158ba5..d156ea62 100644 --- a/orion-ops-launch/src/main/java/com/orion/ops/launch/generator/engine/VelocityTemplateEngine.java +++ b/orion-ops-launch/src/main/java/com/orion/ops/launch/generator/engine/VelocityTemplateEngine.java @@ -138,13 +138,13 @@ public class VelocityTemplateEngine extends AbstractTemplateEngine { @NotNull TableInfo tableInfo) { // 生成文件副本 List files = originCustomerFile.stream().map(s -> - new CustomFile.Builder() - .enableFileOverride() - .templatePath(s.getTemplatePath()) - .filePath(s.getFilePath()) - .fileName(s.getFileName()) - .packageName(s.getPackageName()) - .build()) + new CustomFile.Builder() + .enableFileOverride() + .templatePath(s.getTemplatePath()) + .filePath(s.getFilePath()) + .fileName(s.getFileName()) + .packageName(s.getPackageName()) + .build()) .collect(Collectors.toList()); // 获取 table Table table = tables.get(tableInfo.getName()); @@ -324,7 +324,7 @@ public class VelocityTemplateEngine extends AbstractTemplateEngine { .collect(Collectors.toList()); // 设置前端元数据 Table table = tables.get(tableInfo.getName()); - Map vueMeta = this.pickTableMeta(table, "enableDrawerForm", "enableRowSelection", "module", "feature"); + Map vueMeta = this.pickTableMeta(table, "module", "feature", "enableDrawerForm", "enableRowSelection", "enableCardView"); // 模块名称实体 vueMeta.put("moduleEntity", VariableStyles.SPINE.toBigHump(table.getModule())); // 模块名称实体 diff --git a/orion-ops-launch/src/main/resources/templates/orion-server-module-service-impl.java.vm b/orion-ops-launch/src/main/resources/templates/orion-server-module-service-impl.java.vm index f071d48d..b19412cc 100644 --- a/orion-ops-launch/src/main/resources/templates/orion-server-module-service-impl.java.vm +++ b/orion-ops-launch/src/main/resources/templates/orion-server-module-service-impl.java.vm @@ -270,7 +270,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} { #end .and(Strings.isNotEmpty(searchValue), c -> c #foreach($field in ${table.fields}) - .eq(${type}DO::get${field.capitalName}, searchValue) + .eq(${type}DO::get${field.capitalName}, searchValue)#if($foreach.hasNext).or()#end #end ); } diff --git a/orion-ops-launch/src/main/resources/templates/orion-sql-menu.sql.vm b/orion-ops-launch/src/main/resources/templates/orion-sql-menu.sql.vm index 05fb4fa6..cc2c6305 100644 --- a/orion-ops-launch/src/main/resources/templates/orion-sql-menu.sql.vm +++ b/orion-ops-launch/src/main/resources/templates/orion-sql-menu.sql.vm @@ -26,4 +26,5 @@ VALUES (@TMP_SUB_ID, '创建$table.comment', '${package.ModuleName}:${typeHyphen}:create', 3, 20), (@TMP_SUB_ID, '修改$table.comment', '${package.ModuleName}:${typeHyphen}:update', 3, 30), (@TMP_SUB_ID, '删除$table.comment', '${package.ModuleName}:${typeHyphen}:delete', 3, 40), - (@TMP_SUB_ID, '导出$table.comment', '${package.ModuleName}:${typeHyphen}:export', 3, 50); + (@TMP_SUB_ID, '导出$table.comment', '${package.ModuleName}:${typeHyphen}:export', 3, 50), + (@TMP_SUB_ID, '导入$table.comment', '${package.ModuleName}:${typeHyphen}:import', 3, 60); diff --git a/orion-ops-launch/src/main/resources/templates/orion-vue-views-components-card-list.vue.vm b/orion-ops-launch/src/main/resources/templates/orion-vue-views-components-card-list.vue.vm index e5ee33d7..5c2c0d13 100644 --- a/orion-ops-launch/src/main/resources/templates/orion-vue-views-components-card-list.vue.vm +++ b/orion-ops-launch/src/main/resources/templates/orion-vue-views-components-card-list.vue.vm @@ -1,5 +1,6 @@