diff --git a/README.md b/README.md index fae6772..d4260cb 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ ## ViewGenerator [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) -[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/wang926454/SpringBootGenerator/pulls) -[![GitHub stars](https://img.shields.io/github/stars/wang926454/SpringBootGenerator.svg?style=social&label=Stars)](https://github.com/wang926454/SpringBootGenerator) -[![GitHub forks](https://img.shields.io/github/forks/wang926454/SpringBootGenerator.svg?style=social&label=Fork)](https://github.com/wang926454/SpringBootGenerator) +[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/dolyw/ViewGenerator/pulls) +[![GitHub stars](https://img.shields.io/github/stars/dolyw/ViewGenerator.svg?style=social&label=Stars)](https://github.com/dolyw/ViewGenerator) +[![GitHub forks](https://img.shields.io/github/forks/dolyw/ViewGenerator.svg?style=social&label=Fork)](https://github.com/dolyw/ViewGenerator) > 可视化自定义模板代码生成系统 @@ -11,8 +11,8 @@ 版本 | 操作 | 链接 ----|------|---- -SpringBoot1.5(第一版) | Test类生成代码 | [https://github.com/wang926454/SpringBootGenerator/releases](https://github.com/wang926454/SpringBootGenerator/releases) -SpringBoot2.1(第二版) | Test类生成代码 | [https://github.com/wang926454/SpringBootGenerator/releases](https://github.com/wang926454/SpringBootGenerator/releases) +SpringBoot1.5(第一版) | Test类生成代码 | [https://github.com/dolyw/ViewGenerator/releases](https://github.com/dolyw/ViewGenerator/releases) +SpringBoot2.1(第二版) | Test类生成代码 | [https://github.com/dolyw/ViewGenerator/releases](https://github.com/dolyw/ViewGenerator/releases) SpringBoot1.5(第三版) | 可视化界面或Test类两种 | 当前 #### 项目介绍 @@ -43,23 +43,23 @@ SpringBoot + Mybatis + PageHelper + 通用Mapper + Thymeleaf(Amaze UI(布局) + ``` 启动首页界面 ``` -![image text](https://docs.wang64.cn/Project/ViewGenerator/image/20190406001.png) +![image text](https://docs.dolyw.com/Project/ViewGenerator/image/20190406001.png) ``` 生成代码界面如下 ``` -![image text](https://docs.wang64.cn/Project/ViewGenerator/image/20190406002.png) +![image text](https://docs.dolyw.com/Project/ViewGenerator/image/20190406002.png) ``` 查看表详细信息界面如下 ``` -![image text](https://docs.wang64.cn/Project/ViewGenerator/image/20190406003.png) +![image text](https://docs.dolyw.com/Project/ViewGenerator/image/20190406003.png) ``` 输入表名生成代码界面如下 ``` -![image text](https://docs.wang64.cn/Project/ViewGenerator/image/20190406004.png) +![image text](https://docs.dolyw.com/Project/ViewGenerator/image/20190406004.png) ``` 配置更新界面如下 ``` -![image text](https://docs.wang64.cn/Project/ViewGenerator/image/20190406005.png) +![image text](https://docs.dolyw.com/Project/ViewGenerator/image/20190406005.png) #### 搭建参考 diff --git a/src/main/java/com/example/Application.java b/src/main/java/com/example/Application.java index 0d27111..bd6f2e7 100644 --- a/src/main/java/com/example/Application.java +++ b/src/main/java/com/example/Application.java @@ -6,7 +6,7 @@ /** * Application - * @author Wang926454 + * @author dolyw.com * @date 2018/11/16 19:29 */ @SpringBootApplication diff --git a/src/main/java/com/example/common/IBaseService.java b/src/main/java/com/example/common/IBaseService.java index 610b1ce..eef3b41 100644 --- a/src/main/java/com/example/common/IBaseService.java +++ b/src/main/java/com/example/common/IBaseService.java @@ -7,7 +7,7 @@ /** * IBaseService - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:45 */ public interface IBaseService { @@ -17,7 +17,7 @@ public interface IBaseService { * 根据实体中的属性值进行查询,查询条件使用等号 * @param record * @return java.util.List - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:43 */ List select(T record); @@ -26,7 +26,7 @@ public interface IBaseService { * 根据主键字段进行查询,方法参数必须包含完整的主键属性,查询条件使用等号 * @param key * @return T - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:43 */ T selectByPrimaryKey(Object key); @@ -35,7 +35,7 @@ public interface IBaseService { * 查询全部结果,select(null)方法能达到同样的效果 * @param * @return java.util.List - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:43 */ List selectAll(); @@ -44,7 +44,7 @@ public interface IBaseService { * 根据实体中的属性进行查询,只能有一个返回值,有多个结果是抛出异常,查询条件使用等号 * @param record * @return T - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:43 */ T selectOne(T record); @@ -53,7 +53,7 @@ public interface IBaseService { * 根据实体中的属性查询总数,查询条件使用等号 * @param record * @return int - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:43 */ int selectCount(T record); @@ -63,7 +63,7 @@ public interface IBaseService { * 保存一个实体,null的属性也会保存,不会使用数据库默认值 * @param record * @return int - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:43 */ int insert(T record); @@ -72,7 +72,7 @@ public interface IBaseService { * 保存一个实体,null的属性不会保存,会使用数据库默认值 * @param record * @return int - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:43 */ int insertSelective(T record); @@ -82,7 +82,7 @@ public interface IBaseService { * 根据主键更新实体全部字段,null值会被更新 * @param record * @return int - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:43 */ int updateByPrimaryKey(T record); @@ -91,7 +91,7 @@ public interface IBaseService { * 根据主键更新属性不为null的值 * @param record * @return int - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:43 */ int updateByPrimaryKeySelective(T record); @@ -101,7 +101,7 @@ public interface IBaseService { * 根据实体属性作为条件进行删除,查询条件使用等号 * @param record * @return int - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:43 */ int delete(T record); @@ -110,7 +110,7 @@ public interface IBaseService { * 根据主键字段进行删除,方法参数必须包含完整的主键属性 * @param key * @return int - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:44 */ int deleteByPrimaryKey(Object key); @@ -120,7 +120,7 @@ public interface IBaseService { * 根据Example条件进行查询,这个查询支持通过Example类指定查询列,通过selectProperties方法指定查询列 * @param example * @return java.util.List - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:44 */ List selectByExample(Object example); @@ -129,7 +129,7 @@ public interface IBaseService { * 根据Example条件进行查询总数 * @param example * @return int - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:44 */ int selectCountByExample(Object example); @@ -139,7 +139,7 @@ public interface IBaseService { * @param record * @param example * @return int - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:44 */ int updateByExample(@Param("record") T record, @Param("example") Object example); @@ -149,7 +149,7 @@ public interface IBaseService { * @param record * @param example * @return int - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:44 */ int updateByExampleSelective(@Param("record") T record, @Param("example") Object example); @@ -158,7 +158,7 @@ public interface IBaseService { * 根据Example条件删除数据 * @param example * @return int - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:44 */ int deleteByExample(Object example); @@ -169,7 +169,7 @@ public interface IBaseService { * @param record * @param rowBounds * @return java.util.List - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:44 */ List selectByRowBounds(T record, RowBounds rowBounds); @@ -179,7 +179,7 @@ public interface IBaseService { * @param example * @param rowBounds * @return java.util.List - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:44 */ List selectByExampleAndRowBounds(Object example, RowBounds rowBounds); diff --git a/src/main/java/com/example/common/ResponseBean.java b/src/main/java/com/example/common/ResponseBean.java index 56e74f5..d1b6c03 100644 --- a/src/main/java/com/example/common/ResponseBean.java +++ b/src/main/java/com/example/common/ResponseBean.java @@ -2,7 +2,7 @@ /** * ResponseBean - * @author Wang926454 + * @author dolyw.com * @date 2018/8/30 11:39 */ public class ResponseBean { diff --git a/src/main/java/com/example/common/impl/BaseServiceImpl.java b/src/main/java/com/example/common/impl/BaseServiceImpl.java index 3f4ee90..9ccb1d6 100644 --- a/src/main/java/com/example/common/impl/BaseServiceImpl.java +++ b/src/main/java/com/example/common/impl/BaseServiceImpl.java @@ -9,7 +9,7 @@ /** * BaseServiceImpl - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 15:45 */ public abstract class BaseServiceImpl implements IBaseService { diff --git a/src/main/java/com/example/config/DataBaseConfig.java b/src/main/java/com/example/config/DataBaseConfig.java index e5927ed..7bd7baa 100644 --- a/src/main/java/com/example/config/DataBaseConfig.java +++ b/src/main/java/com/example/config/DataBaseConfig.java @@ -10,7 +10,7 @@ /** * Dao配置注入 - * @author Wang926454 + * @author dolyw.com * @date 2019/4/5 17:56 */ @Configuration @@ -36,7 +36,7 @@ public class DataBaseConfig { * @param * @throws * @return com.example.dao.GeneratorDao - * @author Wang926454 + * @author dolyw.com * @date 2019/4/5 17:59 */ @Bean diff --git a/src/main/java/com/example/config/ExceptionAdvice.java b/src/main/java/com/example/config/ExceptionAdvice.java index c9d8363..b2fdb47 100644 --- a/src/main/java/com/example/config/ExceptionAdvice.java +++ b/src/main/java/com/example/config/ExceptionAdvice.java @@ -13,7 +13,7 @@ /** * 异常控制处理器 - * @author Wang926454 + * @author dolyw.com * @date 2018/8/30 14:02 */ @RestControllerAdvice diff --git a/src/main/java/com/example/config/WebMvcConfig.java b/src/main/java/com/example/config/WebMvcConfig.java index 941a7fc..abf17ac 100644 --- a/src/main/java/com/example/config/WebMvcConfig.java +++ b/src/main/java/com/example/config/WebMvcConfig.java @@ -6,7 +6,7 @@ /** * SpringBoot全局支持CORS(跨源请求)的配置 - * @author Wang926454 + * @author dolyw.com * @date 2018/8/9 17:28 */ @Configuration diff --git a/src/main/java/com/example/constant/Constant.java b/src/main/java/com/example/constant/Constant.java index 77383a7..02bdf80 100644 --- a/src/main/java/com/example/constant/Constant.java +++ b/src/main/java/com/example/constant/Constant.java @@ -2,7 +2,7 @@ /** * Constant - * @author Wang926454 + * @author dolyw.com * @date 2019/4/6 19:50 */ public interface Constant { diff --git a/src/main/java/com/example/constant/DataBaseEnum.java b/src/main/java/com/example/constant/DataBaseEnum.java index bb0d4c3..0dd1643 100644 --- a/src/main/java/com/example/constant/DataBaseEnum.java +++ b/src/main/java/com/example/constant/DataBaseEnum.java @@ -2,7 +2,7 @@ /** * 数据库类型 - * @author Wang926454 + * @author dolyw.com * @date 2019/4/6 19:53 */ public enum DataBaseEnum { diff --git a/src/main/java/com/example/controller/DataBaseController.java b/src/main/java/com/example/controller/DataBaseController.java index e79eac5..c46f396 100644 --- a/src/main/java/com/example/controller/DataBaseController.java +++ b/src/main/java/com/example/controller/DataBaseController.java @@ -1,6 +1,6 @@ /* - * PDMS wliduo https://github.com/wang926454 - * Created By Wang926454 + * PDMS wliduo https://github.com/dolyw + * Created By dolyw.com * Date By (2019-04-05 18:00:26) */ package com.example.controller; @@ -67,7 +67,7 @@ public DataBaseController(GeneratorDao generatorDao) { /** * 列表 - * @author Wang926454 + * @author dolyw.com * @date 2019-04-05 18:00:26 */ @GetMapping @@ -94,7 +94,7 @@ public ResponseBean list(@RequestParam(defaultValue = "1") Integer page, /** * 获取所有表名 - * @author Wang926454 + * @author dolyw.com * @date 2019-04-08 16:00:26 */ @GetMapping("/tableNames/all") @@ -114,7 +114,7 @@ public ResponseBean all() { /** * 表详细字段信息 - * @author Wang926454 + * @author dolyw.com * @date 2019-04-05 18:00:26 */ @GetMapping("/{tableName}") @@ -128,7 +128,7 @@ public ResponseBean detail(@PathVariable("tableName") String tableName) { /** * 生成代码到输出路径 - * @author Wang926454 + * @author dolyw.com * @date 2019-04-05 18:00:26 */ @PostMapping("/{tableName}") @@ -163,7 +163,7 @@ public ResponseBean genTable(@PathVariable("tableName") String tableName) throws /** * 生成代码为Zip文件下载 - * @author Wang926454 + * @author dolyw.com * @date 2019-04-05 18:00:26 */ @GetMapping("/zip/{tableName}") @@ -181,7 +181,7 @@ public void genTableToZip(@PathVariable("tableName") String tableName, } // 生成代码到临时路径 if (genCode(tableNames, tempDir.getPath())) { - StringBuilder comment = new StringBuilder("项目地址:https://github.com/wang926454/SpringBootGenerator\r\n\r\n"); + StringBuilder comment = new StringBuilder("项目地址:https://github.com/dolyw/ViewGenerator\r\n\r\n"); for (String tempName : tableNames) { comment.append(tempName + "\r\n"); } @@ -203,7 +203,7 @@ public void genTableToZip(@PathVariable("tableName") String tableName, /** * 打开Windows系统的代码输出文件夹 - * @author Wang926454 + * @author dolyw.com * @date 2019-04-05 18:00:26 */ @GetMapping("/open") @@ -225,7 +225,7 @@ public ResponseBean open() { /** * 读取更新配置文件generator.properties - * @author Wang926454 + * @author dolyw.com * @date 2019-04-05 18:00:26 */ @PutMapping("/config") @@ -288,7 +288,7 @@ public ResponseBean config(@RequestBody Map config) { * @param outRoot 代码输出文件夹 * @throws IOException * @return boolean - * @author Wang926454 + * @author dolyw.com * @date 2019/4/8 17:19 */ public boolean genCode(String[] tableNames, String outRoot) throws IOException { diff --git a/src/main/java/com/example/controller/IndexController.java b/src/main/java/com/example/controller/IndexController.java index 0742912..6e7a9d1 100644 --- a/src/main/java/com/example/controller/IndexController.java +++ b/src/main/java/com/example/controller/IndexController.java @@ -6,7 +6,7 @@ /** * 通用访问匹配页面跳转 - * @author Wang926454 + * @author dolyw.com * @date 2019/1/24 19:27 */ @Controller @@ -15,7 +15,7 @@ public class IndexController { /** * 主页 * @return java.lang.String - * @author Wang926454 + * @author dolyw.com * @date 2019/4/6 13:17 */ @RequestMapping("/") @@ -27,7 +27,7 @@ public String index() { * 通用页面跳转 * @param url * @return java.lang.String - * @author Wang926454 + * @author dolyw.com * @date 2019/1/24 19:27 */ @RequestMapping("{url}.shtml") @@ -40,7 +40,7 @@ public String page(@PathVariable("url") String url) { * @param module * @param url * @return java.lang.String - * @author Wang926454 + * @author dolyw.com * @date 2019/1/24 19:27 */ @RequestMapping("{module}/{url}.shtml") @@ -53,7 +53,7 @@ public String page(@PathVariable("module") String module, @PathVariable("url") S * @param module * @param url * @return java.lang.String - * @author Wang926454 + * @author dolyw.com * @date 2019/1/25 19:35 */ @RequestMapping("{module}/{module2}/{url}.shtml") diff --git a/src/main/java/com/example/dao/GeneratorDao.java b/src/main/java/com/example/dao/GeneratorDao.java index 5aa909a..d3a912d 100644 --- a/src/main/java/com/example/dao/GeneratorDao.java +++ b/src/main/java/com/example/dao/GeneratorDao.java @@ -5,7 +5,7 @@ /** * GeneratorDao - * @author Wang926454 + * @author dolyw.com * @date 2019/4/5 17:51 */ public interface GeneratorDao { @@ -15,7 +15,7 @@ public interface GeneratorDao { * @param map * @throws * @return java.util.List> - * @author Wang926454 + * @author dolyw.com * @date 2019/4/5 17:51 */ List> queryList(Map map); @@ -25,7 +25,7 @@ public interface GeneratorDao { * @param tableName * @throws * @return java.util.Map - * @author Wang926454 + * @author dolyw.com * @date 2019/4/5 17:52 */ Map queryTable(String tableName); @@ -35,7 +35,7 @@ public interface GeneratorDao { * @param tableName * @throws * @return java.util.List> - * @author Wang926454 + * @author dolyw.com * @date 2019/4/5 17:52 */ List> queryColumns(String tableName); diff --git a/src/main/java/com/example/dao/MySQLGeneratorDao.java b/src/main/java/com/example/dao/MySQLGeneratorDao.java index 8ac300d..1ca6cc0 100644 --- a/src/main/java/com/example/dao/MySQLGeneratorDao.java +++ b/src/main/java/com/example/dao/MySQLGeneratorDao.java @@ -4,7 +4,7 @@ /** * MySQL - * @author Wang926454 + * @author dolyw.com * @date 2019/4/5 17:53 */ @Repository diff --git a/src/main/java/com/example/dao/OracleGeneratorDao.java b/src/main/java/com/example/dao/OracleGeneratorDao.java index 2727a9d..f749957 100644 --- a/src/main/java/com/example/dao/OracleGeneratorDao.java +++ b/src/main/java/com/example/dao/OracleGeneratorDao.java @@ -4,7 +4,7 @@ /** * Oracle - * @author Wang926454 + * @author dolyw.com * @date 2019/4/5 17:53 */ @Repository diff --git a/src/main/java/com/example/dao/PostgreSQLGeneratorDao.java b/src/main/java/com/example/dao/PostgreSQLGeneratorDao.java index 19d93cd..df433b2 100644 --- a/src/main/java/com/example/dao/PostgreSQLGeneratorDao.java +++ b/src/main/java/com/example/dao/PostgreSQLGeneratorDao.java @@ -4,7 +4,7 @@ /** * PostgreSQL - * @author Wang926454 + * @author dolyw.com * @date 2019/4/5 18:21 */ @Repository diff --git a/src/main/java/com/example/dao/SQLServerGeneratorDao.java b/src/main/java/com/example/dao/SQLServerGeneratorDao.java index def8e32..23655ee 100644 --- a/src/main/java/com/example/dao/SQLServerGeneratorDao.java +++ b/src/main/java/com/example/dao/SQLServerGeneratorDao.java @@ -4,7 +4,7 @@ /** * SQLServer - * @author Wang926454 + * @author dolyw.com * @date 2019/4/5 18:22 */ @Repository diff --git a/src/main/java/com/example/exception/CustomException.java b/src/main/java/com/example/exception/CustomException.java index 81c6dbe..901ebcf 100644 --- a/src/main/java/com/example/exception/CustomException.java +++ b/src/main/java/com/example/exception/CustomException.java @@ -2,7 +2,7 @@ /** * 自定义异常(CustomException) - * @author Wang926454 + * @author dolyw.com * @date 2018/8/30 13:59 */ public class CustomException extends RuntimeException { diff --git a/src/main/java/com/example/exception/SystemException.java b/src/main/java/com/example/exception/SystemException.java index c5b9e1f..043c30a 100644 --- a/src/main/java/com/example/exception/SystemException.java +++ b/src/main/java/com/example/exception/SystemException.java @@ -2,7 +2,7 @@ /** * 系统异常(SystemException) - * @author Wang926454 + * @author dolyw.com * @date 2018/8/30 13:59 */ public class SystemException extends RuntimeException { diff --git a/src/main/java/com/example/util/SafeProperties.java b/src/main/java/com/example/util/SafeProperties.java index 7dc5e5f..2ff605f 100644 --- a/src/main/java/com/example/util/SafeProperties.java +++ b/src/main/java/com/example/util/SafeProperties.java @@ -9,7 +9,7 @@ /** * SafeProperties * - * @author Wang926454 + * @author dolyw.com * @date 2019/4/5 21:20 */ public class SafeProperties extends Properties { diff --git a/src/main/java/com/example/util/ZipUtil.java b/src/main/java/com/example/util/ZipUtil.java index 6041a09..22b4ec6 100644 --- a/src/main/java/com/example/util/ZipUtil.java +++ b/src/main/java/com/example/util/ZipUtil.java @@ -4,16 +4,14 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.OutputStream; -import java.net.URLEncoder; import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; /** * ZipUtil - * @author Wang926454 + * @author dolyw.com * @date 2019/4/6 12:00 */ public class ZipUtil { diff --git a/src/main/java/com/generator/CustomGeneratorFacade.java b/src/main/java/com/generator/CustomGeneratorFacade.java index a1eaec6..b238952 100644 --- a/src/main/java/com/generator/CustomGeneratorFacade.java +++ b/src/main/java/com/generator/CustomGeneratorFacade.java @@ -5,7 +5,7 @@ /** * CustomGeneratorFacade - * @author Wang926454 + * @author dolyw.com * @date 2019/4/6 19:36 */ public class CustomGeneratorFacade extends GeneratorFacade { @@ -13,7 +13,7 @@ public class CustomGeneratorFacade extends GeneratorFacade { /** * CustomGeneratorFacade * @param outRootDir - * @author Wang926454 + * @author dolyw.com * @date 2019/4/8 9:27 */ public CustomGeneratorFacade(String outRootDir) { diff --git a/src/main/resources/template/two/LayUI/java_copyright.include b/src/main/resources/template/two/LayUI/java_copyright.include index 267a522..68d2909 100644 --- a/src/main/resources/template/two/LayUI/java_copyright.include +++ b/src/main/resources/template/two/LayUI/java_copyright.include @@ -1,5 +1,5 @@ /* - * PDMS wliduo https://github.com/wang926454 - * Created By Wang926454 + * PDMS wliduo https://github.com/dolyw + * Created By dolyw.com * Date By (${now?string('yyyy-MM-dd HH:mm:ss')}) */ diff --git a/src/main/resources/template/two/RESTful/java_copyright.include b/src/main/resources/template/two/RESTful/java_copyright.include index 267a522..68d2909 100644 --- a/src/main/resources/template/two/RESTful/java_copyright.include +++ b/src/main/resources/template/two/RESTful/java_copyright.include @@ -1,5 +1,5 @@ /* - * PDMS wliduo https://github.com/wang926454 - * Created By Wang926454 + * PDMS wliduo https://github.com/dolyw + * Created By dolyw.com * Date By (${now?string('yyyy-MM-dd HH:mm:ss')}) */ diff --git a/src/main/resources/templates/common/common.html b/src/main/resources/templates/common/common.html index ffa89e5..7dfe05b 100644 --- a/src/main/resources/templates/common/common.html +++ b/src/main/resources/templates/common/common.html @@ -75,13 +75,13 @@