diff --git a/README.md b/README.md index bcd81e4e..58f1f4dd 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ SpringBootCodeGenerator ---- -基于SpringBoot2+Freemarker的代码生成器,用DDL SQL语句生成JPA/JdbcTemplate/Mybatis/BeetlSQL相关代码,支持mysql/oracle/pgsql等三大数据库。以释放双手为目的,各大模板也在陆续补充和优化。欢迎大家提交模板和交流想法! +基于SpringBoot2+Freemarker的代码生成器,用DDL SQL语句生成JPA/JdbcTemplate/Mybatis/BeetlSQL相关代码,支持mysql/oracle/pgsql等三大数据库。以释放双手为目的,各大模板也在陆续补充和优化。欢迎大家Issue提交模板和交流想法,也欢迎提交PullRequest!

-另外,感谢bejson三叔将他部署在 http://java.bejson.com/generator 上,目前是besjon专供工具。 +另外,感谢bejson三叔将他部署在 http://java.bejson.com/generator 上,目前是besjon专供工具(线上版本不一定是最新的,会有延迟,请谅解,谢谢)。

@@ -16,6 +16,11 @@ SpringBootCodeGenerator + + + + + @@ -40,10 +45,13 @@ SpringBootCodeGenerator
访问路径 http://127.0.0.1:1234/generator
CSDN博客 http://blog.csdn.net/moshowgame
更新日期 更新内容
20190910-2优化以及更新Maven依赖,减少打包体积。
20190910-11.修复mapper接口load方法,但是xml中方法不匹配问题 2.移除mapper中CRUD时的@param 注解,会影响xml的解析(感谢@caojiantao的反馈)。3.优化MyBatis的xml文件对Oracle的支持。(感谢@wylove1992的反馈) 4.新增对boolean的处理(感谢@violinxsc的反馈)以及优化tinyint类型生成boolean类型问题(感谢@hahaYhui的反馈)
20190909添加是否下划线转换为驼峰的选择(感谢@youngking28 的pull request)。
201905181.优化注释 2.修改 mybatis模板中 controller注解 3.修改 mybatis模板中 dao文件使用为 mapper文件 4.修改 mybatis模板中 service实现类中的一个 bug 5.修改 index.ftl文件中 mybatis模板的 dao -> mapper(感谢@unqin的pull request)
20190511优化mybatis模块的dao和xml模板,修改dao接口注解为@Repository,所有dao参数改为包装类,删除update语句最后的UpdateTime = NOW(),修改dao接口文件的方法注释使其更符合javaDoc的标准,修改insert语句增加插入行主键的返回,修改load的方法名为selectByPrimaryKey,修改xml的update语句新增动态if判空,修改xml的insert语句新增动态插入判空,更符合mybatisGenerator标准(感谢@Archer-Wen的贡献 )。
20190429新增返回封装工具类设置,优化对oracle注释comment on column的支持(感谢@liukex反馈),优化对普通和特殊storage关键字的判断(感谢@AhHeadFloating的反馈 )。
20190211提交gitignore,解决StringUtils.lowerCaseFirst潜在的NPE异常,校验修改为@RequestParam参数校验,lombok之@Data和@Slf4j优化,fix JdbcDAO模板类名显示为中文问题,WebMvcConfig整合MessageConverter,模板代码分类(感谢@liutf和@tfgzs的pull request)。
20190210实体生成规则切换为包装类型,不再采用基本数据类型,为实体类生成添加显示的默认构造方法(感谢@h2so的pull request)。
- + + + + - +
类名 说明
字段名 说明
packageName 自定义的包名
authorName 自定义的作者名
returnUtil 自定义的返回Util
tableName sql中的表名
className java类名
classComment java类备注
classComment sql表备注/java类备注
fieldName 字段名
fieldComment 字段备注
@@ -52,4 +60,5 @@ SpringBootCodeGenerator - \ No newline at end of file + +
diff --git a/SpringBootCodeGenerator.iml b/SpringBootCodeGenerator.iml deleted file mode 100644 index e67ee345..00000000 --- a/SpringBootCodeGenerator.iml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/codegenerator1.png b/codegenerator1.png index 9a62348c..da53f3f2 100644 Binary files a/codegenerator1.png and b/codegenerator1.png differ diff --git a/codegenerator3.png b/codegenerator3.png index 82f88f0e..4988787c 100644 Binary files a/codegenerator3.png and b/codegenerator3.png differ diff --git a/donate.jpg b/donate.jpg new file mode 100644 index 00000000..d8202fce Binary files /dev/null and b/donate.jpg differ diff --git a/generator-web/generator-web.iml b/generator-web/generator-web.iml deleted file mode 100644 index 6b33a9b7..00000000 --- a/generator-web/generator-web.iml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file 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 acd7e275..34810e53 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 @@ -39,7 +39,8 @@ public ReturnT> codeGenerate(String tableSql, //2019-2-10 liutf 修改为@RequestParam参数校验 @RequestParam(required = false, defaultValue = "大狼狗") String authorName, @RequestParam(required = false, defaultValue = "com.softdev.system")String packageName, - @RequestParam(required = false, defaultValue = "ApiReturnUtil")String returnUtil + @RequestParam(required = false, defaultValue = "ApiReturnUtil")String returnUtil, + @RequestParam(required = false, defaultValue = "true")boolean isUnderLineToCamelCase ) { @@ -50,7 +51,7 @@ public ReturnT> codeGenerate(String tableSql, } // parse table - ClassInfo classInfo = CodeGeneratorTool.processTableIntoClassInfo(tableSql); + ClassInfo classInfo = CodeGeneratorTool.processTableIntoClassInfo(tableSql, isUnderLineToCamelCase); // code genarete Map params = new HashMap(); @@ -70,7 +71,7 @@ public ReturnT> codeGenerate(String tableSql, 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("dao", freemarkerTool.processString("code-generator/mybatis/dao.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 diff --git a/generator-web/src/main/java/com/softdev/system/generator/util/CodeGeneratorTool.java b/generator-web/src/main/java/com/softdev/system/generator/util/CodeGeneratorTool.java index 2f37d2be..3ef76f2b 100644 --- a/generator-web/src/main/java/com/softdev/system/generator/util/CodeGeneratorTool.java +++ b/generator-web/src/main/java/com/softdev/system/generator/util/CodeGeneratorTool.java @@ -19,8 +19,8 @@ public class CodeGeneratorTool { * @param tableSql * @return */ - public static ClassInfo processTableIntoClassInfo(String tableSql) throws IOException { - return TableParseUtil.processTableIntoClassInfo(tableSql); + public static ClassInfo processTableIntoClassInfo(String tableSql, boolean isUnderLineToCamelCase) throws IOException { + return TableParseUtil.processTableIntoClassInfo(tableSql, isUnderLineToCamelCase); } } \ No newline at end of file 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 6488897b..b796a704 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 @@ -24,7 +24,7 @@ public class TableParseUtil { * @param tableSql * @return */ - public static ClassInfo processTableIntoClassInfo(String tableSql) throws IOException { + public static ClassInfo processTableIntoClassInfo(String tableSql, boolean isUnderLineToCamelCase) throws IOException { if (tableSql==null || tableSql.trim().length()==0) { throw new CodeGenerateException("Table structure can not be empty."); } @@ -159,9 +159,15 @@ public static ClassInfo processTableIntoClassInfo(String tableSql) throws IOExce columnName = columnLine.substring(0, columnLine.indexOf(" ")); // field Name - String fieldName = StringUtils.lowerCaseFirst(StringUtils.underlineToCamelCase(columnName)); - if (fieldName.contains("_")) { - fieldName = fieldName.replaceAll("_", ""); +// 2019-09-08 yj 添加是否下划线转换为驼峰的判断 + String fieldName; + if(isUnderLineToCamelCase){ + fieldName = StringUtils.lowerCaseFirst(StringUtils.underlineToCamelCase(columnName)); + if (fieldName.contains("_")) { + fieldName = fieldName.replaceAll("_", ""); + } + }else { + fieldName = StringUtils.lowerCaseFirst(columnName); } // field class @@ -170,7 +176,7 @@ public static ClassInfo processTableIntoClassInfo(String tableSql) throws IOExce String fieldClass = Object.class.getSimpleName(); //2018-9-16 zhengk 补充char/clob/blob/json等类型,如果类型未知,默认为String //2018-11-22 lshz0088 处理字段类型的时候,不严谨columnLine.contains(" int") 类似这种的,可在前后适当加一些空格之类的加以区分,否则当我的字段包含这些字符的时候,产生类型判断问题。 - if (columnLine.contains(" int") || columnLine.contains("tinyint") || columnLine.contains("smallint")) { + if (columnLine.contains(" int") || columnLine.contains("smallint")) { fieldClass = Integer.class.getSimpleName(); } else if (columnLine.contains("bigint")) { fieldClass = Long.class.getSimpleName(); @@ -215,7 +221,10 @@ public static ClassInfo processTableIntoClassInfo(String tableSql) throws IOExce }else{ fieldClass = BigDecimal.class.getSimpleName(); } - }else { + } else if (columnLine.contains("boolean")|| columnLine.contains("tinyint") ) { + //20190910 MOSHOW.K.ZHENG 新增对boolean的处理(感谢@violinxsc的反馈)以及修复tinyint类型字段无法生成boolean类型问题(感谢@hahaYhui的反馈) + fieldClass = Boolean.class.getSimpleName(); + } else { fieldClass = String.class.getSimpleName(); } diff --git a/generator-web/src/main/resources/templates/code-generator/mybatis/controller.ftl b/generator-web/src/main/resources/templates/code-generator/mybatis/controller.ftl index d8b52a22..400aa888 100644 --- a/generator-web/src/main/resources/templates/code-generator/mybatis/controller.ftl +++ b/generator-web/src/main/resources/templates/code-generator/mybatis/controller.ftl @@ -10,55 +10,62 @@ import java.util.Map; /** * ${classInfo.classComment} -* @author ${authorName} ${.now?string('yyyy-MM-dd')} +* @author ${authorName} +* @date ${.now?string('yyyy/MM/dd')} */ -@Controller +@RestController +@RequestMapping(value = "/${classInfo.className}") public class ${classInfo.className}Controller { @Resource private ${classInfo.className}Service ${classInfo.className?uncap_first}Service; /** - * 新增 - */ + * [新增] + * @author ${authorName} + * @date ${.now?string('yyyy/MM/dd')} + **/ @RequestMapping("/insert") - @ResponseBody public ReturnT insert(${classInfo.className} ${classInfo.className?uncap_first}){ return ${classInfo.className?uncap_first}Service.insert(${classInfo.className?uncap_first}); } /** - * 删除 - */ + * [刪除] + * @author ${authorName} + * @date ${.now?string('yyyy/MM/dd')} + **/ @RequestMapping("/delete") - @ResponseBody public ReturnT delete(int id){ return ${classInfo.className?uncap_first}Service.delete(id); } /** - * 更新 - */ + * [更新] + * @author ${authorName} + * @date ${.now?string('yyyy/MM/dd')} + **/ @RequestMapping("/update") - @ResponseBody public ReturnT update(${classInfo.className} ${classInfo.className?uncap_first}){ return ${classInfo.className?uncap_first}Service.update(${classInfo.className?uncap_first}); } /** - * Load查询 - */ + * [查詢] 根據主鍵 id 查詢 + * @author ${authorName} + * @date ${.now?string('yyyy/MM/dd')} + **/ @RequestMapping("/load") - @ResponseBody public ReturnT load(int id){ return ${classInfo.className?uncap_first}Service.load(id); } /** - * 分页查询 - */ + * [查詢] 分頁查詢 + * @author ${authorName} + * @date ${.now?string('yyyy/MM/dd')} + **/ @RequestMapping("/pageList") - @ResponseBody public Map pageList(@RequestParam(required = false, defaultValue = "0") int offset, @RequestParam(required = false, defaultValue = "10") int pagesize) { return ${classInfo.className?uncap_first}Service.pageList(offset, pagesize); diff --git a/generator-web/src/main/resources/templates/code-generator/mybatis/dao.ftl b/generator-web/src/main/resources/templates/code-generator/mybatis/dao.ftl deleted file mode 100644 index 210c9fcb..00000000 --- a/generator-web/src/main/resources/templates/code-generator/mybatis/dao.ftl +++ /dev/null @@ -1,45 +0,0 @@ -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** -* ${classInfo.classComment} -* @author ${authorName} ${.now?string('yyyy-MM-dd')} -*/ -@Component -public interface ${classInfo.className}Dao { - - /** - * 新增 - */ - public int insert(@Param("${classInfo.className?uncap_first}") ${classInfo.className} ${classInfo.className?uncap_first}); - - /** - * 删除 - */ - public int delete(@Param("id") int id); - - /** - * 更新 - */ - public int update(@Param("${classInfo.className?uncap_first}") ${classInfo.className} ${classInfo.className?uncap_first}); - - /** - * Load查询 - */ - public ${classInfo.className} load(@Param("id") int id); - - /** - * 分页查询Data - */ - public List<${classInfo.className}> pageList(@Param("offset") int offset, - @Param("pagesize") int pagesize); - - /** - * 分页查询Count - */ - public int pageListCount(@Param("offset") int offset, - @Param("pagesize") int pagesize); - -} diff --git a/generator-web/src/main/resources/templates/code-generator/mybatis/mapper.ftl b/generator-web/src/main/resources/templates/code-generator/mybatis/mapper.ftl new file mode 100644 index 00000000..9e0d060b --- /dev/null +++ b/generator-web/src/main/resources/templates/code-generator/mybatis/mapper.ftl @@ -0,0 +1,57 @@ +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; +import java.util.List; + +/** +* ${classInfo.classComment} +* @author ${authorName} +* @date ${.now?string('yyyy/MM/dd')} +*/ +@Mapper +@Repository +public interface ${classInfo.className}Mapper { + + /** + * [新增] + * @author ${authorName} + * @date ${.now?string('yyyy/MM/dd')} + **/ + int insert(${classInfo.className} ${classInfo.className?uncap_first}); + + /** + * [刪除] + * @author ${authorName} + * @date ${.now?string('yyyy/MM/dd')} + **/ + int delete(int id); + + /** + * [更新] + * @author ${authorName} + * @date ${.now?string('yyyy/MM/dd')} + **/ + int update(${classInfo.className} ${classInfo.className?uncap_first}); + + /** + * [查詢] 根據主鍵 id 查詢 + * @author ${authorName} + * @date ${.now?string('yyyy/MM/dd')} + **/ + ${classInfo.className} load(int id); + + /** + * [查詢] 分頁查詢 + * @author ${authorName} + * @date ${.now?string('yyyy/MM/dd')} + **/ + List<${classInfo.className}> pageList(int offset,int pagesize); + + /** + * [查詢] 分頁查詢 count + * @author ${authorName} + * @date ${.now?string('yyyy/MM/dd')} + **/ + int pageListCount(int offset,int pagesize); + +} diff --git a/generator-web/src/main/resources/templates/code-generator/mybatis/mybatis.ftl b/generator-web/src/main/resources/templates/code-generator/mybatis/mybatis.ftl index 0c00677d..c3312e05 100644 --- a/generator-web/src/main/resources/templates/code-generator/mybatis/mybatis.ftl +++ b/generator-web/src/main/resources/templates/code-generator/mybatis/mybatis.ftl @@ -1,82 +1,89 @@ - - - - - - <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> - <#list classInfo.fieldList as fieldItem > - - - - - - - <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> - <#list classInfo.fieldList as fieldItem > - `${fieldItem.columnName}`<#if fieldItem_has_next>, - - - - - - INSERT INTO ${classInfo.tableName} ( - <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> - <#list classInfo.fieldList as fieldItem > - <#if fieldItem.columnName != "Id" > - `${fieldItem.columnName}`<#if fieldItem_has_next>, - - - - ) - VALUES( - <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> - <#list classInfo.fieldList as fieldItem > - <#if fieldItem.columnName != "Id" > - <#if fieldItem.columnName="addtime" || fieldItem.columnName="updatetime" > - NOW()<#if fieldItem_has_next>, - <#else> - ${r"#{"}${classInfo.className?uncap_first}.${fieldItem.fieldName}${r"}"}<#if fieldItem_has_next>, - - - - - ) - - - - DELETE FROM ${classInfo.tableName} - WHERE `id` = ${r"#{id}"} - - - - UPDATE ${classInfo.tableName} - SET - <#list classInfo.fieldList as fieldItem > - <#if fieldItem.columnName != "Id" && fieldItem.columnName != "AddTime" && fieldItem.columnName != "UpdateTime" > - ${fieldItem.columnName} = ${r"#{"}${classInfo.className?uncap_first}.${fieldItem.fieldName}${r"}"}, - - - UpdateTime = NOW() - WHERE `id` = ${r"#{"}${classInfo.className?uncap_first}.id${r"}"} - - - - - - - - - - + + + + + + <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> + <#list classInfo.fieldList as fieldItem > + + + + + + + <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> + <#list classInfo.fieldList as fieldItem > + ${fieldItem.columnName}<#if fieldItem_has_next>, + + + + + + INSERT INTO ${classInfo.tableName} + + <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> + <#list classInfo.fieldList as fieldItem > + <#if fieldItem.columnName != "id" > + ${r""} + ${fieldItem.columnName}<#if fieldItem_has_next>, + ${r""} + + + + + + <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> + <#list classInfo.fieldList as fieldItem > + <#if fieldItem.columnName != "id" > + <#--<#if fieldItem.columnName="addtime" || fieldItem.columnName="updatetime" > + ${r""} + NOW()<#if fieldItem_has_next>, + ${r""} + <#else>--> + ${r""} + ${r"#{"}${fieldItem.fieldName}${r"}"}<#if fieldItem_has_next>, + ${r""} + <#----> + + + + + + + + DELETE FROM ${classInfo.tableName} + WHERE id = ${r"#{id}"} + + + + UPDATE ${classInfo.tableName} + + <#list classInfo.fieldList as fieldItem > + <#if fieldItem.columnName != "id" && fieldItem.columnName != "AddTime" && fieldItem.columnName != "UpdateTime" > + ${r""}${fieldItem.columnName} = ${r"#{"}${fieldItem.fieldName}${r"}"}<#if fieldItem_has_next>,${r""} + + + + WHERE id = ${r"#{"}id${r"}"} + + + + + + + + + + \ No newline at end of file diff --git a/generator-web/src/main/resources/templates/code-generator/mybatis/service.ftl b/generator-web/src/main/resources/templates/code-generator/mybatis/service.ftl index 3de47531..11718e01 100644 --- a/generator-web/src/main/resources/templates/code-generator/mybatis/service.ftl +++ b/generator-web/src/main/resources/templates/code-generator/mybatis/service.ftl @@ -2,7 +2,8 @@ import java.util.Map; /** * ${classInfo.classComment} -* @author ${authorName} ${.now?string('yyyy-MM-dd')} +* @author ${authorName} +* @date ${.now?string('yyyy/MM/dd')} */ public interface ${classInfo.className}Service { @@ -22,7 +23,7 @@ public interface ${classInfo.className}Service { public ReturnT update(${classInfo.className} ${classInfo.className?uncap_first}); /** - * Load查询 + * 根據主鍵 id 查詢 */ public ${classInfo.className} load(int id); diff --git a/generator-web/src/main/resources/templates/code-generator/mybatis/service_impl.ftl b/generator-web/src/main/resources/templates/code-generator/mybatis/service_impl.ftl index 8bb37a65..a5d6e89d 100644 --- a/generator-web/src/main/resources/templates/code-generator/mybatis/service_impl.ftl +++ b/generator-web/src/main/resources/templates/code-generator/mybatis/service_impl.ftl @@ -8,17 +8,16 @@ import java.util.Map; /** * ${classInfo.classComment} -* @author ${authorName} ${.now?string('yyyy-MM-dd')} +* @author ${authorName} +* @date ${.now?string('yyyy/MM/dd')} */ @Service public class ${classInfo.className}ServiceImpl implements ${classInfo.className}Service { @Resource - private ${classInfo.className}Dao ${classInfo.className?uncap_first}Dao; + private ${classInfo.className}Mapper ${classInfo.className?uncap_first}Mapper; + - /** - * 新增 - */ @Override public ReturnT insert(${classInfo.className} ${classInfo.className?uncap_first}) { @@ -27,49 +26,41 @@ public class ${classInfo.className}ServiceImpl implements ${classInfo.className} return new ReturnT(ReturnT.FAIL_CODE, "必要参数缺失"); } - ${classInfo.className?uncap_first}Dao.insert(${classInfo.className?uncap_first}); + ${classInfo.className?uncap_first}Mapper.insert(${classInfo.className?uncap_first}); return ReturnT.SUCCESS; } - /** - * 删除 - */ + @Override public ReturnT delete(int id) { - int ret = ${classInfo.className?uncap_first}Dao.delete(id); + int ret = ${classInfo.className?uncap_first}Mapper.delete(id); return ret>0?ReturnT.SUCCESS:ReturnT.FAIL; } - /** - * 更新 - */ + @Override public ReturnT update(${classInfo.className} ${classInfo.className?uncap_first}) { - int ret = ${classInfo.className?uncap_first}Dao.update(${classInfo.className?uncap_first}); + int ret = ${classInfo.className?uncap_first}Mapper.update(${classInfo.className?uncap_first}); return ret>0?ReturnT.SUCCESS:ReturnT.FAIL; } - /** - * Load查询 - */ + @Override public ${classInfo.className} load(int id) { - return ${classInfo.className?uncap_first}Dao.load(id); + return ${classInfo.className?uncap_first}Mapper.load(id); } - /** - * 分页查询 - */ + @Override public Map pageList(int offset, int pagesize) { - List<${classInfo.className}> pageList = ${classInfo.className?uncap_first}Dao.pageList(offset, pagesize); - int totalCount = ${classInfo.className?uncap_first}Dao.pageListCount(offset, pagesize); + List<${classInfo.className}> pageList = ${classInfo.className?uncap_first}Mapper.pageList(offset, pagesize); + int totalCount = ${classInfo.className?uncap_first}Mapper.pageListCount(offset, pagesize); // result Map result = new HashMap(); - maps.put("pageList", pageList); - maps.put("totalCount", totalCount); + result.put("pageList", pageList); + result.put("totalCount", totalCount); return result; } diff --git a/generator-web/src/main/resources/templates/index.ftl b/generator-web/src/main/resources/templates/index.ftl index 5ca66f99..3ee68877 100644 --- a/generator-web/src/main/resources/templates/index.ftl +++ b/generator-web/src/main/resources/templates/index.ftl @@ -52,7 +52,8 @@ "tableSql": tableSql, "packageName":$("#packageName").val(), "returnUtil":$("#returnUtil").val(), - "authorName":$("#authorName").val() + "authorName":$("#authorName").val(), + "isUnderLineToCamelCase":$("#isUnderLineToCamelCase").val() }, dataType: "json", success: function (data) { @@ -85,7 +86,20 @@ genCodeArea.setSize('auto', 'auto'); } }); - + function donate(){ + layer.open({ + type: 1, + area : ['712px' , '480px'], + shadeClose: true, //点击遮罩关闭 + content: '' + }); + } + $('#donate1').on('click', function(){ + donate(); + }); + $('#donate2').on('click', function(){ + donate(); + }); }); @@ -107,7 +121,7 @@

Spring Boot Code Generator!

- 基于SpringBoot2+Freemarker的代码生成器,用DDL SQL语句生成JPA/JdbcTemplate/Mybatis/BeetlSQL相关代码,支持mysql/oracle/pgsql三大数据库。以释放双手为目的,各大模板也在陆续补充和优化。欢迎大家多多提交模板和交流想法,如果发现有SQL语句不能识别,请留言给我分析,谢谢! + 基于SpringBoot2+Freemarker的代码生成器,用DDL SQL语句生成JPA/JdbcTemplate/Mybatis/MybatisPlus/BeetlSQL相关代码,支持mysql/oracle/pgsql三大数据库。以释放双手为目的,各大模板也在陆续补充和优化。欢迎大家多多提交模板和交流想法,如果发现有SQL语句不能识别,请留言给我分析,同时欢迎大家进行PullRequest赞赏,谢谢!

@@ -124,6 +138,14 @@ 返回封装
+
+ 是否下划线转换为驼峰 +
+