diff --git a/README.md b/README.md index b16d9f5..090dfa3 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ |更新日期|更新内容| |-|-| +|20200517|1.代码重构!异常处理优化,Freemarker相关工具类优化,简化模板生成部分,通过template.json来配置需要生成的模板,不需要配置java文件。| |20200503|1.优化对特殊字符的处理,对于包含#和$等特殊字符的,在模板使用井和¥代替便可,escapeString方法会自动处理
2.优化mybatisplus实体类相关(感谢@chunchengmeigui的反馈) 3.修优化对所有类型的判断(感谢@cnlw的反馈) 4.移除swagger-entity,该功能已经包含在‘swagger-ui’的下拉选项中 5.升级hutool和lombok版本| |20200306|1.提交一套layuimini+mybatisplus的模板. 2.修复mybatisplus一些相关问题. | |20200206|1.新增历史记录功能,自动保存最近生成的对象 2.新增swagger开关选项和修复@Column带name参数(感谢@liuyu-struggle的建议) 3.去除mybatis模板中的方括号[]和修改模板里的类注释样式(感谢@gaohanghang的PR)| @@ -65,7 +66,7 @@ |20180913|修复字段没有描述以及类型为DATE型导致的问题.新增JPA的Controller模板.| |20180831|初始化项目.新增JPA系列Entity+Repository模板.| -# FieldName +# ClassInfo/TableInfo |字段名|说明| |-|-| |packageName|自定义的包名| @@ -77,6 +78,12 @@ |fieldName|字段名| |fieldComment|字段备注| +# how to add a new template +1. code-generator中找到对应分类,新增一个.ftl文件 +2. 根据类信息编写freemarker模板.ftl文件 +3. 修改template.json文件,新增模板信息 +4. index页面增加一个button +5. reload,test,complete diff --git a/codegenerator1.png b/codegenerator1.png index ad0fdbc..6d565e9 100644 Binary files a/codegenerator1.png and b/codegenerator1.png differ diff --git a/codegenerator2.png b/codegenerator2.png index 9e447a9..3cd1cc4 100644 Binary files a/codegenerator2.png and b/codegenerator2.png differ diff --git a/codegenerator3.png b/codegenerator3.png index 38fa897..ffbcfc5 100644 Binary files a/codegenerator3.png and b/codegenerator3.png differ diff --git a/codegenerator4.png b/codegenerator4.png index e1d23e4..12c363b 100644 Binary files a/codegenerator4.png and b/codegenerator4.png differ diff --git a/generator-web/src/main/java/com/softdev/system/generator/config/GlobalDefaultExceptionHandler.java b/generator-web/src/main/java/com/softdev/system/generator/config/GlobalDefaultExceptionHandler.java index 1ab4003..bf5d9f2 100644 --- a/generator-web/src/main/java/com/softdev/system/generator/config/GlobalDefaultExceptionHandler.java +++ b/generator-web/src/main/java/com/softdev/system/generator/config/GlobalDefaultExceptionHandler.java @@ -1,20 +1,20 @@ -package com.softdev.system.generator.config; - -import javax.servlet.http.HttpServletRequest; - -import com.softdev.system.generator.entity.ReturnT; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseBody; - -@ControllerAdvice -public class GlobalDefaultExceptionHandler { - - @ExceptionHandler(Exception.class) - @ResponseBody - public ReturnT defaultExceptionHandler(HttpServletRequest req,Exception e) { - e.printStackTrace(); - return new ReturnT<>(ReturnT.FAIL_CODE, e.getMessage()); - } - -} +package com.softdev.system.generator.config; + +import com.softdev.system.generator.entity.ReturnT; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.servlet.http.HttpServletRequest; + +@ControllerAdvice +public class GlobalDefaultExceptionHandler { + + @ExceptionHandler(Exception.class) + @ResponseBody + public ReturnT defaultExceptionHandler(HttpServletRequest req,Exception e) { + e.printStackTrace(); + return new ReturnT<>(ReturnT.FAIL_CODE, e.getMessage()); + } + +} diff --git a/generator-web/src/main/java/com/softdev/system/generator/controller/IndexController.java b/generator-web/src/main/java/com/softdev/system/generator/controller/IndexController.java index 1ad7c20..2b75849 100644 --- a/generator-web/src/main/java/com/softdev/system/generator/controller/IndexController.java +++ b/generator-web/src/main/java/com/softdev/system/generator/controller/IndexController.java @@ -1,15 +1,11 @@ package com.softdev.system.generator.controller; -import com.alibaba.fastjson.JSON; import com.softdev.system.generator.entity.ClassInfo; import com.softdev.system.generator.entity.ParamInfo; import com.softdev.system.generator.entity.ReturnT; import com.softdev.system.generator.service.GeneratorService; -import com.softdev.system.generator.util.CodeGenerateException; import com.softdev.system.generator.util.TableParseUtil; -import freemarker.template.TemplateException; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @@ -17,7 +13,6 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.ResponseBody; -import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -39,49 +34,39 @@ public class IndexController { @PostMapping("/genCode") @ResponseBody - public ReturnT> codeGenerate(@RequestBody ParamInfo paramInfo ) { + public ReturnT> codeGenerate(@RequestBody ParamInfo paramInfo ) throws Exception { - try { - - if (StringUtils.isBlank(paramInfo.getTableSql())) { - return new ReturnT<>(ReturnT.FAIL_CODE, "表结构信息不可为空"); - } - - // parse table - ClassInfo classInfo = null; - switch (paramInfo.getDataType()){ - //parse json - case "json":classInfo = TableParseUtil.processJsonToClassInfo(paramInfo);break; - //parse sql by regex - case "sql-regex":classInfo = TableParseUtil.processTableToClassInfoByRegex(paramInfo);break; - //default parse sql by java - default : classInfo = TableParseUtil.processTableIntoClassInfo(paramInfo);break; - } - - // process the param - Map params = new HashMap(8); - params.put("classInfo", classInfo); - params.put("tableName", classInfo==null?System.currentTimeMillis():classInfo.getTableName()); - params.put("authorName", paramInfo.getAuthorName()); - params.put("packageName", paramInfo.getPackageName()); - params.put("returnUtil", paramInfo.getReturnUtil()); - params.put("swagger", paramInfo.isSwagger()); - - //log the params - //log.info(JSON.toJSONString(paramInfo)); - - log.info("generator table:"+(classInfo==null?"":classInfo.getTableName()) - +",field size:"+((classInfo==null||classInfo.getFieldList()==null)?"":classInfo.getFieldList().size())); - - // generate the code 需要加新的模板请在里面改 - Map result = generatorService.getResultByParams(params); - - return new ReturnT<>(result); - } catch (IOException | TemplateException | CodeGenerateException e) { - log.error(e.getMessage(), e); - return new ReturnT<>(ReturnT.FAIL_CODE, e.getMessage()); + if (paramInfo.getTableSql().trim().length()<1) { + return new ReturnT<>(ReturnT.FAIL_CODE, "表结构信息不可为空"); } + //1.Parse Table Structure 表结构解析 + ClassInfo classInfo = null; + switch (paramInfo.getDataType()){ + //JSON模式:parse field from json string + case "json":classInfo = TableParseUtil.processJsonToClassInfo(paramInfo);break; + //正则表达式模式(非完善版本):parse sql by regex + case "sql-regex":classInfo = TableParseUtil.processTableToClassInfoByRegex(paramInfo);break; + //默认模式:default parse sql by java + default : classInfo = TableParseUtil.processTableIntoClassInfo(paramInfo);break; + } + + //2.Set the params 设置表格参数 + Map params = new HashMap(8); + params.put("classInfo", classInfo); + params.put("tableName", classInfo==null?System.currentTimeMillis():classInfo.getTableName()); + params.put("authorName", paramInfo.getAuthorName()); + params.put("packageName", paramInfo.getPackageName()); + params.put("returnUtil", paramInfo.getReturnUtil()); + params.put("swagger", paramInfo.isSwagger()); + + //log the generated table and filed size记录解析了什么表,有多少个字段 + log.info("generated table:" + classInfo.getTableName() + ",field size:" + (classInfo.getFieldList() == null ? "" : classInfo.getFieldList().size())); + + //3.generate the code by freemarker template and param . Freemarker根据参数和模板生成代码 + Map result = generatorService.getResultByParams(params); + + return new ReturnT<>(result); } } diff --git a/generator-web/src/main/java/com/softdev/system/generator/entity/ParamInfo.java b/generator-web/src/main/java/com/softdev/system/generator/entity/ParamInfo.java index cdf616a..1de1805 100644 --- a/generator-web/src/main/java/com/softdev/system/generator/entity/ParamInfo.java +++ b/generator-web/src/main/java/com/softdev/system/generator/entity/ParamInfo.java @@ -1,26 +1,26 @@ -package com.softdev.system.generator.entity; - -import lombok.Data; - -/** - * Post data - ParamInfo - * @author zhengkai.blog.csdn.net - */ -@Data -public class ParamInfo { - private String tableSql; - private String authorName; - private String packageName; - private String returnUtil; - private String nameCaseType; - private String tinyintTransType; - private String dataType; - private boolean swagger; - - @Data - public static class NAME_CASE_TYPE{ - public static String CAMEL_CASE="CamelCase"; - public static String UNDER_SCORE_CASE="UnderScoreCase"; - public static String UPPER_UNDER_SCORE_CASE="UpperUnderScoreCase"; - } -} +package com.softdev.system.generator.entity; + +import lombok.Data; + +/** + * Post data - ParamInfo + * @author zhengkai.blog.csdn.net + */ +@Data +public class ParamInfo { + private String tableSql; + private String authorName; + private String packageName; + private String returnUtil; + private String nameCaseType; + private String tinyintTransType; + private String dataType; + private boolean swagger; + + @Data + public static class NAME_CASE_TYPE{ + public static String CAMEL_CASE="CamelCase"; + public static String UNDER_SCORE_CASE="UnderScoreCase"; + public static String UPPER_UNDER_SCORE_CASE="UpperUnderScoreCase"; + } +} diff --git a/generator-web/src/main/java/com/softdev/system/generator/entity/TemplateConfig.java b/generator-web/src/main/java/com/softdev/system/generator/entity/TemplateConfig.java new file mode 100644 index 0000000..e5e43a5 --- /dev/null +++ b/generator-web/src/main/java/com/softdev/system/generator/entity/TemplateConfig.java @@ -0,0 +1,18 @@ +package com.softdev.system.generator.entity; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class TemplateConfig implements Serializable { + + public static final long serialVersionUID = 66L; + + Integer id; + String name; + String group; + String path; + String description; + +} diff --git a/generator-web/src/main/java/com/softdev/system/generator/service/GeneratorService.java b/generator-web/src/main/java/com/softdev/system/generator/service/GeneratorService.java index 85a424b..507196a 100644 --- a/generator-web/src/main/java/com/softdev/system/generator/service/GeneratorService.java +++ b/generator-web/src/main/java/com/softdev/system/generator/service/GeneratorService.java @@ -1,17 +1,17 @@ -package com.softdev.system.generator.service; - -import freemarker.template.TemplateException; -import org.springframework.stereotype.Service; - -import java.io.IOException; -import java.util.Map; - -/** - * GeneratorService - * @author zhengkai.blog.csdn.net - */ -public interface GeneratorService { - - public Map getResultByParams(Map params) throws IOException, TemplateException; - -} +package com.softdev.system.generator.service; + +import freemarker.template.TemplateException; +import org.springframework.stereotype.Service; + +import java.io.IOException; +import java.util.Map; + +/** + * GeneratorService + * @author zhengkai.blog.csdn.net + */ +public interface GeneratorService { + + public Map getResultByParams(Map params) throws IOException, TemplateException; + +} diff --git a/generator-web/src/main/java/com/softdev/system/generator/service/GeneratorServiceImpl.java b/generator-web/src/main/java/com/softdev/system/generator/service/GeneratorServiceImpl.java index b29dce4..233eb16 100644 --- a/generator-web/src/main/java/com/softdev/system/generator/service/GeneratorServiceImpl.java +++ b/generator-web/src/main/java/com/softdev/system/generator/service/GeneratorServiceImpl.java @@ -1,80 +1,62 @@ -package com.softdev.system.generator.service; - -import com.softdev.system.generator.util.FreemarkerTool; -import freemarker.template.TemplateException; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** - * GeneratorService - * @author zhengkai.blog.csdn.net - */ -@Slf4j -@Service -public class GeneratorServiceImpl implements GeneratorService { - - @Autowired - private FreemarkerTool freemarkerTool; - - @Override - public Map getResultByParams(Map params) throws IOException, TemplateException { - // result - Map result = new HashMap(32); - result.put("tableName",params.get("tableName")+""); - //UI - result.put("swagger-ui", freemarkerTool.processString("code-generator/ui/swagger-ui.ftl", params)); - result.put("element-ui", freemarkerTool.processString("code-generator/ui/element-ui.ftl", params)); - result.put("bootstrap-ui", freemarkerTool.processString("code-generator/ui/bootstrap-ui.ftl", params)); - result.put("layui-edit", freemarkerTool.processString("code-generator/ui/layui-edit.ftl", params)); - result.put("layui-list", freemarkerTool.processString("code-generator/ui/layui-list.ftl", params)); - //mybatis old - result.put("controller", freemarkerTool.processString("code-generator/mybatis/controller.ftl", params)); - result.put("service", freemarkerTool.processString("code-generator/mybatis/service.ftl", params)); - result.put("service_impl", freemarkerTool.processString("code-generator/mybatis/service_impl.ftl", params)); - result.put("mapper", freemarkerTool.processString("code-generator/mybatis/mapper.ftl", params)); - result.put("mybatis", freemarkerTool.processString("code-generator/mybatis/mybatis.ftl", params)); - result.put("model", freemarkerTool.processString("code-generator/mybatis/model.ftl", params)); - //jpa - result.put("entity", freemarkerTool.processString("code-generator/jpa/entity.ftl", params)); - result.put("repository", freemarkerTool.processString("code-generator/jpa/repository.ftl", params)); - result.put("jpacontroller", freemarkerTool.processString("code-generator/jpa/jpacontroller.ftl", params)); - //jdbc template - result.put("jtdao", freemarkerTool.processString("code-generator/jdbc-template/jtdao.ftl", params)); - result.put("jtdaoimpl", freemarkerTool.processString("code-generator/jdbc-template/jtdaoimpl.ftl", params)); - //beetsql - result.put("beetlmd", freemarkerTool.processString("code-generator/beetlsql/beetlmd.ftl", params)); - result.put("beetlentity", freemarkerTool.processString("code-generator/beetlsql/beetlentity.ftl", params)); - result.put("beetlcontroller", freemarkerTool.processString("code-generator/beetlsql/beetlcontroller.ftl", params)); - //mybatis plus - result.put("pluscontroller", freemarkerTool.processString("code-generator/mybatis-plus/pluscontroller.ftl", params)); - result.put("plusmapper", freemarkerTool.processString("code-generator/mybatis-plus/plusmapper.ftl", params)); - result.put("plusentity", freemarkerTool.processString("code-generator/mybatis-plus/plusentity.ftl", params)); - //util - result.put("util", freemarkerTool.processString("code-generator/util/util.ftl", params)); - result.put("json", freemarkerTool.processString("code-generator/util/json.ftl", params)); - result.put("xml", freemarkerTool.processString("code-generator/util/xml.ftl", params)); - //sql generate - result.put("select", freemarkerTool.processString("code-generator/sql/select.ftl", params)); - result.put("insert", freemarkerTool.processString("code-generator/sql/insert.ftl", params)); - result.put("update", freemarkerTool.processString("code-generator/sql/update.ftl", params)); - result.put("delete", freemarkerTool.processString("code-generator/sql/delete.ftl", params)); - - // 计算,生成代码行数 - /*int lineNum = 0; - for (Map.Entry item: result.entrySet()) { - if (item.getValue() != null) { - lineNum += StringUtils.countMatches(item.getValue(), "\n"); - } - } - log.info("生成代码行数:{}", lineNum);*/ - - //测试环境可自行开启 - //log.info("生成代码数据:{}", result); - return result; - } -} +package com.softdev.system.generator.service; + +import com.alibaba.fastjson.JSON; +import com.softdev.system.generator.entity.TemplateConfig; +import com.softdev.system.generator.util.FreemarkerUtil; +import freemarker.template.TemplateException; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * GeneratorService + * @author zhengkai.blog.csdn.net + */ +@Slf4j +@Service +public class GeneratorServiceImpl implements GeneratorService { + + @Autowired + private FreemarkerUtil freemarkerTool; + + String templateCpnfig=null; + /** + * 从项目中的JSON文件读取String + * @author zhengkai.blog.csdn.net + */ + public String getTemplateConfig() throws IOException { + templateCpnfig=null; + if(templateCpnfig!=null){ + }else{ + InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("template.json"); + templateCpnfig = new BufferedReader(new InputStreamReader(inputStream)) + .lines().collect(Collectors.joining(System.lineSeparator())); + inputStream.close(); + } + //log.info(JSON.toJSONString(templateCpnfig)); + return templateCpnfig; + } + /** + * 根据配置的Template模板进行遍历解析,得到生成好的String + * @author zhengkai.blog.csdn.net + */ + @Override + public Map getResultByParams(Map params) throws IOException, TemplateException { + Map result = new LinkedHashMap<>(32); + result.put("tableName",params.get("tableName")+""); + List templateConfigList = JSON.parseArray(getTemplateConfig(),TemplateConfig.class); + for (TemplateConfig item:templateConfigList){ + result.put(item.getName(), freemarkerTool.processString(item.getGroup()+"/"+item.getName()+".ftl", params)); + } + return result; + } +} diff --git a/generator-web/src/main/java/com/softdev/system/generator/util/FreemarkerTool.java b/generator-web/src/main/java/com/softdev/system/generator/util/FreemarkerTool.java deleted file mode 100644 index 7d12237..0000000 --- a/generator-web/src/main/java/com/softdev/system/generator/util/FreemarkerTool.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.softdev.system.generator.util; - -import freemarker.template.Configuration; -import freemarker.template.Template; -import freemarker.template.TemplateException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.io.IOException; -import java.io.StringWriter; -import java.util.Map; - -/** - * freemarker tool - * - * @author xuxueli 2018-05-02 19:56:00 - */ -@Component -public class FreemarkerTool { - - @Autowired - private Configuration configuration; - - /** - * process Template Into String - * - * @param template - * @param model - * @return - * @throws IOException - * @throws TemplateException - */ - public String processTemplateIntoString(Template template, Object model) - throws IOException, TemplateException { - - StringWriter result = new StringWriter(); - template.process(model, result); - return result.toString(); - } - /** - * 传入需要转义的字符串进行转义 - * 20200503 zhengkai.blog.csdn.net - * */ - public String escapeString(String originStr){ - return originStr.replaceAll("井","\\#").replaceAll("¥","\\$"); - } - /** - * process String - * - * @param templateName - * @param params - * @return - * @throws IOException - * @throws TemplateException - */ - public String processString(String templateName, Map params) - throws IOException, TemplateException { - //获取对应的模板 - Template template = configuration.getTemplate(templateName); - //处理为template并进行转义 - String htmlText = escapeString(processTemplateIntoString(template, params)); - return htmlText; - } - - -} diff --git a/generator-web/src/main/java/com/softdev/system/generator/util/FreemarkerUtil.java b/generator-web/src/main/java/com/softdev/system/generator/util/FreemarkerUtil.java index d281a1e..33a56e7 100644 --- a/generator-web/src/main/java/com/softdev/system/generator/util/FreemarkerUtil.java +++ b/generator-web/src/main/java/com/softdev/system/generator/util/FreemarkerUtil.java @@ -5,6 +5,8 @@ import freemarker.template.Template; import freemarker.template.TemplateException; import freemarker.template.TemplateExceptionHandler; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; import java.io.File; import java.io.IOException; @@ -18,8 +20,21 @@ import java.util.Map; * @author xuxueli 2018-05-02 19:56:00 */ @Slf4j +@Component public class FreemarkerUtil { + + @Autowired + private Configuration configuration; + + /** + * 传入需要转义的字符串进行转义 + * 20200503 zhengkai.blog.csdn.net + * */ + public String escapeString(String originStr){ + return originStr.replaceAll("井","\\#").replaceAll("¥","\\$"); + } + /** * freemarker config */ @@ -32,7 +47,7 @@ public class FreemarkerUtil { } try { - freemarkerConfig.setDirectoryForTemplateLoading(new File(templatePath, "templates/xxl-code-generator")); + freemarkerConfig.setDirectoryForTemplateLoading(new File(templatePath, "templates/code-generator")); freemarkerConfig.setNumberFormat("#"); freemarkerConfig.setClassicCompatible(true); freemarkerConfig.setDefaultEncoding("UTF-8"); diff --git a/generator-web/src/main/java/com/softdev/system/generator/util/TableParseUtil.java b/generator-web/src/main/java/com/softdev/system/generator/util/TableParseUtil.java index 15b1233..9c76ba8 100644 --- a/generator-web/src/main/java/com/softdev/system/generator/util/TableParseUtil.java +++ b/generator-web/src/main/java/com/softdev/system/generator/util/TableParseUtil.java @@ -17,13 +17,13 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** + * 表格解析Util * @author zhengkai.blog.csdn.net */ public class TableParseUtil { /** - * 解析建表SQL生成代码(model-dao-xml) - * + * 解析DDL SQL生成类信息 * @param paramInfo * @return */ @@ -35,7 +35,7 @@ public class TableParseUtil { String tinyintTransType=paramInfo.getTinyintTransType(); if (tableSql==null || tableSql.trim().length()==0) { - throw new CodeGenerateException("Table structure can not be empty."); + throw new CodeGenerateException("Table structure can not be empty. 表结构不能为空。"); } //deal with special character tableSql = tableSql.trim().replaceAll("'","`").replaceAll("\"","`").replaceAll(",",",").toLowerCase(); @@ -48,7 +48,7 @@ public class TableParseUtil { } else if (tableSql.contains("table") && tableSql.contains("(")) { tableName = tableSql.substring(tableSql.indexOf("table")+5, tableSql.indexOf("(")); } else { - throw new CodeGenerateException("Table structure anomaly."); + throw new CodeGenerateException("Table structure incorrect.表结构不正确。"); } //新增处理create table if not exists members情况 @@ -307,7 +307,7 @@ public class TableParseUtil { return codeJavaInfo; } /** - * parse JSON + * 解析JSON生成类信息 * @param paramInfo * @return */ diff --git a/generator-web/src/main/resources/static/version.json b/generator-web/src/main/resources/static/version.json index 4316322..a4f3b0c 100644 --- a/generator-web/src/main/resources/static/version.json +++ b/generator-web/src/main/resources/static/version.json @@ -1 +1 @@ -{"version": "20200306"} \ No newline at end of file +{"version": "20200517"} \ No newline at end of file diff --git a/generator-web/src/main/resources/template.json b/generator-web/src/main/resources/template.json new file mode 100644 index 0000000..24741b9 --- /dev/null +++ b/generator-web/src/main/resources/template.json @@ -0,0 +1,176 @@ +[ + { + "id": "10", + "name": "swagger-ui", + "group": "ui", + "description": "swagger-ui" + }, + { + "id": "11", + "name": "element-ui", + "group": "ui", + "description": "element-ui" + }, + { + "id": "12", + "name": "bootstrap-ui", + "group": "ui", + "description": "bootstrap-ui" + }, + { + "id": "13", + "name": "layui-edit", + "group": "ui", + "description": "layui-edit" + }, + { + "id": "14", + "name": "layui-list", + "group": "ui", + "description": "layui-list" + }, + { + "id": "20", + "name": "controller", + "group": "mybatis", + "description": "controller" + }, + { + "id": "21", + "name": "service", + "group": "mybatis", + "description": "service" + }, + { + "id": "22", + "name": "service_impl", + "group": "mybatis", + "description": "service_impl" + }, + { + "id": "23", + "name": "mapper", + "group": "mybatis", + "description": "mapper" + }, + { + "id": "24", + "name": "mybatis", + "group": "mybatis", + "description": "mybatis" + }, + { + "id": "25", + "name": "model", + "group": "mybatis", + "description": "model" + }, + { + "id": "30", + "name": "entity", + "group": "jpa", + "description": "entity" + }, + { + "id": "31", + "name": "repository", + "group": "jpa", + "description": "repository" + }, + { + "id": "32", + "name": "jpacontroller", + "group": "jpa", + "description": "jpacontroller" + }, + { + "id": "40", + "name": "jtdao", + "group": "jdbc-template", + "description": "jtdao" + }, + { + "id": "41", + "name": "jtdaoimpl", + "group": "jdbc-template", + "description": "jtdaoimpl" + }, + { + "id": "50", + "name": "beetlmd", + "group": "beetlsql", + "description": "beetlmd" + }, + { + "id": "51", + "name": "beetlentity", + "group": "beetlsql", + "description": "beetlentity" + }, + { + "id": "52", + "name": "beetlcontroller", + "group": "beetlsql", + "description": "beetlcontroller" + }, + { + "id": "60", + "name": "pluscontroller", + "group": "mybatis-plus", + "description": "pluscontroller" + }, + { + "id": "61", + "name": "plusmapper", + "group": "mybatis-plus", + "description": "plusmapper" + }, + { + "id": "62", + "name": "plusentity", + "group": "mybatis-plus", + "description": "plusentity" + }, + { + "id": "70", + "name": "util", + "group": "util", + "description": "util" + }, + { + "id": "71", + "name": "json", + "group": "util", + "description": "json" + }, + { + "id": "72", + "name": "xml", + "group": "util", + "description": "xml" + }, + { + "id": "80", + "name": "select", + "group": "sql", + "description": "select" + }, + { + "id": "81", + "name": "insert", + "group": "sql", + "description": "insert" + }, + { + "id": "82", + "name": "update", + "group": "sql", + "description": "update" + }, + { + "id": "83", + "name": "delete", + "group": "sql", + "description": "delete" + } +] \ No newline at end of file diff --git a/generator-web/src/main/resources/templates/index.ftl b/generator-web/src/main/resources/templates/index.ftl index 7eecedc..77e7289 100644 --- a/generator-web/src/main/resources/templates/index.ftl +++ b/generator-web/src/main/resources/templates/index.ftl @@ -206,7 +206,7 @@ BeJSON在线工具站 diff --git a/pom.xml b/pom.xml index de80f1b..0c7f77c 100644 --- a/pom.xml +++ b/pom.xml @@ -74,14 +74,6 @@ 1.2.8.RELEASE --> - - - - cn.hutool - hutool-all - 5.3.2 - - org.projectlombok @@ -89,41 +81,12 @@ 1.18.12 - - - org.apache.commons - commons-lang3 - 3.8 - - org.springframework.boot spring-boot-starter-freemarker - - - @@ -186,7 +149,6 @@ org.springframework.boot spring-boot-maven-plugin - 2.0.4.RELEASE