| | |
| | | * @return 模板列表 |
| | | */ |
| | | public static List<String> getTemplateList(String tplCategory) { |
| | | List<String> templates = new ArrayList<String>(); |
| | | List<String> templates = new ArrayList<>(); |
| | | templates.add("vm/java/domain.java.vm"); |
| | | templates.add("vm/java/vo.java.vm"); |
| | | templates.add("vm/java/bo.java.vm"); |
| | |
| | | } else { |
| | | templates.add("vm/sql/sql.vm"); |
| | | } |
| | | templates.add("vm/js/api.js.vm"); |
| | | templates.add("vm/ts/api.ts.vm"); |
| | | templates.add("vm/ts/types.ts.vm"); |
| | | if (GenConstants.TPL_CRUD.equals(tplCategory)) { |
| | | templates.add("vm/vue/index.vue.vm"); |
| | | } else if (GenConstants.TPL_TREE.equals(tplCategory)) { |
| | |
| | | fileName = StringUtils.format("{}/{}Mapper.xml", mybatisPath, className); |
| | | } else if (template.contains("sql.vm")) { |
| | | fileName = businessName + "Menu.sql"; |
| | | } else if (template.contains("api.js.vm")) { |
| | | fileName = StringUtils.format("{}/api/{}/{}.js", vuePath, moduleName, businessName); |
| | | } else if (template.contains("api.ts.vm")) { |
| | | fileName = StringUtils.format("{}/api/{}/{}/index.ts", vuePath, moduleName, businessName); |
| | | } else if (template.contains("types.ts.vm")) { |
| | | fileName = StringUtils.format("{}/api/{}/{}/types.ts", vuePath, moduleName, businessName); |
| | | } else if (template.contains("index.vue.vm")) { |
| | | fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); |
| | | } else if (template.contains("index-tree.vue.vm")) { |
| | |
| | | */ |
| | | public static HashSet<String> getImportList(GenTable genTable) { |
| | | List<GenTableColumn> columns = genTable.getColumns(); |
| | | HashSet<String> importList = new HashSet<String>(); |
| | | HashSet<String> importList = new HashSet<>(); |
| | | for (GenTableColumn column : columns) { |
| | | if (!column.isSuperColumn() && GenConstants.TYPE_DATE.equals(column.getJavaType())) { |
| | | importList.add("java.util.Date"); |
| | | importList.add("com.fasterxml.jackson.annotation.JsonFormat"); |
| | | } else if (!column.isSuperColumn() && GenConstants.TYPE_BIGDECIMAL.equals(column.getJavaType())) { |
| | | importList.add("java.math.BigDecimal"); |
| | | } else if (!column.isSuperColumn() && "imageUpload".equals(column.getHtmlType())) { |
| | | importList.add("org.dromara.common.translation.annotation.Translation"); |
| | | importList.add("org.dromara.common.translation.constant.TransConstant"); |
| | | } |
| | | } |
| | | return importList; |