Переглянути джерело

【DEL】独立代码生成器

ZhaoMn 4 роки тому
батько
коміт
2565912062
48 змінених файлів з 0 додано та 2899 видалено
  1. 0 170
      railway-generator/pom.xml
  2. 0 11
      railway-generator/src/main/java/com/railway/generator/GeneratorApplication.java
  3. 0 22
      railway-generator/src/main/java/com/railway/generator/config/GlobalDefaultExceptionHandler.java
  4. 0 50
      railway-generator/src/main/java/com/railway/generator/config/WebMvcConfig.java
  5. 0 172
      railway-generator/src/main/java/com/railway/generator/controller/IndexController.java
  6. 0 19
      railway-generator/src/main/java/com/railway/generator/entity/ClassInfo.java
  7. 0 18
      railway-generator/src/main/java/com/railway/generator/entity/FieldInfo.java
  8. 0 32
      railway-generator/src/main/java/com/railway/generator/entity/ReturnT.java
  9. 0 43
      railway-generator/src/main/java/com/railway/generator/util/ApiReturnObject.java
  10. 0 50
      railway-generator/src/main/java/com/railway/generator/util/ApiReturnUtil.java
  11. 0 31
      railway-generator/src/main/java/com/railway/generator/util/BasePath.java
  12. 0 26
      railway-generator/src/main/java/com/railway/generator/util/CodeGenerateException.java
  13. 0 24
      railway-generator/src/main/java/com/railway/generator/util/CodeGeneratorTool.java
  14. 0 30
      railway-generator/src/main/java/com/railway/generator/util/FileUtil.java
  15. 0 58
      railway-generator/src/main/java/com/railway/generator/util/FreemarkerTool.java
  16. 0 81
      railway-generator/src/main/java/com/railway/generator/util/FreemarkerUtil.java
  17. 0 71
      railway-generator/src/main/java/com/railway/generator/util/StringPlusUtils.java
  18. 0 60
      railway-generator/src/main/java/com/railway/generator/util/StringUtils.java
  19. 0 294
      railway-generator/src/main/java/com/railway/generator/util/TableParseUtil.java
  20. 0 37
      railway-generator/src/main/resources/application.yml
  21. 0 73
      railway-generator/src/main/resources/templates/code-generator/beetlsql/beetlcontroller.ftl
  22. 0 26
      railway-generator/src/main/resources/templates/code-generator/beetlsql/beetlentity.ftl
  23. 0 26
      railway-generator/src/main/resources/templates/code-generator/beetlsql/beetlentitydto.ftl
  24. 0 31
      railway-generator/src/main/resources/templates/code-generator/beetlsql/beetlmd.ftl
  25. 0 20
      railway-generator/src/main/resources/templates/code-generator/jdbc-template/jtdao.ftl
  26. 0 60
      railway-generator/src/main/resources/templates/code-generator/jdbc-template/jtdaoimpl.ftl
  27. 0 30
      railway-generator/src/main/resources/templates/code-generator/jpa/entity.ftl
  28. 0 82
      railway-generator/src/main/resources/templates/code-generator/jpa/jpacontroller.ftl
  29. 0 25
      railway-generator/src/main/resources/templates/code-generator/jpa/repository.ftl
  30. 0 81
      railway-generator/src/main/resources/templates/code-generator/mybatis-plus/pluscontroller.ftl
  31. 0 14
      railway-generator/src/main/resources/templates/code-generator/mybatis-plus/plusmapper.ftl
  32. 0 74
      railway-generator/src/main/resources/templates/code-generator/mybatis/controller.ftl
  33. 0 59
      railway-generator/src/main/resources/templates/code-generator/mybatis/mapper.ftl
  34. 0 37
      railway-generator/src/main/resources/templates/code-generator/mybatis/model.ftl
  35. 0 89
      railway-generator/src/main/resources/templates/code-generator/mybatis/mybatis.ftl
  36. 0 35
      railway-generator/src/main/resources/templates/code-generator/mybatis/service.ftl
  37. 0 68
      railway-generator/src/main/resources/templates/code-generator/mybatis/service_impl.ftl
  38. 0 63
      railway-generator/src/main/resources/templates/code-generator/railway/back/controller.ftl
  39. 0 43
      railway-generator/src/main/resources/templates/code-generator/railway/back/dao.ftl
  40. 0 55
      railway-generator/src/main/resources/templates/code-generator/railway/back/entity.ftl
  41. 0 94
      railway-generator/src/main/resources/templates/code-generator/railway/back/mybatis.ftl
  42. 0 37
      railway-generator/src/main/resources/templates/code-generator/railway/back/service.ftl
  43. 0 71
      railway-generator/src/main/resources/templates/code-generator/railway/back/serviceImpl.ftl
  44. 0 13
      railway-generator/src/main/resources/templates/code-generator/ui/bootstrap-ui.ftl
  45. 0 18
      railway-generator/src/main/resources/templates/code-generator/ui/element-ui.ftl
  46. 0 9
      railway-generator/src/main/resources/templates/code-generator/ui/swagger-ui.ftl
  47. 0 60
      railway-generator/src/main/resources/templates/common/common-import.ftl
  48. 0 307
      railway-generator/src/main/resources/templates/index.ftl

+ 0 - 170
railway-generator/pom.xml

@@ -1,170 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>railway</artifactId>
-        <groupId>com.railway</groupId>
-        <version>1.0.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>railway-generator</artifactId>
-    <name>railway generator</name>
-    <description>微服务-代码生成</description>
-    <dependencies>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-            <version>2.2.13.RELEASE</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>fastjson</artifactId>
-            <version>1.2.44</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-configuration-processor</artifactId>
-            <version>2.2.13.RELEASE</version>
-            <optional>true</optional>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-devtools</artifactId>
-            <version>2.2.13.RELEASE</version>
-        </dependency>
-
-        <dependency>
-            <groupId>cn.hutool</groupId>
-            <artifactId>hutool-all</artifactId>
-            <version>4.1.12</version>
-        </dependency>
-
-        <!-- lombok -->
-        <dependency>
-            <groupId>org.projectlombok</groupId>
-            <artifactId>lombok</artifactId>
-            <version>1.18.2</version>
-        </dependency>
-
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-            <version>1.2.16</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
-            <version>3.8</version>
-        </dependency>
-
-        <!-- freemarker -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-freemarker</artifactId>
-            <version>2.2.13.RELEASE</version>
-        </dependency>
-
-        <dependency>
-            <groupId>javax.xml.bind</groupId>
-            <artifactId>jaxb-api</artifactId>
-            <version>2.3.0</version>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-impl</artifactId>
-            <version>2.3.0</version>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-core</artifactId>
-            <version>2.3.0</version>
-        </dependency>
-        <dependency>
-            <groupId>javax.activation</groupId>
-            <artifactId>activation</artifactId>
-            <version>1.1.1</version>
-        </dependency>
-
-    </dependencies>
-
-
-    <build>
-        <!--解决idea打包没有xml-->
-        <resources>
-            <resource>
-                <directory>src/main/java</directory>
-                <includes>
-                    <include>**/*.properties</include>
-                    <include>**/*.xml</include>
-                </includes>
-                <filtering>false</filtering>
-            </resource>
-            <resource>
-                <directory>src/main/resources</directory>
-            </resource>
-        </resources>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.1</version>
-                <configuration>
-                    <skip>true</skip>
-                    <compilerId>javac</compilerId>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                    <encoding>UTF-8</encoding>
-                    <compilerVersion>1.8</compilerVersion>
-                    <verbose>true</verbose>
-                    <optimize>true</optimize>
-                </configuration>
-                <dependencies>
-                    <dependency>
-                        <groupId>org.codehaus.plexus</groupId>
-                        <artifactId>plexus-compiler-eclipse</artifactId>
-                        <version>2.2</version>
-                    </dependency>
-                </dependencies>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-resources-plugin</artifactId>
-                <version>3.0.1</version>
-                <configuration>
-                    <!--<failOnMissingWebXml>false</failOnMissingWebXml>-->
-                    <includeEmptyDirs>true</includeEmptyDirs>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-war-plugin</artifactId>
-                <version>2.1.1</version>
-                <configuration>
-                    <failOnMissingWebXml>false</failOnMissingWebXml>
-                    <warSourceExcludes>upload/**</warSourceExcludes>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <version>2.2.13.RELEASE</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-
-    </build>
-
-</project>

+ 0 - 11
railway-generator/src/main/java/com/railway/generator/GeneratorApplication.java

@@ -1,11 +0,0 @@
-package com.railway.generator;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class GeneratorApplication {
-	public static void main(String[] args) {
-		SpringApplication.run(GeneratorApplication.class,args);
-	}
-}

+ 0 - 22
railway-generator/src/main/java/com/railway/generator/config/GlobalDefaultExceptionHandler.java

@@ -1,22 +0,0 @@
-package com.railway.generator.config;
-
-import com.railway.generator.util.ApiReturnObject;
-import com.railway.generator.util.ApiReturnUtil;
-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 ApiReturnObject defaultExceptionHandler(HttpServletRequest req, Exception e) {
-        e.printStackTrace();
-        //return new ApiReturnObject("01","server error", e.getMessage());
-        return ApiReturnUtil.error("服务器异常", e.getMessage());
-    }
-
-}

+ 0 - 50
railway-generator/src/main/java/com/railway/generator/config/WebMvcConfig.java

@@ -1,50 +0,0 @@
-package com.railway.generator.config;
-
-import com.alibaba.fastjson.support.config.FastJsonConfig;
-import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.http.MediaType;
-import org.springframework.http.converter.HttpMessageConverter;
-import org.springframework.http.converter.StringHttpMessageConverter;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
-*  2019-2-11 liutf WebMvcConfig 整合 cors 和 SpringMvc MessageConverter
-*/
-@Configuration
-public class WebMvcConfig implements WebMvcConfigurer {
-
-/*    @Override
-    public void addCorsMappings(CorsRegistry registry) {
-        registry.addMapping("/**")
-                .allowedOrigins("*")
-                .allowedHeaders("x-requested-with")
-                .allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "TRACE")
-                .maxAge(3600);
-    }*/
-
-    @Override
-    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
-        //FastJsonHttpMessageConverter
-        FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
-
-        List<MediaType> fastMediaTypes = new ArrayList<>();
-        fastMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
-        fastConverter.setSupportedMediaTypes(fastMediaTypes);
-
-        FastJsonConfig fastJsonConfig = new FastJsonConfig();
-        fastJsonConfig.setCharset(Charset.forName("UTF-8"));
-        fastConverter.setFastJsonConfig(fastJsonConfig);
-
-        //StringHttpMessageConverter
-        StringHttpMessageConverter stringConverter = new StringHttpMessageConverter();
-        stringConverter.setDefaultCharset(Charset.forName("UTF-8"));
-        stringConverter.setSupportedMediaTypes(fastMediaTypes);
-        converters.add(stringConverter);
-        converters.add(fastConverter);
-    }
-}

+ 0 - 172
railway-generator/src/main/java/com/railway/generator/controller/IndexController.java

@@ -1,172 +0,0 @@
-package com.railway.generator.controller;
-
-import com.railway.generator.entity.ClassInfo;
-import com.railway.generator.entity.FieldInfo;
-import com.railway.generator.entity.ReturnT;
-import com.railway.generator.util.CodeGeneratorTool;
-import com.railway.generator.util.FileUtil;
-import com.railway.generator.util.FreemarkerTool;
-import freemarker.template.TemplateException;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static com.railway.generator.util.StringPlusUtils.camelCaseToUnderline;
-import static com.railway.generator.util.StringPlusUtils.underlineToCamelCase;
-
-/**
- * spring boot code generator
- * @author railway
- */
-@Controller
-@Slf4j
-public class IndexController {
-
-  private final FreemarkerTool freemarkerTool;
-
-  public IndexController(FreemarkerTool freemarkerTool) {
-    this.freemarkerTool = freemarkerTool;
-  }
-
-  @RequestMapping("/")
-  public String index() {
-    return "index";
-  }
-
-  @RequestMapping("/genCode")
-  @ResponseBody
-  public ReturnT<Map<String, String>> codeGenerate(String tableSql,
-      //2019-2-10 liutf 修改为@RequestParam参数校验
-      @RequestParam(required = false, defaultValue = "author") String authorName,
-      @RequestParam(required = false, defaultValue = "catenary") String busType,
-      @RequestParam(required = false, defaultValue = "com.railway.business") String packageName,
-      @RequestParam(required = false, defaultValue = "") String className,
-      @RequestParam(required = false, defaultValue = "id") String primaryKey,
-      @RequestParam(required = false, defaultValue = "D:/railway/") String projectPath,
-      @RequestParam(required = false, defaultValue = "ApiReturnUtil") String returnUtil
-  ) {
-
-    try {
-
-      if (StringUtils.isBlank(tableSql)) {
-        return new ReturnT<>(ReturnT.FAIL_CODE, "表结构信息不可为空");
-      }
-
-      // parse table
-      ClassInfo classInfo = CodeGeneratorTool.processTableIntoClassInfo(tableSql);
-
-      // code genarete
-      Map<String, Object> params = new HashMap<>();
-      if (StringUtils.isNotEmpty(className)) {
-        classInfo.setClassName(className);
-      }
-      String primaryKeyCame = underlineToCamelCase(primaryKey);
-      packageName = packageName +"."+busType;
-      String restPath =
-          packageName.substring(packageName.lastIndexOf(".") + 1) + camelCaseToUnderline(
-              className).replace("_", "/");
-      params.put("classInfo", classInfo);
-      params.put("busType", busType);
-      params.put("authorName", authorName);
-      params.put("packageName", packageName);
-      params.put("returnUtil", returnUtil);
-      params.put("primaryKey", primaryKey);
-      params.put("primaryKeyCame", primaryKeyCame);
-      params.put("restPath", restPath);
-      List<FieldInfo> list = new ArrayList();
-      for (FieldInfo fieldInfo : classInfo.getFieldList()) {
-        if (!fieldInfo.getFieldName().equals(primaryKeyCame)) {
-          list.add(fieldInfo);
-        }
-      }
-      classInfo.setFieldList(list);
-      // result
-      Map<String, String> result = new HashMap<String, String>();
-//
-//            //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));
-//            //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("beetlentitydto", freemarkerTool.processString("code-generator/beetlsql/beetlentitydto.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));
-      String controllerPath = projectPath + File.separator
-          + "railway-admin/src/main/java/com/railway/web/controller/business/"+busType
-          + File.separator + classInfo.getClassName() + "Controller.java";
-      String servicePath = projectPath + File.separator
-          + "railway-business/src/main/java/com/railway/business/"+busType + File.separator
-          + "service" + File.separator + "I" + classInfo.getClassName() + "Service.java";
-      String serviceImplPath = projectPath + File.separator
-          + "railway-business/src/main/java/com/railway/business/"+busType + File.separator
-          + "service" + File.separator + "impl" + File.separator + classInfo.getClassName()
-          + "ServiceImpl.java";
-      String daoPath = projectPath + File.separator
-          + "railway-business/src/main/java/com/railway/business/"+busType + File.separator
-          + "mapper" + File.separator + classInfo.getClassName() + "Mapper.java";
-      String entityPath = projectPath + File.separator
-          + "railway-business/src/main/java/com/railway/business/"+busType + File.separator
-          + "domain" + File.separator + classInfo.getClassName() + ".java";
-      String mapperPath =
-          projectPath + File.separator + "railway-business/src/main/resources/mapper/"+busType
-              + File.separator + classInfo.getClassName() + "Mapper.xml";
-      //写入文件
-      FileUtil.writeToFile(controllerPath,
-          freemarkerTool.processString("code-generator/railway/back/controller.ftl", params));
-      FileUtil.writeToFile(servicePath,
-          freemarkerTool.processString("code-generator/railway/back/service.ftl", params));
-      FileUtil.writeToFile(serviceImplPath,
-          freemarkerTool.processString("code-generator/railway/back/serviceImpl.ftl", params));
-      FileUtil.writeToFile(daoPath,
-          freemarkerTool.processString("code-generator/railway/back/dao.ftl", params));
-      FileUtil.writeToFile(entityPath,
-          freemarkerTool.processString("code-generator/railway/back/entity.ftl", params));
-      FileUtil.writeToFile(mapperPath,
-          freemarkerTool.processString("code-generator/railway/back/mybatis.ftl", params));
-      // 计算,生成代码行数
-//            int lineNum = 0;
-//            for (Map.Entry<String, String> item : result.entrySet()) {
-//                if (item.getValue() != null) {
-//                    lineNum += StringUtils.countMatches(item.getValue(), "\n");
-//                }
-//            }
-//            log.info("生成代码行数:{}", lineNum);
-      //测试环境可自行开启
-      //log.info("生成代码数据:{}", result);
-      return new ReturnT<>(result);
-    } catch (IOException | TemplateException e) {
-      log.error(e.getMessage(), e);
-      return new ReturnT<>(ReturnT.FAIL_CODE, "表结构解析失败" + e.getMessage());
-    }
-
-  }
-
-}

+ 0 - 19
railway-generator/src/main/java/com/railway/generator/entity/ClassInfo.java

@@ -1,19 +0,0 @@
-package com.railway.generator.entity;
-
-import lombok.Data;
-
-import java.util.List;
-
-/**
- * class info
- *
- */
-@Data
-public class ClassInfo {
-
-    private String tableName;
-    private String className;
-	private String classComment;
-	private List<FieldInfo> fieldList;
-
-}

+ 0 - 18
railway-generator/src/main/java/com/railway/generator/entity/FieldInfo.java

@@ -1,18 +0,0 @@
-package com.railway.generator.entity;
-
-import lombok.Data;
-
-/**
- * field info
- *
- */
-@Data
-public class FieldInfo {
-
-    private String columnName;
-    private String fieldName;
-    private String fieldClass;
-    private String fieldComment;
-    private Integer fieldLength;
-
-}

+ 0 - 32
railway-generator/src/main/java/com/railway/generator/entity/ReturnT.java

@@ -1,32 +0,0 @@
-package com.railway.generator.entity;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * common return
- */
-@Data
-public class ReturnT<T> implements Serializable {
-	public static final long serialVersionUID = 42L;
-
-	public static final int SUCCESS_CODE = 200;
-	public static final int FAIL_CODE = 500;
-	public static final ReturnT<String> SUCCESS = new ReturnT<>(null);
-	public static final ReturnT<String> FAIL = new ReturnT<>(FAIL_CODE, null);
-	
-	private int code;
-	private String msg;
-	private T data;
-	
-	public ReturnT(int code, String msg) {
-		this.code = code;
-		this.msg = msg;
-	}
-	public ReturnT(T data) {
-		this.code = SUCCESS_CODE;
-		this.data = data;
-	}
-	
-}

+ 0 - 43
railway-generator/src/main/java/com/railway/generator/util/ApiReturnObject.java

@@ -1,43 +0,0 @@
-package com.railway.generator.util;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-@Data
-public class ApiReturnObject implements Serializable{
-
-	private static final long serialVersionUID = 1L;
-
-	public ApiReturnObject(String errorCode, Object errorMessage, Object returnObject) {
-		super();
-		this.errorCode = errorCode;
-		this.errorMessage = errorMessage;
-		this.returnObject = returnObject;
-	}
-	public ApiReturnObject(Object errorMessage, Object returnObject) {
-		super();
-		this.errorMessage = errorMessage;
-		this.returnObject = returnObject;
-	}
-
-	String errorCode="00";
-	Object errorMessage;
-	Object returnObject;
-	String pageNumber;
-	String pageSize;
-	String totalElements;
-	String totalPages;
-
-	public ApiReturnObject(String pageNumber,String pageSize,String totalElements,String totalPages,String errorCode, Object errorMessage, Object returnObject) {
-		super();
-		this.pageNumber = pageNumber;
-		this.errorCode = errorCode;
-		this.errorMessage = errorMessage;
-		this.returnObject = returnObject;
-		this.pageSize = pageSize;
-		this.totalElements = totalElements;
-		this.totalPages = totalPages;
-	}
-
-}

+ 0 - 50
railway-generator/src/main/java/com/railway/generator/util/ApiReturnUtil.java

@@ -1,50 +0,0 @@
-package com.railway.generator.util;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-public class ApiReturnUtil implements Serializable{
-
-	private static final long serialVersionUID = 1L;
-	
-	public static ApiReturnObject error(Object errorMessage) {
-		System.out.println(errorMessage);
-		List<Object> object=new ArrayList<Object>();
-		return new ApiReturnObject("01",errorMessage,object);
-	}
-	public static ApiReturnObject error(Object errorMessage, Object returnObject) {
-		List<Object> object=new ArrayList<Object>();
-		object.add(returnObject);
-		return new ApiReturnObject("01",errorMessage,object);
-	}
-	public static ApiReturnObject success(Object returnObject) {
-		if(returnObject instanceof List){
-			return new ApiReturnObject("00","success",returnObject);
-		}else {
-			List<Object> object=new ArrayList<Object>();
-			object.add(returnObject);
-			return new ApiReturnObject("00","success",object);
-		}
-	}
-	public static ApiReturnObject success(Object errorMessage, Object returnObject) {
-		if(returnObject instanceof List){
-			return new ApiReturnObject("00",errorMessage,returnObject);
-		}else {
-			List<Object> object=new ArrayList<Object>();
-			object.add(returnObject);
-			return new ApiReturnObject("00",errorMessage,object);
-		}
-	}
-	public static ApiReturnObject pageManual(Integer pageNumber, Integer pageSize,Integer countNum, List returnObject) {
-		return new ApiReturnObject(pageNumber+"",pageSize+"",countNum+"",getTotalPages(countNum, pageSize),"00","success",returnObject);
-	}
-
-	public static String getTotalPages(Integer countNum, Integer pageSize) {
-		if((countNum%pageSize)==0) {
-			return ((countNum/pageSize))+"";
-		}else {
-			return ((countNum/pageSize)+1)+"";
-		}
-	}
-}

+ 0 - 31
railway-generator/src/main/java/com/railway/generator/util/BasePath.java

@@ -1,31 +0,0 @@
-package com.railway.generator.util;
-
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-
-public class BasePath {
-	protected static String contextPath = null;
-	protected static String basePath = null; 
-	protected static String realPath = null;
-	
-	public static String getBasePath(HttpServletRequest request) {
-		contextPath = request.getContextPath();
-		basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+contextPath+"/";
-		return basePath;
-	}
-	
-	public static String getRealPath(HttpServletRequest request, String path) {
-		ServletContext context = request.getSession().getServletContext();
-		realPath = context.getRealPath(path);
-		realPath = context.getRealPath(path)+"\\";
-		return realPath;
-	}
-	
-	public static String getMyRealPath(HttpServletRequest request, String path) {
-		ServletContext context = request.getSession().getServletContext();
-		realPath = context.getRealPath(path);
-		realPath = context.getRealPath(path);
-		return realPath;
-	}
-}

+ 0 - 26
railway-generator/src/main/java/com/railway/generator/util/CodeGenerateException.java

@@ -1,26 +0,0 @@
-package com.railway.generator.util;
-
-public class CodeGenerateException extends RuntimeException {
-    private static final long serialVersionUID = 42L;
-    public CodeGenerateException() {
-        super();
-    }
-
-    public CodeGenerateException(String msg) {
-        super(msg);
-    }
-
-    public CodeGenerateException(String msg, Throwable cause) {
-        super(msg, cause);
-    }
-
-    public CodeGenerateException(Throwable cause) {
-        super(cause);
-    }
-
-    public CodeGenerateException(String message, Throwable cause,
-                            boolean enableSuppression,
-                            boolean writableStackTrace) {
-        super(message, cause, enableSuppression, writableStackTrace);
-    }
-}

+ 0 - 24
railway-generator/src/main/java/com/railway/generator/util/CodeGeneratorTool.java

@@ -1,24 +0,0 @@
-package com.railway.generator.util;
-
-
-import com.railway.generator.entity.ClassInfo;
-
-import java.io.IOException;
-
-/**
- * code generate tool
- *
- */
-public class CodeGeneratorTool {
-
-    /**
-     * process Table Into ClassInfo
-     *
-     * @param tableSql
-     * @return
-     */
-    public static ClassInfo processTableIntoClassInfo(String tableSql) throws IOException {
-        return TableParseUtil.processTableIntoClassInfo(tableSql);
-    }
-
-}

+ 0 - 30
railway-generator/src/main/java/com/railway/generator/util/FileUtil.java

@@ -1,30 +0,0 @@
-package com.railway.generator.util;
-
-import java.io.*;
-
-public class FileUtil {
-    /**
-     * 读取字符串,生成txt 文件 已解决未设置编码时,在项目中直接打开文件,中文乱码问题
-     * WriteText.writeToText(musicInfo,fileName)直接调用
-     *
-     */
-    public static void writeToFile(String filePath, String fileInfo) throws IOException {
-        // 生成的文件路径
-//        String path = "G:\\data\\" + fileName + ".txt";
-        String path = filePath;
-        File file = new File(path);
-        if (!file.exists()) {
-            file.getParentFile().mkdirs();
-        }
-        file.createNewFile();
-        // write 解决中文乱码问题
-        // FileWriter fw = new FileWriter(file, true);
-        OutputStreamWriter fw = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
-        BufferedWriter bw = new BufferedWriter(fw);
-        bw.write(fileInfo);
-        bw.flush();
-        bw.close();
-        fw.close();
-
-    }
-}

+ 0 - 58
railway-generator/src/main/java/com/railway/generator/util/FreemarkerTool.java

@@ -1,58 +0,0 @@
-package com.railway.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
- *
- */
-@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();
-    }
-
-    /**
-     * process String
-     *
-     * @param templateName
-     * @param params
-     * @return
-     * @throws IOException
-     * @throws TemplateException
-     */
-    public String processString(String templateName, Map<String, Object> params)
-            throws IOException, TemplateException {
-
-        Template template = configuration.getTemplate(templateName);
-        String htmlText = processTemplateIntoString(template, params);
-        return htmlText;
-    }
-
-
-}

+ 0 - 81
railway-generator/src/main/java/com/railway/generator/util/FreemarkerUtil.java

@@ -1,81 +0,0 @@
-package com.railway.generator.util;
-
-import freemarker.template.Configuration;
-import freemarker.template.Template;
-import freemarker.template.TemplateException;
-import freemarker.template.TemplateExceptionHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * freemarker tool
- *
- */
-public class FreemarkerUtil {
-    private static final Logger logger = LoggerFactory.getLogger(CodeGeneratorTool.class);
-
-    /**
-     * freemarker config
-     */
-    private static Configuration freemarkerConfig = new Configuration(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS);
-    static{
-        String templatePath = Thread.currentThread().getContextClassLoader().getResource("").getPath();
-        int wei = templatePath.lastIndexOf("WEB-INF/classes/");
-        if (wei > -1) {
-            templatePath = templatePath.substring(0, wei);
-        }
-
-        try {
-            freemarkerConfig.setDirectoryForTemplateLoading(new File(templatePath, "templates/xxl-code-generator"));
-            freemarkerConfig.setNumberFormat("#");
-            freemarkerConfig.setClassicCompatible(true);
-            freemarkerConfig.setDefaultEncoding("UTF-8");
-            freemarkerConfig.setLocale(Locale.CHINA);
-            freemarkerConfig.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
-        } catch (IOException e) {
-            logger.error(e.getMessage(), e);
-        }
-    }
-
-    /**
-     * process Template Into String
-     *
-     * @param template
-     * @param model
-     * @return
-     * @throws IOException
-     * @throws TemplateException
-     */
-    public static String processTemplateIntoString(Template template, Object model)
-            throws IOException, TemplateException {
-
-        StringWriter result = new StringWriter();
-        template.process(model, result);
-        return result.toString();
-    }
-
-    /**
-     * process String
-     *
-     * @param templateName
-     * @param params
-     * @return
-     * @throws IOException
-     * @throws TemplateException
-     */
-    public static String processString(String templateName, Map<String, Object> params)
-            throws IOException, TemplateException {
-
-        Template template = freemarkerConfig.getTemplate(templateName);
-        String htmlText = processTemplateIntoString(template, params);
-        return htmlText;
-    }
-
-
-}

+ 0 - 71
railway-generator/src/main/java/com/railway/generator/util/StringPlusUtils.java

@@ -1,71 +0,0 @@
-package com.railway.generator.util;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * string tool
- */
-public class StringPlusUtils {
-    private static Pattern humpPattern = Pattern.compile("[A-Z]");
-
-    /**
-     * 首字母大写
-     *
-     * @param str
-     * @return
-     */
-    public static String upperCaseFirst(String str) {
-        return str.substring(0, 1).toUpperCase() + str.substring(1);
-    }
-
-    /**
-     * 首字母小写
-     *
-     * @param str
-     * @return
-     */
-    public static String lowerCaseFirst(String str) {
-        return str.substring(0, 1).toLowerCase() + str.substring(1);
-    }
-
-    /**
-     * 下划线,转换为驼峰式
-     *
-     * @param underscoreName
-     * @return
-     */
-    public static String underlineToCamelCase(String underscoreName) {
-        StringBuilder result = new StringBuilder();
-        if (underscoreName != null && underscoreName.trim().length() > 0) {
-            boolean flag = false;
-            for (int i = 0; i < underscoreName.length(); i++) {
-                char ch = underscoreName.charAt(i);
-                if ("_".charAt(0) == ch) {
-                    flag = true;
-                } else {
-                    if (flag) {
-                        result.append(Character.toUpperCase(ch));
-                        flag = false;
-                    } else {
-                        result.append(ch);
-                    }
-                }
-            }
-        }
-        return result.toString();
-    }
-
-    /**
-     * 驼峰转下划线,效率比上面高
-     */
-    public static String camelCaseToUnderline(String str) {
-        Matcher matcher = humpPattern.matcher(str);
-        StringBuffer sb = new StringBuffer();
-        while (matcher.find()) {
-            matcher.appendReplacement(sb, "_" + matcher.group(0).toLowerCase());
-        }
-        matcher.appendTail(sb);
-        return sb.toString();
-    }
-}

+ 0 - 60
railway-generator/src/main/java/com/railway/generator/util/StringUtils.java

@@ -1,60 +0,0 @@
-package com.railway.generator.util;
-
-/**
- * string tool
- *
- */
-public class StringUtils {
-
-    /**
-     * 首字母大写
-     *
-     * @param str
-     * @return
-     */
-    public static String upperCaseFirst(String str) {
-        return str.substring(0, 1).toUpperCase() + str.substring(1);
-    }
-
-    /**
-     * 首字母小写
-     *
-     * @param str
-     * @return
-     */
-    public static String lowerCaseFirst(String str) {
-        //2019-2-10 解决StringUtils.lowerCaseFirst潜在的NPE异常@liutf
-        return (str!=null&&str.length()>1)?str.substring(0, 1).toLowerCase() + str.substring(1):"";
-    }
-
-    /**
-     * 下划线,转换为驼峰式
-     *
-     * @param underscoreName
-     * @return
-     */
-    public static String underlineToCamelCase(String underscoreName) {
-        StringBuilder result = new StringBuilder();
-        if (underscoreName != null && underscoreName.trim().length() > 0) {
-            boolean flag = false;
-            for (int i = 0; i < underscoreName.length(); i++) {
-                char ch = underscoreName.charAt(i);
-                if ("_".charAt(0) == ch) {
-                    flag = true;
-                } else {
-                    if (flag) {
-                        result.append(Character.toUpperCase(ch));
-                        flag = false;
-                    } else {
-                        result.append(ch);
-                    }
-                }
-            }
-        }
-        return result.toString();
-    }
-
-//    public static void main(String[] args) {
-//
-//    }
-}

+ 0 - 294
railway-generator/src/main/java/com/railway/generator/util/TableParseUtil.java

@@ -1,294 +0,0 @@
-package com.railway.generator.util;
-
-
-import com.railway.generator.entity.ClassInfo;
-import com.railway.generator.entity.FieldInfo;
-
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class TableParseUtil {
-
-    /**
-     * 解析建表SQL生成代码(model-dao-xml)
-     *
-     * @param tableSql
-     * @return
-     */
-    public static ClassInfo processTableIntoClassInfo(String tableSql) throws IOException {
-        if (tableSql == null || tableSql.trim().length() == 0) {
-            throw new CodeGenerateException("Table structure can not be empty.");
-        }
-        tableSql = tableSql.trim().replaceAll("'", "`").replaceAll("\"", "`").replaceAll(",", ",").toLowerCase();
-
-        // table Name
-        String tableName = null;
-        if (tableSql.contains("TABLE") && tableSql.contains("(")) {
-            tableName = tableSql.substring(tableSql.indexOf("TABLE") + 5, tableSql.indexOf("("));
-        } else if (tableSql.contains("table") && tableSql.contains("(")) {
-            tableName = tableSql.substring(tableSql.indexOf("table") + 5, tableSql.indexOf("("));
-        } else {
-            throw new CodeGenerateException("Table structure anomaly.");
-        }
-
-        //新增处理create table if not exists members情况
-        if (tableName.contains("if not exists")) tableName = tableName.replaceAll("if not exists", "");
-
-        if (tableName.contains("`")) {
-            tableName = tableName.substring(tableName.indexOf("`") + 1, tableName.lastIndexOf("`"));
-        } else {
-            //空格开头的,需要替换掉\n\t空格
-            tableName = tableName.replaceAll(" ", "").replaceAll("\n", "").replaceAll("\t", "");
-        }
-        //优化对byeas`.`ct_bd_customerdiscount这种命名的支持
-        if (tableName.contains("`.`")) {
-            tableName = tableName.substring(tableName.indexOf("`.`") + 3);
-        } else if (tableName.contains(".")) {
-            //优化对likeu.members这种命名的支持
-            tableName = tableName.substring(tableName.indexOf(".") + 1);
-        }
-        // class Name
-        String className = StringUtils.upperCaseFirst(StringUtils.underlineToCamelCase(tableName));
-        if (className.contains("_")) {
-            className = className.replaceAll("_", "");
-        }
-
-        // class Comment
-        String classComment = null;
-        //mysql是comment=,pgsql/oracle是comment on table,
-        if (tableSql.contains("comment=")) {
-            String classCommentTmp = tableSql.substring(tableSql.lastIndexOf("comment=") + 8).replaceAll("`", "").trim();
-            if (classCommentTmp.indexOf(" ") != classCommentTmp.lastIndexOf(" ")) {
-                classCommentTmp = classCommentTmp.substring(classCommentTmp.indexOf(" ") + 1, classCommentTmp.lastIndexOf(" "));
-            }
-            if (classCommentTmp != null && classCommentTmp.trim().length() > 0) {
-                classComment = classCommentTmp;
-            } else {
-                //修复表备注为空问题
-                classComment = className;
-            }
-        } else if (tableSql.contains("comment on table")) {
-            //COMMENT ON TABLE CT_BAS_FEETYPE IS 'CT_BAS_FEETYPE';
-            String classCommentTmp = tableSql.substring(tableSql.lastIndexOf("comment on table") + 17).trim();
-            //证明这是一个常规的COMMENT ON TABLE  xxx IS 'xxxx'
-            if (classCommentTmp.contains("`")) {
-                classCommentTmp = classCommentTmp.substring(classCommentTmp.indexOf("`") + 1);
-                classCommentTmp = classCommentTmp.substring(0, classCommentTmp.indexOf("`"));
-                classComment = classCommentTmp;
-            } else {
-                //非常规的没法分析
-                classComment = tableName;
-            }
-        } else if (tableSql.contains("comment ")) {
-            String classCommentTmp = tableSql.substring(tableSql.lastIndexOf("comment ") + 8).replaceAll("`", "").trim();
-            if (classCommentTmp.indexOf(" ") != classCommentTmp.lastIndexOf(" ")) {
-                classCommentTmp = classCommentTmp.substring(classCommentTmp.indexOf(" ") + 1, classCommentTmp.lastIndexOf(" "));
-            }
-            if (classCommentTmp != null && classCommentTmp.trim().length() > 0) {
-                classComment = classCommentTmp;
-            } else {
-                //修复表备注为空问题
-                classComment = className;
-            }
-        } else {
-            //修复表备注为空问题
-            classComment = tableName;
-        }
-        //如果备注跟;混在一起,需要替换掉
-        classComment = classComment.replaceAll(";", "");
-        // field List
-        List<FieldInfo> fieldList = new ArrayList<FieldInfo>();
-
-        // 正常( ) 内的一定是字段相关的定义。
-        String fieldListTmp = tableSql.substring(tableSql.indexOf("(") + 1, tableSql.lastIndexOf(")"));
-
-        // 匹配 comment,替换备注里的小逗号, 防止不小心被当成切割符号切割
-        Matcher matcher = Pattern.compile("comment `(.*?)\\`").matcher(fieldListTmp);     // "\\{(.*?)\\}"
-        while (matcher.find()) {
-
-            String commentTmp = matcher.group();
-            //2018-9-27 zhengk 不替换,只处理,支持COMMENT评论里面多种注释
-            //commentTmp = commentTmp.replaceAll("\\ comment `|\\`", " ");      // "\\{|\\}"
-
-            if (commentTmp.contains(",")) {
-                String commentTmpFinal = commentTmp.replaceAll(",", ",");
-                fieldListTmp = fieldListTmp.replace(matcher.group(), commentTmpFinal);
-            }
-        }
-        //2018-10-18 zhengkai 新增支持double(10, 2)等类型中有英文逗号的特殊情况
-        Matcher matcher2 = Pattern.compile("\\`(.*?)\\`").matcher(fieldListTmp);     // "\\{(.*?)\\}"
-        while (matcher2.find()) {
-            String commentTmp2 = matcher2.group();
-            if (commentTmp2.contains(",")) {
-                String commentTmpFinal = commentTmp2.replaceAll(",", ",").replaceAll("\\(", "(").replaceAll("\\)", ")");
-                fieldListTmp = fieldListTmp.replace(matcher2.group(), commentTmpFinal);
-            }
-        }
-        //2018-10-18 zhengkai 新增支持double(10, 2)等类型中有英文逗号的特殊情况
-        Matcher matcher3 = Pattern.compile("\\((.*?)\\)").matcher(fieldListTmp);     // "\\{(.*?)\\}"
-        while (matcher3.find()) {
-            String commentTmp3 = matcher3.group();
-            if (commentTmp3.contains(",")) {
-                String commentTmpFinal = commentTmp3.replaceAll(",", ",");
-                fieldListTmp = fieldListTmp.replace(matcher3.group(), commentTmpFinal);
-            }
-        }
-        String[] fieldLineList = fieldListTmp.split(",");
-        if (fieldLineList.length > 0) {
-            int i = 0;
-            //i为了解决primary key关键字出现的地方,出现在前3行,一般和id有关
-            for (String columnLine : fieldLineList) {
-                i++;
-                columnLine = columnLine.replaceAll("\n", "").replaceAll("\t", "").trim();
-                // `userid` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
-                // 2018-9-18 zhengk 修改为contains,提升匹配率和匹配不按照规矩出牌的语句
-                // 2018-11-8 zhengkai 修复tornadoorz反馈的KEY FK_permission_id (permission_id),KEY FK_role_id (role_id)情况
-                // 2019-2-22 zhengkai 要在条件中使用复杂的表达式
-                // 2019-4-29 zhengkai 优化对普通和特殊storage关键字的判断(感谢@AhHeadFloating的反馈 )
-                boolean specialFlag = (!columnLine.contains("key ") && !columnLine.contains("constraint") && !columnLine.contains("using") && !columnLine.contains("unique")
-                        && !(columnLine.contains("primary") && columnLine.indexOf("storage") + 3 > columnLine.indexOf("("))
-                        && !columnLine.contains("pctincrease")
-                        && !columnLine.contains("buffer_pool") && !columnLine.contains("tablespace")
-                        && !(columnLine.contains("primary") && i > 3));
-
-                if (specialFlag) {
-                    //如果是oracle的number(x,x),可能出现最后分割残留的,x),这里做排除处理
-                    if (columnLine.length() < 5) {
-                        continue;
-                    }
-                    //2018-9-16 zhengkai 支持'符号以及空格的oracle语句// userid` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
-                    String columnName = "";
-                    columnLine = columnLine.replaceAll("`", " ").replaceAll("\"", " ").replaceAll("'", "").replaceAll("  ", " ").trim();
-                    //如果遇到username varchar(65) default '' not null,这种情况,判断第一个空格是否比第一个引号前
-                    columnName = columnLine.substring(0, columnLine.indexOf(" "));
-
-                    // field Name
-                    String fieldName = StringUtils.lowerCaseFirst(StringUtils.underlineToCamelCase(columnName));
-                    if (fieldName.contains("_")) {
-                        fieldName = fieldName.replaceAll("_", "");
-                    }
-
-                    // field class
-                    columnLine = columnLine.substring(columnLine.indexOf("`") + 1).trim();
-                    // int(11) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
-                    String fieldClass = Object.class.getSimpleName();
-                    Integer fieldLength = 0;
-                    //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")) {
-                        fieldClass = Integer.class.getSimpleName();
-                    } else if (columnLine.contains("bigint")) {
-                        fieldClass = Long.class.getSimpleName();
-                    } else if (columnLine.contains("float")) {
-                        fieldClass = Float.class.getSimpleName();
-                    } else if (columnLine.contains("double")) {
-                        fieldClass = Double.class.getSimpleName();
-                    }else if (columnLine.contains("varchar") || columnLine.contains(" text") || columnLine.contains("char")
-                            || columnLine.contains("clob") || columnLine.contains("blob") || columnLine.contains("json")) {
-                        int startKh = columnLine.indexOf("(");
-                        if (startKh >= 0) {
-                            int endKh = columnLine.indexOf(")", startKh);
-                            fieldLength = Integer.parseInt(columnLine.substring(startKh + 1, endKh));
-                        }
-                        fieldClass = String.class.getSimpleName();
-                    }else if (columnLine.contains("date") || columnLine.contains("datetime") || columnLine.contains("timestamp")) {
-                        fieldClass = Date.class.getSimpleName();
-                    }else if (columnLine.contains("decimal") || columnLine.contains(" number")) {
-                        //2018-11-22 lshz0088 建议对number类型增加int,long,BigDecimal的区分判断
-                        //如果startKh大于等于0,则表示有设置取值范围
-                        int startKh = columnLine.indexOf("(");
-                        if (startKh >= 0) {
-                            int endKh = columnLine.indexOf(")", startKh);
-                            String[] fanwei = columnLine.substring(startKh + 1, endKh).split(",");
-                            //2019-1-5 zhengk 修复@arthaschan反馈的超出范围错误
-                            //System.out.println("fanwei"+ JSON.toJSONString(fanwei));
-                            //                            //number(20,6) fanwei["20","6"]
-                            //                            //number(0,6) fanwei["0","6"]
-                            //                            //number(20,0) fanwei["20","0"]
-                            //                            //number(20) fanwei["20"]
-                            //如果括号里是1位或者2位且第二位为0,则进行特殊处理。只有有小数位,都设置为BigDecimal。
-                            if ((fanwei.length > 1 && "0".equals(fanwei[1])) || fanwei.length == 1) {
-                                int length = Integer.parseInt(fanwei[0]);
-                                if (fanwei.length > 1) {
-                                    length = Integer.valueOf(fanwei[1]);
-                                }
-                                //数字范围9位及一下用Integer,大的用Long
-                                if (length <= 9) {
-                                    fieldClass = Integer.class.getSimpleName();
-                                } else {
-                                    fieldClass = Long.class.getSimpleName();
-                                }
-                            } else {
-                                //有小数位数一律使用BigDecimal
-                                fieldClass = BigDecimal.class.getSimpleName();
-                            }
-                        } else {
-                            fieldClass = BigDecimal.class.getSimpleName();
-                        }
-                    } else {
-                        fieldClass = String.class.getSimpleName();
-                    }
-
-                    // field comment,MySQL的一般位于field行,而pgsql和oralce多位于后面。
-                    String fieldComment = null;
-                    if (tableSql.contains("comment on column") && (tableSql.contains("." + columnName + " is ") || tableSql.contains(".`" + columnName + "` is"))) {
-                        //新增对pgsql/oracle的字段备注支持
-                        //COMMENT ON COLUMN public.check_info.check_name IS '检查者名称';
-                        //2018-11-22 lshz0088 正则表达式的点号前面应该加上两个反斜杠,否则会认为是任意字符
-                        //2019-4-29 zhengkai 优化对oracle注释comment on column的支持(@liukex)
-                        tableSql = tableSql.replaceAll(".`" + columnName + "` is", "." + columnName + " is");
-                        Matcher columnCommentMatcher = Pattern.compile("\\." + columnName + " is `").matcher(tableSql);
-                        fieldComment = columnName;
-                        while (columnCommentMatcher.find()) {
-                            String columnCommentTmp = columnCommentMatcher.group();
-                            System.out.println(columnCommentTmp);
-                            fieldComment = tableSql.substring(tableSql.indexOf(columnCommentTmp) + columnCommentTmp.length()).trim();
-                            fieldComment = fieldComment.substring(0, fieldComment.indexOf("`")).trim();
-                        }
-                    } else if (columnLine.contains("comment")) {
-                        String commentTmp = columnLine.substring(columnLine.indexOf("comment") + 7).trim();
-                        // '用户ID',
-                        if (commentTmp.contains("`") || commentTmp.indexOf("`") != commentTmp.lastIndexOf("`")) {
-                            commentTmp = commentTmp.substring(commentTmp.indexOf("`") + 1, commentTmp.lastIndexOf("`"));
-                        }
-                        //解决最后一句是评论,无主键且连着)的问题:album_id int(3) default '1' null comment '相册id:0 代表头像 1代表照片墙')
-                        if (commentTmp.contains(")")) {
-                            commentTmp = commentTmp.substring(0, commentTmp.lastIndexOf(")") + 1);
-                        }
-                        fieldComment = commentTmp;
-                    } else {
-                        //修复comment不存在导致报错的问题
-                        fieldComment = columnName;
-                    }
-
-                    FieldInfo fieldInfo = new FieldInfo();
-                    fieldInfo.setColumnName(columnName);
-                    fieldInfo.setFieldName(fieldName);
-                    fieldInfo.setFieldClass(fieldClass);
-                    fieldInfo.setFieldComment(fieldComment);
-                    fieldInfo.setFieldLength(fieldLength);
-
-                    fieldList.add(fieldInfo);
-                }
-            }
-        }
-
-        if (fieldList.size() < 1) {
-            throw new CodeGenerateException("表结构分析失败");
-        }
-
-        ClassInfo codeJavaInfo = new ClassInfo();
-        codeJavaInfo.setTableName(tableName);
-        codeJavaInfo.setClassName(className);
-        codeJavaInfo.setClassComment(classComment);
-        codeJavaInfo.setFieldList(fieldList);
-
-        return codeJavaInfo;
-    }
-
-}

+ 0 - 37
railway-generator/src/main/resources/application.yml

@@ -1,37 +0,0 @@
-server:
-  port: 8082
-  servlet:
-      context-path: /railway/generator
-tomcat:
-    remote-ip-header: x-forward-for
-    uri-encoding: UTF-8
-    max-threads: 10
-    background-processor-delay: 30
-    basedir: ${user.home}/tomcat/
-spring:
-    cloud:
-      nacos:
-        discovery:
-          server-addr: 127.0.0.1:8848
-    banner:
-      charset: UTF-8
-    http:
-      encoding:
-        force: true
-        charset: UTF-8
-    application:
-        name: spring-boot-code-generator
-    freemarker:
-        request-context-attribute: request
-        suffix: .ftl
-        content-type: text/html
-        enabled: true
-        cache: false
-        charset: UTF-8
-        allow-request-override: false
-        expose-request-attributes: true
-        expose-session-attributes: true
-        expose-spring-macro-helpers: true
-        #template-loader-path: classpath:/templates/
-    mvc:
-      static-path-pattern: /static/**

+ 0 - 73
railway-generator/src/main/resources/templates/code-generator/beetlsql/beetlcontroller.ftl

@@ -1,73 +0,0 @@
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RestController;
-import java.util.List;
-import java.util.Map;
-
-/**
-* ${classInfo.classComment}
-* @author ${authorName} ${.now?string('yyyy-MM-dd')}
-*/
-@RestController
-@RequestMapping("/${classInfo.className?uncap_first}")
-public class ${classInfo.className}Controller {
-
-    @Autowired
-    private SQLManager sqlManager;
-
-    /**
-    * 新增或编辑
-    */
-    @PostMapping("/save")
-    public Object save(${classInfo.className} ${classInfo.className?uncap_first}){
-        ${classInfo.className} ${classInfo.className?uncap_first}=sqlManager.unique(${classInfo.className}.class,${classInfo.className?uncap_first}.getId());
-        if(${classInfo.className?uncap_first}!=null){
-            sqlManager.updateById(${classInfo.className?uncap_first});
-            return ${returnUtil}.success("编辑成功");
-        }else{
-            sqlManager.insert(${classInfo.className?uncap_first});
-            return ${returnUtil}.error("保存成功");
-        }
-    }
-
-    /**
-    * 删除
-    */
-    @PostMapping("/delete")
-    public Object delete(int id){
-        ${classInfo.className} ${classInfo.className?uncap_first}=sqlManager.unique(${classInfo.className}.class,id);
-        if(${classInfo.className?uncap_first}!=null){
-            sqlManager.deleteById(id);
-            return ${returnUtil}.success("删除成功");
-        }else{
-            return ${returnUtil}.error("没有找到该对象");
-        }
-    }
-
-    /**
-    * 查询
-    */
-    @PostMapping("/find")
-    public Object find(int id){
-        ${classInfo.className} ${classInfo.className?uncap_first}=sqlManager.unique(${classInfo.className}.class,id);
-        if(${classInfo.className?uncap_first}!=null){
-            return ${returnUtil}.success(${classInfo.className?uncap_first});
-        }else{
-            return ${returnUtil}.error("没有找到该对象");
-        }
-    }
-
-    /**
-    * 分页查询
-    */
-    @PostMapping("/list")
-    public Object list(${classInfo.className} ${classInfo.className?uncap_first},
-                        @RequestParam(required = false, defaultValue = "0") int pageNumber,
-                        @RequestParam(required = false, defaultValue = "10") int pageSize) {
-            List<${classInfo.className}> list = sqlManager.query(${classInfo.className}.class).select();
-            return ${returnUtil}.success(list);
-    }
-
-}

+ 0 - 26
railway-generator/src/main/resources/templates/code-generator/beetlsql/beetlentity.ftl

@@ -1,26 +0,0 @@
-import java.io.Serializable;
-import lombok.Data;
-import java.util.Date;
-import java.util.List;
-
-/**
-*  ${classInfo.classComment}
-* @author ${authorName} ${.now?string('yyyy-MM-dd')}
-*/
-@Data
-public class ${classInfo.className} implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-<#list classInfo.fieldList as fieldItem >
-    /**
-    * ${fieldItem.fieldComment}
-    */
-    private ${fieldItem.fieldClass} ${fieldItem.fieldName};
-
-</#list>
-    public ${classInfo.className}() {
-    }
-</#if>
-
-}

+ 0 - 26
railway-generator/src/main/resources/templates/code-generator/beetlsql/beetlentitydto.ftl

@@ -1,26 +0,0 @@
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.io.Serializable;
-import lombok.Data;
-import java.util.Date;
-import java.util.List;
-
-/**
- * ${classInfo.classComment}
- * @author ${authorName} ${.now?string('yyyy-MM-dd')}
- */
-@Data
-@ApiModel("${classInfo.classComment}")
-public class ${classInfo.className}DTO {
-
-<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-<#list classInfo.fieldList as fieldItem >
-    @ApiModelProperty("${fieldItem.fieldComment}")
-    private ${fieldItem.fieldClass} ${fieldItem.fieldName};
-
-</#list>
-    public ${classInfo.className}() {
-    }
-</#if>
-
-}

+ 0 - 31
railway-generator/src/main/resources/templates/code-generator/beetlsql/beetlmd.ftl

@@ -1,31 +0,0 @@
-sample
-===
-
-select #use("cols")# from ${classInfo.tableName} where #use("condition")#
-
-cols
-===
-<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-    <#list classInfo.fieldList as fieldItem >
-        `${fieldItem.columnName}`<#if fieldItem_has_next>,</#if>
-    </#list>
-</#if>
-
-updateSample
-===
-<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-    <#list classInfo.fieldList as fieldItem >
-        `${fieldItem.columnName}=#${fieldItem.fieldName}#`<#if fieldItem_has_next>,</#if>
-    </#list>
-</#if>
-
-condition
-===
-    1 = 1
-<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-    <#list classInfo.fieldList as fieldItem >
-    @if(!isEmpty(${fieldItem.fieldName})){
-      and `${fieldItem.columnName}`=#${fieldItem.fieldName}#
-    @}
-    </#list>
-</#if>

+ 0 - 20
railway-generator/src/main/resources/templates/code-generator/jdbc-template/jtdao.ftl

@@ -1,20 +0,0 @@
-
-import java.util.List;
-
-/**
-* ${classInfo.classComment}
-* @author ${authorName} ${.now?string('yyyy-MM-dd')}
-*/
-public interface I${classInfo.className}DAO {
-
-    int add(${classInfo.className} ${classInfo.className?uncap_first});
-
-    int update(${classInfo.className} ${classInfo.className?uncap_first});
-
-    int delete(int id);
-
-    ${classInfo.className} findById(int id);
-
-    List<${classInfo.className}> findAllList(Map<String,Object> param);
-
-}

+ 0 - 60
railway-generator/src/main/resources/templates/code-generator/jdbc-template/jtdaoimpl.ftl

@@ -1,60 +0,0 @@
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.BeanPropertyRowMapper;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
-* ${classInfo.classComment}
-* @author ${authorName} ${.now?string('yyyy-MM-dd')}
-*/
-@Repository
-public class ${classInfo.className}DaoImpl implements I${classInfo.className}Dao{
-
-    @Autowired
-    private JdbcTemplate jdbcTemplate;
-
-    @Override
-    public int add(${classInfo.className} ${classInfo.className?uncap_first}) {
-        return jdbcTemplate.update("insert into ${classInfo.tableName}  (<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0><#list classInfo.fieldList as fieldItem ><#if fieldItem_index gt 0>${fieldItem.columnName}<#if fieldItem_has_next>,</#if></#if></#list></#if> ) values (<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0><#list classInfo.fieldList as fieldItem >?<#if fieldItem_has_next>,</#if></#list></#if> )",
-        <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0><#list classInfo.fieldList as fieldItem ><#if fieldItem_index gt 0 >${classInfo.className?uncap_first}.get${fieldItem.fieldName?cap_first}()<#if fieldItem_has_next>,</#if></#if></#list></#if>);
-    }
-
-    @Override
-    public int update(${classInfo.className} ${classInfo.className?uncap_first}) {
-        return jdbcTemplate.update("UPDATE  ${classInfo.tableName}  SET <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0><#list classInfo.fieldList as fieldItem ><#if fieldItem_index gt 0 >${fieldItem.columnName}=?<#if fieldItem_has_next>,</#if></#if></#list></#if>"
-        +" where <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0><#list classInfo.fieldList as fieldItem ><#if fieldItem_index = 0>${fieldItem.columnName}=?<#break ></#if></#list></#if>",
-        <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-            <#list classInfo.fieldList as fieldItem ><#if fieldItem_index gt 0 >${classInfo.className?uncap_first}.get${fieldItem.fieldName?cap_first}(),</#if></#list>
-            <#list classInfo.fieldList as fieldItem ><#if fieldItem_index = 0 >${classInfo.className?uncap_first}.get${fieldItem.fieldName?cap_first}()</#if></#list>
-        </#if>;
-    }
-
-    @Override
-    public int delete(int id) {
-        return jdbcTemplate.update("DELETE from ${classInfo.tableName} where <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0><#list classInfo.fieldList as fieldItem ><#if fieldItem_index = 0>${fieldItem.columnName}=?<#break ></#if></#list></#if>",id);
-    }
-
-    @Override
-    public ${classInfo.className} findById(int id) {
-        List<${classInfo.className}> list = jdbcTemplate.query("select * from ${classInfo.tableName} where <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0><#list classInfo.fieldList as fieldItem ><#if fieldItem_index = 0>${fieldItem.columnName}=?<#break ></#if></#list></#if>", new Object[]{id}, new BeanPropertyRowMapper<${classInfo.className}>(${classInfo.className}.class));
-        if(list!=null && list.size()>0){
-            ${classInfo.className} ${classInfo.className?uncap_first} = list.get(0);
-            return ${classInfo.className?uncap_first};
-        }else{
-             return null;
-        }
-    }
-
-    @Override
-    public List<${classInfo.className}> findAllList(Map<String,Object> params) {
-        List<${classInfo.className}> list = jdbcTemplate.query("select * from ${classInfo.tableName}", new Object[]{}, new BeanPropertyRowMapper<${classInfo.className}>(${classInfo.className}.class));
-        if(list!=null && list.size()>0){
-            return list;
-        }else{
-            return null;
-        }
-    }
-
-}

+ 0 - 30
railway-generator/src/main/resources/templates/code-generator/jpa/entity.ftl

@@ -1,30 +0,0 @@
-import java.io.Serializable;
-import javax.persistence.*;
-import lombok.Data;
-import java.util.Date;
-import java.util.List;
-
-/**
-*  ${classInfo.classComment}
-* @author ${authorName} ${.now?string('yyyy-MM-dd')}
-*/
-@Entity
-@Data
-@Table(name="${classInfo.tableName}")
-public class ${classInfo.className} implements Serializable {
-    private static final long serialVersionUID = 1L;
-    @Id
-    @GeneratedValue
-<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-<#list classInfo.fieldList as fieldItem >
-    /**
-    * ${fieldItem.fieldComment}
-    */
-    private ${fieldItem.fieldClass} ${fieldItem.fieldName};
-
-</#list>
-    public ${classInfo.className}() {
-    }
-</#if>
-
-}

+ 0 - 82
railway-generator/src/main/resources/templates/code-generator/jpa/jpacontroller.ftl

@@ -1,82 +0,0 @@
-package ${packageName}.controller;
-
-import ${packageName}.entity.${classInfo.className};
-import ${packageName}.repository.${classInfo.className}Repository;
-import org.springframework.data.domain.Example;
-import org.springframework.data.domain.Pageable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.data.domain.ExampleMatcher;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RestController;
-import java.util.List;
-import java.util.Map;
-
-/**
-* ${classInfo.classComment}
-* @author ${authorName} ${.now?string('yyyy-MM-dd')}
-*/
-@RestController
-@RequestMapping("/${classInfo.className?uncap_first}")
-public class ${classInfo.className}Controller {
-
-    @Autowired
-    private ${classInfo.className}Repository ${classInfo.className?uncap_first}Repository;
-
-    /**
-    * 新增或编辑
-    */
-    @PostMapping("/save")
-    public Object save(${classInfo.className} ${classInfo.className?uncap_first}){
-        return ${classInfo.className?uncap_first}Repository.save(${classInfo.className?uncap_first});
-    }
-
-    /**
-    * 删除
-    */
-    @PostMapping("/delete")
-    public Object delete(int id){
-        Optional<${classInfo.className}> ${classInfo.className?uncap_first}=${classInfo.className?uncap_first}Repository.findById(id);
-        if(${classInfo.className?uncap_first}.isPresent()){
-            ${classInfo.className?uncap_first}Repository.deleteById(id);
-            return ${returnUtil}.success("删除成功");
-        }else{
-            return ${returnUtil}.error("没有找到该对象");
-        }
-    }
-
-    /**
-    * 查询
-    */
-    @PostMapping("/find")
-    public Object find(int id){
-        Optional<${classInfo.className}> ${classInfo.className?uncap_first}=${classInfo.className?uncap_first}Repository.findById(id);
-        if(${classInfo.className?uncap_first}.isPresent()){
-            return ${returnUtil}.success(${classInfo.className?uncap_first}.get());
-        }else{
-            return ${returnUtil}.error("没有找到该对象");
-        }
-    }
-
-    /**
-    * 分页查询
-    */
-    @PostMapping("/list")
-    public Object list(${classInfo.className} ${classInfo.className?uncap_first},
-                        @RequestParam(required = false, defaultValue = "0") int pageNumber,
-                        @RequestParam(required = false, defaultValue = "10") int pageSize) {
-
-            //创建匹配器,需要查询条件请修改此处代码
-            ExampleMatcher matcher = ExampleMatcher.matchingAll();
-
-            //创建实例
-            Example<${classInfo.className}> example = Example.of(${classInfo.className?uncap_first}, matcher);
-            //分页构造
-            Pageable pageable = PageRequest.of(pageNumber,pageSize);
-
-            return ${classInfo.className?uncap_first}Repository.findAll(example, pageable);
-    }
-
-}

+ 0 - 25
railway-generator/src/main/resources/templates/code-generator/jpa/repository.ftl

@@ -1,25 +0,0 @@
-package ${packageName}.mapper;
-import ${packageName}.entity.${classInfo.className};
-
-<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-    <#list classInfo.fieldList as fieldItem >
-        <#if fieldItem.fieldClass == "Date">
-            <#assign importDdate = true />
-        </#if>
-    </#list>
-</#if>
-import java.util.List;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.stereotype.Repository;
-
-/**
-*  ${classInfo.classComment}
-* @author ${authorName} ${.now?string('yyyy-MM-dd')}
-*/
-@Repository
-public interface ${classInfo.className}Repository extends JpaRepository<${classInfo.className},Integer> {
-
-
-
-}

+ 0 - 81
railway-generator/src/main/resources/templates/code-generator/mybatis-plus/pluscontroller.ftl

@@ -1,81 +0,0 @@
-package ${packageName}.controller;
-
-import ${packageName}.entity.${classInfo.className};
-import ${packageName}.mapper.${classInfo.className}Mapper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import java.util.List;
-import java.util.Map;
-
-/**
-* ${classInfo.classComment}
-* @author ${authorName} ${.now?string('yyyy-MM-dd')}
-*/
-@RestController
-@RequestMapping("/${classInfo.className?uncap_first}")
-public class ${classInfo.className}Controller {
-
-    @Autowired
-    private ${classInfo.className}Mapper ${classInfo.className?uncap_first}Mapper;
-
-    /**
-    * 新增或编辑
-    */
-    @PostMapping("/save")
-    public Object save(${classInfo.className} ${classInfo.className?uncap_first}){
-        ${classInfo.className} ${classInfo.className?uncap_first} = ${classInfo.className?uncap_first}Mapper.selectOne(new QueryWrapper<${classInfo.className}>().eq("id",id))
-        if(${classInfo.className?uncap_first}!=null){
-            ${classInfo.className?uncap_first}Mapper.updateById(${classInfo.className?uncap_first});
-        }else{
-            ${classInfo.className?uncap_first}Mapper.insert(${classInfo.className?uncap_first});
-        }
-        return ${returnUtil}.success(${classInfo.className?uncap_first});
-    }
-
-    /**
-    * 删除
-    */
-    @PostMapping("/delete")
-    public Object delete(int id){
-        ${classInfo.className} ${classInfo.className?uncap_first} = ${classInfo.className?uncap_first}Mapper.selectOne(new QueryWrapper<${classInfo.className}>().eq("id",id))
-        if(${classInfo.className?uncap_first}!=null){
-            return ${returnUtil}.success(${classInfo.className?uncap_first});
-        }else{
-            return ${returnUtil}.error("没有找到该对象");
-        }
-    }
-
-    /**
-    * 查询
-    */
-    @PostMapping("/find")
-    public Object find(int id){
-        ${classInfo.className} ${classInfo.className?uncap_first} = ${classInfo.className?uncap_first}Mapper.selectOne(new QueryWrapper<${classInfo.className}>().eq("id",id))
-        if(${classInfo.className?uncap_first}!=null){
-            return ${returnUtil}.success(${classInfo.className?uncap_first});
-        }else{
-            return ${returnUtil}.error("没有找到该对象");
-        }
-    }
-
-    /**
-    * 分页查询
-    */
-    @PostMapping("/list")
-    public Object list(${classInfo.className} ${classInfo.className?uncap_first},
-                        @RequestParam(required = false, defaultValue = "0") int pageNumber,
-                        @RequestParam(required = false, defaultValue = "10") int pageSize) {
-        //分页构造器
-        Page<${classInfo.className}> page = new Page<${classInfo.className}>(pageNumber,pageSize);
-        //条件构造器
-        QueryWrapper<${classInfo.className}> queryWrapperw = new QueryWrapper<${classInfo.className}>(${classInfo.className?uncap_first});
-        //执行分页
-        IPage<${classInfo.className}> pageList = certPersonMapper.selectPage(page, queryWrapperw);
-        //返回结果
-        return ${returnUtil}.success(pageList);
-    }
-
-}

+ 0 - 14
railway-generator/src/main/resources/templates/code-generator/mybatis-plus/plusmapper.ftl

@@ -1,14 +0,0 @@
-package ${packageName}.mapper;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.springframework.stereotype.Repository;
-
-/**
-*  ${classInfo.classComment}
-* @author ${authorName} ${.now?string('yyyy-MM-dd')}
-*/
-@Repository
-public interface ${classInfo.className}Mapper extends BaseMapper<${classInfo.className}> {
-
-
-
-}

+ 0 - 74
railway-generator/src/main/resources/templates/code-generator/mybatis/controller.ftl

@@ -1,74 +0,0 @@
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-import java.util.Map;
-
-/**
-* ${classInfo.classComment}
-* @author ${authorName}
-* @date ${.now?string('yyyy/MM/dd')}
-*/
-@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")
-    public ReturnT<String> 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")
-    public ReturnT<String> delete(int id){
-        return ${classInfo.className?uncap_first}Service.delete(id);
-    }
-
-    /**
-    * [更新]
-    * @author ${authorName}
-    * @date ${.now?string('yyyy/MM/dd')}
-    **/
-    @RequestMapping("/update")
-    public ReturnT<String> update(${classInfo.className} ${classInfo.className?uncap_first}){
-        return ${classInfo.className?uncap_first}Service.update(${classInfo.className?uncap_first});
-    }
-
-    /**
-    * [查詢] 根據主鍵 id 查詢
-    * @author ${authorName}
-    * @date ${.now?string('yyyy/MM/dd')}
-    **/
-    @RequestMapping("/load")
-    public ReturnT<String> load(int id){
-        return ${classInfo.className?uncap_first}Service.load(id);
-    }
-
-    /**
-    * [查詢] 分頁查詢
-    * @author ${authorName}
-    * @date ${.now?string('yyyy/MM/dd')}
-    **/
-    @RequestMapping("/pageList")
-    public Map<String, Object> pageList(@RequestParam(required = false, defaultValue = "0") int offset,
-                                        @RequestParam(required = false, defaultValue = "10") int pagesize) {
-        return ${classInfo.className?uncap_first}Service.pageList(offset, pagesize);
-    }
-
-}

+ 0 - 59
railway-generator/src/main/resources/templates/code-generator/mybatis/mapper.ftl

@@ -1,59 +0,0 @@
-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(@Param("${classInfo.className?uncap_first}") ${classInfo.className} ${classInfo.className?uncap_first});
-
-    /**
-    * [刪除]
-    * @author ${authorName}
-    * @date ${.now?string('yyyy/MM/dd')}
-    **/
-    int delete(@Param("id") int id);
-
-    /**
-    * [更新]
-    * @author ${authorName}
-    * @date ${.now?string('yyyy/MM/dd')}
-    **/
-    int update(@Param("${classInfo.className?uncap_first}") ${classInfo.className} ${classInfo.className?uncap_first});
-
-    /**
-    * [查詢] 根據主鍵 id 查詢
-    * @author ${authorName}
-    * @date ${.now?string('yyyy/MM/dd')}
-    **/
-    ${classInfo.className} load(@Param("id") int id);
-
-    /**
-    * [查詢] 分頁查詢
-    * @author ${authorName}
-    * @date ${.now?string('yyyy/MM/dd')}
-    **/
-    List<${classInfo.className}> pageList(@Param("offset") int offset,
-                                                 @Param("pagesize") int pagesize);
-
-    /**
-    * [查詢] 分頁查詢 count
-    * @author ${authorName}
-    * @date ${.now?string('yyyy/MM/dd')}
-    **/
-    int pageListCount(@Param("offset") int offset,
-                             @Param("pagesize") int pagesize);
-
-}

+ 0 - 37
railway-generator/src/main/resources/templates/code-generator/mybatis/model.ftl

@@ -1,37 +0,0 @@
-import java.io.Serializable;
-import java.util.Date;
-import java.util.List;
-
-/**
-*  ${classInfo.classComment}
-* @author ${authorName} ${.now?string('yyyy-MM-dd')}
-*/
-public class ${classInfo.className} implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-<#list classInfo.fieldList as fieldItem >
-    /**
-    * ${fieldItem.fieldComment}
-    */
-    private ${fieldItem.fieldClass} ${fieldItem.fieldName};
-
-</#list>
-</#if>
-
-<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-    public ${classInfo.className}() {
-    }
-
-<#list classInfo.fieldList as fieldItem>
-    public ${fieldItem.fieldClass} get${fieldItem.fieldName?cap_first}() {
-        return ${fieldItem.fieldName};
-    }
-
-    public void set${fieldItem.fieldName?cap_first}(${fieldItem.fieldClass} ${fieldItem.fieldName}) {
-        this.${fieldItem.fieldName} = ${fieldItem.fieldName};
-    }
-
-</#list>
-</#if>
-}

+ 0 - 89
railway-generator/src/main/resources/templates/code-generator/mybatis/mybatis.ftl

@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="${packageName}.dao.${classInfo.className}Dao">
-
-    <resultMap id="BaseResultMap" type="${packageName}.entity.${classInfo.className}Entity" >
-        <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-            <#list classInfo.fieldList as fieldItem >
-                <result column="${fieldItem.columnName}" property="${fieldItem.fieldName}" />
-            </#list>
-        </#if>
-    </resultMap>
-
-    <sql id="Base_Column_List">
-        <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-            <#list classInfo.fieldList as fieldItem >
-                `${fieldItem.columnName}`<#if fieldItem_has_next>,</#if>
-            </#list>
-        </#if>
-    </sql>
-
-    <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="${packageName}.entity.${classInfo.className}Entity">
-        INSERT INTO ${classInfo.tableName}
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-                <#list classInfo.fieldList as fieldItem >
-                    <#if fieldItem.columnName != "id_" >
-                        ${r"<if test ='null != "}${fieldItem.fieldName}${r"'>"}
-                        `${fieldItem.columnName}`<#if fieldItem_has_next>,</#if>
-                        ${r"</if>"}
-                    </#if>
-                </#list>
-            </#if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <#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"<if test ='null != "}${fieldItem.fieldName}${r"'>"}
-                        NOW()<#if fieldItem_has_next>,</#if>
-                    ${r"</if>"}
-                    <#else>-->
-                        ${r"<if test ='null != "}${fieldItem.fieldName}${r"'>"}
-                        ${r"#{"}${fieldItem.fieldName}${r"}"}<#if fieldItem_has_next>,</#if>
-                        ${r"</if>"}
-                    <#--</#if>-->
-                    </#if>
-                </#list>
-            </#if>
-        </trim>
-    </insert>
-
-    <delete id="delete" >
-        DELETE FROM ${classInfo.tableName}
-        WHERE `id_` = ${r"#{id}"}
-    </delete>
-
-    <update id="update" parameterType="${packageName}.entity.${classInfo.className}Entity">
-        UPDATE ${classInfo.tableName}
-        <set>
-            <#list classInfo.fieldList as fieldItem >
-                <#if fieldItem.columnName != "id_" && fieldItem.columnName != "AddTime" && fieldItem.columnName != "UpdateTime" >
-                    ${r"<if test ='null != "}${fieldItem.fieldName}${r"'>"}${fieldItem.columnName} = ${r"#{"}${fieldItem.fieldName}${r"}"}<#if fieldItem_has_next>,</#if>${r"</if>"}
-                </#if>
-            </#list>
-        </set>
-        WHERE `id_` = ${r"#{"}id${r"}"}
-    </update>
-
-
-    <select id="selectByPrimaryKey" resultMap="BaseResultMap">
-        SELECT <include refid="Base_Column_List" />
-        FROM ${classInfo.tableName}
-        WHERE `id_` = ${r"#{id}"}
-    </select>
-
-    <select id="pageList" resultMap="BaseResultMap">
-        SELECT <include refid="Base_Column_List" />
-        FROM ${classInfo.tableName}
-        LIMIT ${r"#{offset}"}, ${r"#{pageSize}"}
-    </select>
-
-    <select id="pageListCount" resultType="java.lang.Integer">
-        SELECT count(1)
-        FROM ${classInfo.tableName}
-    </select>
-
-</mapper>

+ 0 - 35
railway-generator/src/main/resources/templates/code-generator/mybatis/service.ftl

@@ -1,35 +0,0 @@
-import java.util.Map;
-
-/**
-* ${classInfo.classComment}
-* @author ${authorName}
-* @date ${.now?string('yyyy/MM/dd')}
-*/
-public interface ${classInfo.className}Service {
-
-    /**
-    * 新增
-    */
-    public ReturnT<String> insert(${classInfo.className} ${classInfo.className?uncap_first});
-
-    /**
-    * 删除
-    */
-    public ReturnT<String> delete(int id);
-
-    /**
-    * 更新
-    */
-    public ReturnT<String> update(${classInfo.className} ${classInfo.className?uncap_first});
-
-    /**
-    * 根據主鍵 id 查詢
-    */
-    public ${classInfo.className} load(int id);
-
-    /**
-    * 分页查询
-    */
-    public Map<String,Object> pageList(int offset, int pagesize);
-
-}

+ 0 - 68
railway-generator/src/main/resources/templates/code-generator/mybatis/service_impl.ftl

@@ -1,68 +0,0 @@
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
-* ${classInfo.classComment}
-* @author ${authorName}
-* @date ${.now?string('yyyy/MM/dd')}
-*/
-@Service
-public class ${classInfo.className}ServiceImpl implements ${classInfo.className}Service {
-
-	@Resource
-	private ${classInfo.className}Mapper ${classInfo.className?uncap_first}Mapper;
-
-
-	@Override
-	public ReturnT<String> insert(${classInfo.className} ${classInfo.className?uncap_first}) {
-
-		// valid
-		if (${classInfo.className?uncap_first} == null) {
-			return new ReturnT<String>(ReturnT.FAIL_CODE, "必要参数缺失");
-        }
-
-		${classInfo.className?uncap_first}Mapper.insert(${classInfo.className?uncap_first});
-        return ReturnT.SUCCESS;
-	}
-
-
-	@Override
-	public ReturnT<String> delete(int id) {
-		int ret = ${classInfo.className?uncap_first}Mapper.delete(id);
-		return ret>0?ReturnT.SUCCESS:ReturnT.FAIL;
-	}
-
-
-	@Override
-	public ReturnT<String> update(${classInfo.className} ${classInfo.className?uncap_first}) {
-		int ret = ${classInfo.className?uncap_first}Mapper.update(${classInfo.className?uncap_first});
-		return ret>0?ReturnT.SUCCESS:ReturnT.FAIL;
-	}
-
-
-	@Override
-	public ${classInfo.className} load(int id) {
-		return ${classInfo.className?uncap_first}Mapper.load(id);
-	}
-
-
-	@Override
-	public Map<String,Object> pageList(int offset, int 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<String, Object> result = new HashMap<String, Object>();
-		result.put("pageList", pageList);
-		result.put("totalCount", totalCount);
-
-		return result;
-	}
-
-}

+ 0 - 63
railway-generator/src/main/resources/templates/code-generator/railway/back/controller.ftl

@@ -1,63 +0,0 @@
-package com.railway.web.controller.business.${busType};
-
-import ${packageName}.domain.${classInfo.className};
-import ${packageName}.service.I${classInfo.className}Service;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.bind.WebDataBinder;
-import com.railway.common.core.controller.BaseController;
-import com.railway.common.core.domain.AjaxResult;
-import com.railway.common.core.page.TableDataInfo;
-import javax.validation.Valid;
-import java.util.List;
-
-import javax.validation.Valid;
-
-@Api(value = "rest/${restPath}", tags = "${classInfo.classComment}")
-@RestController
-@Validated
-@RequestMapping(value = "business/${restPath}")
-public class ${classInfo.className}Controller extends BaseController {
-    @Autowired
-    private I${classInfo.className}Service ${classInfo.className?uncap_first}Service;
-
-    @ApiOperation(value = "新增")
-    @PostMapping("/add")
-    public AjaxResult add(@Validated @RequestBody ${classInfo.className} ${classInfo.className?uncap_first}) {
-        return toAjax(${classInfo.className?uncap_first}Service.create(${classInfo.className?uncap_first}));
-    }
-
-    @ApiOperation(value = "删除")
-    @DeleteMapping("/{${primaryKeyCame}s}")
-    public AjaxResult delete(@RequestParam String[] ${primaryKeyCame}s) {
-        return toAjax(${classInfo.className?uncap_first}Service.delete(${primaryKeyCame}s));
-    }
-
-    @ApiOperation(value = "更新")
-    @PutMapping("/update")
-    public AjaxResult update(@RequestBody @Valid ${classInfo.className} ${classInfo.className?uncap_first}) {
-        return toAjax(${classInfo.className?uncap_first}Service.update(${classInfo.className?uncap_first}));
-    }
-
-    @ApiOperation(value = "单个")
-    @GetMapping(value = {"/", "/{${primaryKeyCame}}"})
-    public AjaxResult getInfo(String ${primaryKeyCame}) {
-        ${classInfo.className} info = ${classInfo.className?uncap_first}Service.getInfo(${primaryKeyCame});
-        AjaxResult ajax = AjaxResult.success();
-        ajax.put("info",info);
-        return ajax;
-    }
-
-    @ApiOperation(value = "列表")
-    @GetMapping(value = "list")
-    public TableDataInfo getList(${classInfo.className} ${classInfo.className?uncap_first}) {
-        startPage();
-        List<${classInfo.className}> list = ${classInfo.className?uncap_first}Service.getList(${classInfo.className?uncap_first});
-        return getDataTable(list);
-    }
-
-}

+ 0 - 43
railway-generator/src/main/resources/templates/code-generator/railway/back/dao.ftl

@@ -1,43 +0,0 @@
-package ${packageName}.mapper;
-
-import com.github.pagehelper.Page;
-import ${packageName}.domain.${classInfo.className};
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
-
-/**
-* ${classInfo.classComment}
-* @author ${authorName}
-* @date ${.now?string('yyyy/MM/dd')}
-*/
-@Mapper
-@Repository
-public interface ${classInfo.className}Mapper {
-
-    /**
-    * 新增
-    */
-    int insert(${classInfo.className} ${classInfo.className?uncap_first});
-
-    /**
-    * 删除
-    */
-    int delete(@Param("${primaryKeyCame}") String ${primaryKeyCame});
-
-    /**
-    * 更新
-    */
-    int update(${classInfo.className} ${classInfo.className?uncap_first});
-
-    /**
-    * 获取单个
-    */
-    ${classInfo.className} getInfo(@Param("${primaryKeyCame}") String ${primaryKeyCame});
-
-    /**
-    * 查询列表
-    */
-    Page<${classInfo.className}> getList(${classInfo.className} ${classInfo.className?uncap_first});
-
-}

+ 0 - 55
railway-generator/src/main/resources/templates/code-generator/railway/back/entity.ftl

@@ -1,55 +0,0 @@
-package ${packageName}.domain;
-
-import com.railway.common.core.domain.BaseEntity;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-<#list classInfo.fieldList as fieldItem >
-<#if fieldItem.fieldClass == 'Date'>
-import java.util.Date;
-
-    <#break>
-</#if>
-</#list>
-<#list classInfo.fieldList as fieldItem >
-<#if fieldItem.fieldClass == 'String' && fieldItem.fieldLength gt 0>
-import org.hibernate.validator.constraints.Length;
-    <#break>
-</#if>
-</#list>
-import javax.validation.constraints.NotNull;
-/**
- * ${classInfo.classComment}
- * @author ${authorName} ${.now?string('yyyy-MM-dd')}
- */
-@Data
-@ApiModel("${classInfo.classComment}")
-@EqualsAndHashCode(callSuper = true)
-public class ${classInfo.className} extends BaseEntity{
-
-<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-    @ApiModelProperty(value = "主键", hidden = true)
-    private String ${primaryKeyCame};
-
-<#list classInfo.fieldList as fieldItem >
-<#if fieldItem.fieldName != "lastModifyUserid" && fieldItem.fieldName != "lastModifyUsername"
-    && fieldItem.fieldName != "lastModifyLoginname" && fieldItem.fieldName != "lastModifyTime"
-    && fieldItem.fieldName != "createTime"
-    && fieldItem.fieldName != "isDel" >
-    @ApiModelProperty(value = "${fieldItem.fieldComment}")
-    <#if fieldItem.fieldClass=='String' && fieldItem.fieldLength gt 0 >
-    @Length(min = 1, max = ${fieldItem.fieldLength}, message = "【${fieldItem.fieldComment}】长度必须介于 {min} 和 {max} 之间")
-    </#if>
-<#--    <#if fieldItem.fieldClass=='Date' >-->
-<#--@NotNull(message = "【${fieldItem.fieldComment}】不能为空")-->
-<#--    </#if>-->
-    private ${fieldItem.fieldClass} ${fieldItem.fieldName};
-
-</#if>
-</#list>
-    public ${classInfo.className}() {
-    }
-</#if>
-
-}

+ 0 - 94
railway-generator/src/main/resources/templates/code-generator/railway/back/mybatis.ftl

@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="${packageName}.mapper.${classInfo.className}Mapper">
-
-    <resultMap id="BaseResultMap" type="${packageName}.domain.${classInfo.className}">
-                <result column="${primaryKey}" property="${primaryKeyCame}"/>
-        <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-            <#list classInfo.fieldList as fieldItem >
-                <result column="${fieldItem.columnName}" property="${fieldItem.fieldName}"/>
-            </#list>
-        </#if>
-    </resultMap>
-
-    <sql id="Base_Column_List">
-        <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-                ${primaryKey},
-            <#list classInfo.fieldList as fieldItem >
-                ${fieldItem.columnName}<#if fieldItem_has_next>,</#if>
-            </#list>
-        </#if>
-    </sql>
-
-    <insert id="insert" parameterType="${packageName}.domain.${classInfo.className}">
-        <selectKey keyProperty="${primaryKeyCame}" order="BEFORE" resultType="String">
-            select replace(uuid(), '-', '') from dual
-        </selectKey>
-        INSERT INTO ${classInfo.tableName}
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-                   <#-- ${primaryKey},-->
-                <#list classInfo.fieldList as fieldItem >
-                    ${r"<if test ='null != "}${fieldItem.fieldName}${r"'>"}
-                    ${fieldItem.columnName}<#if fieldItem_has_next>,</#if>
-                    ${r"</if>"}
-                </#list>
-            </#if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-                    <#--${r"#{"}${primaryKeyCame}${r"}"},-->
-                <#list classInfo.fieldList as fieldItem >
-                    ${r"<if test ='null != "}${fieldItem.fieldName}${r"'>"}
-                    ${r"#{"}${fieldItem.fieldName}${r"}"}<#if fieldItem_has_next>,</#if>
-                    ${r"</if>"}
-                </#list>
-            </#if>
-        </trim>
-    </insert>
-
-    <delete id="delete">
-        UPDATE ${classInfo.tableName}
-        set del_flag='1'
-        WHERE ${primaryKey} = ${r"#{"}${primaryKeyCame}${r"}"}
-    </delete>
-
-    <update id="update" parameterType="${packageName}.domain.${classInfo.className}">
-        UPDATE ${classInfo.tableName}
-        <set>
-            <#list classInfo.fieldList as fieldItem >
-                <#if fieldItem.columnName != "id_" && fieldItem.columnName != "AddTime" && fieldItem.columnName != "UpdateTime" >
-                    ${r"<if test ='null != "}${fieldItem.fieldName}${r"'>"}${fieldItem.columnName} = ${r"#{"}${fieldItem.fieldName}${r"}"}<#if fieldItem_has_next>,</#if>${r"</if>"}
-                </#if>
-            </#list>
-        </set>
-        WHERE ${primaryKey} = ${r"#{"}${primaryKeyCame}${r"}"}
-    </update>
-
-
-    <select id="getInfo" resultMap="BaseResultMap">
-        SELECT
-        <include refid="Base_Column_List"/>
-        FROM ${classInfo.tableName}
-        WHERE del_flag='0' and ${primaryKey} = ${r"#{"}${primaryKeyCame}${r"}"}
-
-    </select>
-
-    <select id="getList" resultMap="BaseResultMap">
-        SELECT
-        <include refid="Base_Column_List"/>
-        FROM ${classInfo.tableName}
-        <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-        <where>
-            del_flag='0'
-            <#list classInfo.fieldList as fieldItem >
-                <if test="${fieldItem.fieldName}!=null and ${fieldItem.fieldName}!=''">
-                    and ${fieldItem.columnName}=${r"#{"}${fieldItem.fieldName}${r"}"}
-                </if>
-            </#list>
-        </where>
-        </#if>
-    </select>
-
-</mapper>

+ 0 - 37
railway-generator/src/main/resources/templates/code-generator/railway/back/service.ftl

@@ -1,37 +0,0 @@
-package ${packageName}.service;
-
-import ${packageName}.domain.${classInfo.className};
-import java.util.List;
-/**
-* ${classInfo.classComment}
-* @author ${authorName}
-* @date ${.now?string('yyyy/MM/dd')}
-*/
-public interface I${classInfo.className}Service{
-
-    /**
-    * 新增
-    */
-    int create(${classInfo.className} ${classInfo.className?uncap_first});
-
-    /**
-    * 删除
-    */
-    int delete(String[] ${primaryKeyCame}s);
-
-    /**
-    * 更新
-    */
-    int update(${classInfo.className} ${classInfo.className?uncap_first});
-
-    /**
-    * 获取单个
-    */
-    ${classInfo.className} getInfo(String ${primaryKeyCame});
-
-    /**
-    * 查询列表
-    */
-    List<${classInfo.className}> getList(${classInfo.className} ${classInfo.className?uncap_first});
-
-}

+ 0 - 71
railway-generator/src/main/resources/templates/code-generator/railway/back/serviceImpl.ftl

@@ -1,71 +0,0 @@
-package ${packageName}.service.impl;
-
-import com.github.pagehelper.Page;
-import com.github.pagehelper.PageHelper;
-import ${packageName}.mapper.${classInfo.className}Mapper;
-import ${packageName}.domain.${classInfo.className};
-import ${packageName}.service.I${classInfo.className}Service;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.railway.common.utils.SecurityUtils;
-import org.springframework.transaction.annotation.Transactional;
-import java.util.List;
-import java.util.Date;
-/**
-* ${classInfo.classComment}
-* @author ${authorName}
-* @date ${.now?string('yyyy/MM/dd')}
-*/
-@Service
-@Transactional(readOnly = true)
-public class ${classInfo.className}ServiceImpl implements I${classInfo.className}Service{
-@Autowired
-private ${classInfo.className}Mapper ${classInfo.className?uncap_first}Mapper;
-
-	/**
-	* 新增
-	*/
-	@Transactional(rollbackFor = Exception.class)
-	public int create(${classInfo.className} ${classInfo.className?uncap_first}) {
-	    ${classInfo.className?uncap_first}.setCreateTime(new Date());
-        ${classInfo.className?uncap_first}.setCreateBy(SecurityUtils.getUsername());
-		return ${classInfo.className?uncap_first}Mapper.insert(${classInfo.className?uncap_first});
-	}
-
-	/**
-	* 删除
-	*/
-	@Transactional(rollbackFor = Exception.class)
-	public int delete(String[] ${primaryKeyCame}s) {
-		int r =0;
-		for (String ${primaryKeyCame} : ${primaryKeyCame}s) {
-			int j= ${classInfo.className?uncap_first}Mapper.delete(${primaryKeyCame});
-			r = r + j;
-		}
-		return	r;
-	}
-
-	/**
-	* 更新
-	*/
-	@Transactional(rollbackFor = Exception.class)
-	public int update(${classInfo.className} ${classInfo.className?uncap_first}) {
-		${classInfo.className?uncap_first}.setUpdateTime(new Date());
-    	${classInfo.className?uncap_first}.setUpdateBy(SecurityUtils.getUsername());
-		return ${classInfo.className?uncap_first}Mapper.update(${classInfo.className?uncap_first});
-	}
-
-	/**
-	* 获取单个
-	*/
-	public ${classInfo.className} getInfo(String ${primaryKeyCame}) {
-		return ${classInfo.className?uncap_first}Mapper.getInfo(${primaryKeyCame});
-	}
-
-	/**
-	* 查询列表
-	*/
-	public List<${classInfo.className}> getList(${classInfo.className} ${classInfo.className?uncap_first}) {
-		return ${classInfo.className?uncap_first}Mapper.getList(${classInfo.className?uncap_first});
-	}
-}

+ 0 - 13
railway-generator/src/main/resources/templates/code-generator/ui/bootstrap-ui.ftl

@@ -1,13 +0,0 @@
-<form action="/${classInfo.className?uncap_first}/save">
-
-    <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-        <#list classInfo.fieldList as fieldItem >
-            <div class="form-group">
-                <label for="${fieldItem.fieldName}Label">${fieldItem.fieldComment}</label>
-                <input type="input" class="form-control" id="${fieldItem.fieldName}" name="${fieldItem.fieldName}" placeholder="请输入${fieldItem.fieldComment}">
-            </div>
-        </#list>
-    </#if>
-
-    <button type="submit" class="btn btn-primary">保存</button>
-</form>

+ 0 - 18
railway-generator/src/main/resources/templates/code-generator/ui/element-ui.ftl

@@ -1,18 +0,0 @@
-
-
-<el-form :inline="true" :model="submitData" class="demo-form-inline" :rules="rules" ref="ruleForm">
-    <el-card class="box-card">
-        <div slot="header" class="header clearfix">
-            <span>${classInfo.classComment}</span>
-            <el-button v-if="!ischeck && !isFind" class="fr" type="primary" @click="validate('ruleForm')">提交</el-button>
-            <el-button v-else class="fr" type="primary" @click="goBack">返回</el-button>
-        </div>
-        <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-            <#list classInfo.fieldList as fieldItem >
-             <el-form-item label="${fieldItem.fieldComment}" prop="${fieldItem.fieldName}">
-                 <el-input placeholder="${fieldItem.fieldComment}" v-model="submitData.${fieldItem.fieldName}"></el-input>
-             </el-form-item>
-            </#list>
-        </#if>
-    </el-card>
-</el-form>

+ 0 - 9
railway-generator/src/main/resources/templates/code-generator/ui/swagger-ui.ftl

@@ -1,9 +0,0 @@
-@ApiOperation(value = "${classInfo.classComment}", notes = "${classInfo.classComment}")
-    @ApiImplicitParams({
-            <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
-                <#list classInfo.fieldList as fieldItem >
-                @ApiImplicitParam(name = "${fieldItem.fieldName}", value = "${fieldItem.fieldComment}", required = false, dataType = "${fieldItem.fieldClass}")<#if fieldItem_has_next>,</#if>
-                </#list>
-            </#if>
-    }
-    )

+ 0 - 60
railway-generator/src/main/resources/templates/common/common-import.ftl

@@ -1,60 +0,0 @@
-<#macro commonStyle>
-
-<#-- favicon -->
-<link rel="icon" href="favicon.ico" />
-
-<meta charset="utf-8">
-<meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <!-- Tell the browser to be responsive to screen width -->
-    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
-    <!-- Bootstrap 4 -->
-    <link href="//cdn.staticfile.org/twitter-bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet">
-    <!-- Font Awesome -->
-    <link href="//cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
-    <!-- Ionicons -->
-    <link href="//cdn.staticfile.org/ionicons/4.1.2/css/ionicons.min.css" rel="stylesheet">
-
-    <link href="//cdn.staticfile.org/codemirror/5.42.0/codemirror.min.css" rel="stylesheet">
-
-    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
-    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
-    <!--[if lt IE 9]>
-    <script src="//cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
-    <script src="//cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
-    <![endif]-->
-
-<script>var base_url = '${request.contextPath}';</script>
-
-</#macro>
-
-<#macro commonScript>
-
-    <!-- jQuery -->
-    <script src="//cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script>
-    <!-- Bootstrap -->
-    <script src="//cdn.staticfile.org/twitter-bootstrap/4.1.1/js/bootstrap.min.js"></script>
-    <!-- FastClick -->
-    <script src="//cdn.staticfile.org/fastclick/1.0.6/fastclick.min.js"></script>
-    <script src="//cdn.staticfile.org/jQuery-slimScroll/1.3.8/jquery.slimscroll.min.js"></script>
-    <script src="//cdn.staticfile.org/layer/2.3/layer.js"></script>
-    <script src="//cdn.staticfile.org/codemirror/5.42.0/codemirror.min.js"></script>
-    <script src="//cdn.staticfile.org/codemirror/5.42.0/addon/display/placeholder.min.js"></script>
-    <script src="//cdn.staticfile.org/codemirror/5.42.0/mode/clike/clike.min.js"></script>
-    <script src="//cdn.staticfile.org/codemirror/5.42.0/mode/sql/sql.min.js"></script>
-    <script src="//cdn.staticfile.org/codemirror/5.42.0/mode/xml/xml.min.js"></script>
-</#macro>
-
-
-<#macro commonFooter >
-<footer class="main-footer">
-    <div class="container">
-        Powered by <b>Spring Boot Code Generator</b> base on XXL Code Generator
-        <div class="pull-right hidden-xs">
-            <strong>Copyright &copy; 2018-${.now?string('yyyy')} &nbsp;
-                <a href="https://github.com/moshowgame/SpringBootCodeGenerator" target="_blank" >SpringBootCodeGenerator</a>
-                <a href="https://github.com/xuxueli/xxl-code-generator" target="_blank" >xxl-code-generator</a>
-            </strong><!-- All rights reserved. -->
-        </div>
-    </div>
-</footer>
-</#macro>

+ 0 - 307
railway-generator/src/main/resources/templates/index.ftl

@@ -1,307 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="UTF-8">
-    <title>代码生成</title>
-    <meta name="keywords" content="代码生成">
-    <#import "common/common-import.ftl" as netCommon>
-    <@netCommon.commonStyle />
-
-    <@netCommon.commonScript />
-    <#--<script src="${request.contextPath}/static/js/index-new.js"></script>-->
-    <script>
-        $(function () {
-
-            /**
-             * 初始化 table sql 3
-             */
-            var ddlSqlArea = CodeMirror.fromTextArea(document.getElementById("ddlSqlArea"), {
-                lineNumbers: true,
-                matchBrackets: true,
-                mode: "text/x-sql",
-                lineWrapping: false,
-                readOnly: false,
-                foldGutter: true,
-                gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
-            });
-            ddlSqlArea.setSize('auto', 'auto');
-            // controller_ide
-            // var genCodeArea = CodeMirror.fromTextArea(document.getElementById("genCodeArea"), {
-            //     lineNumbers: true,
-            //     matchBrackets: true,
-            //     mode: "text/x-java",
-            //     lineWrapping:true,
-            //     readOnly:true,
-            //     foldGutter: true,
-            //     gutters:["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
-            // });
-            // genCodeArea.setSize('auto','auto');
-
-            var codeData;
-
-            /**
-             * 生成代码
-             */
-            $('#btnGenCode').click(function () {
-
-                var tableSql = ddlSqlArea.getValue();
-                $.ajax({
-                    type: 'POST',
-                    url: base_url + "/genCode",
-                    data: {
-                        "tableSql": tableSql,
-                        "className": $("#className").val(),
-                        "primaryKey": $("#primaryKey").val(),
-                        "busType": $("#busType").val(),
-                        "packageName": $("#packageName").val(),
-                        "projectPath": $("#projectPath").val(),
-                        "returnUtil": $("#returnUtil").val(),
-                        "authorName": $("#authorName").val()
-                    },
-                    dataType: "json",
-                    success: function (data) {
-                        if (data.code == 200) {
-                            layer.open({
-                                icon: '1',
-                                content: "代码生成成功",
-                                end: function () {
-                                    codeData = data.data;
-                                    // genCodeArea.setValue(codeData.beetlentity);
-                                    // genCodeArea.setSize('auto', 'auto');
-                                }
-                            });
-                        } else {
-                            layer.open({
-                                icon: '2',
-                                content: (data.msg || '代码生成失败')
-                            });
-                        }
-                    }
-                });
-            });
-            /**
-             * 按钮事件组
-             */
-            $('.generator').bind('click', function () {
-                if (!$.isEmptyObject(codeData)) {
-                    var id = this.id;
-                    // genCodeArea.setValue(codeData[id]);
-                    // genCodeArea.setSize('auto', 'auto');
-                }
-            });
-
-            function donate() {
-                layer.open({
-                    type: 1,
-                    area: ['712px', '480px'],
-                    shadeClose: true, //点击遮罩关闭
-                    content: '<img src="http://upyun.bejson.com/img/zhengkai.png"></img>'
-                });
-            }
-
-            $('#donate1').on('click', function () {
-                donate();
-            });
-            $('#donate2').on('click', function () {
-                donate();
-            });
-        });
-    </script>
-</head>
-<body style="background-color: #e9ecef">
-
-<div class="container">
-    <nav class="navbar navbar-dark bg-primary btn-lg">
-        <a class="navbar-brand" href="http://www.bejson.com">代码生成</a>
-        <ul class="nav navbar-nav">
-            <li class="nav-item active">
-                <#--                    <a class="nav-link" href="http://blog.csdn.net/moshowgame">SGP</a>-->
-            </li>
-        </ul>
-    </nav>
-</div>
-
-<!-- Main jumbotron for a primary marketing message or call to action -->
-<div class="jumbotron">
-    <div class="container">
-        <#--        <h2>Spring Boot Code Generator!</h2>-->
-        <p class="lead">
-
-        </p>
-        <div class="input-group mb-3">
-            <div class="input-group-prepend">
-                <span class="input-group-text">项目路径</span>
-            </div>
-            <input type="text" class="form-control" id="projectPath" name="projectPath"
-                   placeholder="D:\workspace\railway">
-        </div>
-        <div class="input-group mb-3">
-            <div class="input-group-prepend">
-                <span class="input-group-text">业务分类</span>
-            </div>
-            <input type="text" class="form-control" id="busType" name="busType"
-                   placeholder="catenary">
-        </div>
-        <div class="input-group mb-3">
-            <div class="input-group-prepend">
-                <span class="input-group-text">包名路径</span>
-            </div>
-            <input type="text" class="form-control" id="packageName" name="packageName"
-                   placeholder="com.railway.business">
-        </div>
-        <div class="input-group mb-3">
-            <div class="input-group-prepend">
-                <span class="input-group-text">作者名称</span>
-            </div>
-            <input type="text" class="form-control" id="authorName" name="authorName" placeholder="author">
-        </div>
-        <div class="input-group mb-3">
-            <div class="input-group-prepend">
-                <span class="input-group-text">类名</span>
-            </div>
-            <input type="text" class="form-control" id="className" name="className" placeholder="表名的驼峰,首字母大写">
-            <div class="input-group-prepend">
-                <span class="input-group-text">主键</span>
-            </div>
-            <input type="text" class="form-control" id="primaryKey" name="primaryKey" placeholder="id">
-        </div>
-
-        <#--        <div class="input-group mb-3">-->
-        <#--            <div class="input-group-prepend">-->
-        <#--                <span class="input-group-text">返回封装</span>-->
-        <#--            </div>-->
-        <#--            <input type="text" class="form-control" id="returnUtil" name="returnUtil" placeholder="ApiReturnObject">-->
-        <#--        </div>-->
-        <textarea id="ddlSqlArea" placeholder="请输入表结构信息..." class="form-control btn-lg"
-                  style="height: 250px;"></textarea><br>
-        <p>
-            <button class="btn btn-primary btn-lg disabled" id="btnGenCode" role="button">开始生成 »</button>
-        </p>
-        <hr>
-        <!-- Example row of columns -->
-        <#--        <div class="row" style="margin-top: 10px;">-->
-        <#--            <div class="btn-toolbar col-md-5" role="toolbar" aria-label="Toolbar with button groups">-->
-        <#--                <div class="input-group">-->
-        <#--                    <div class="input-group-prepend">-->
-        <#--                        <div class="btn btn-secondary disabled" id="btnGroupAddon">通用实体</div>-->
-        <#--                    </div>-->
-        <#--                </div>-->
-        <#--                <div class="btn-group" role="group" aria-label="First group">-->
-        <#--                    <button type="button" class="btn btn-default generator" id="model">entity(set/get)</button>-->
-        <#--                    <button type="button" class="btn btn-default generator" id="beetlentity">entity(lombok)</button>-->
-        <#--                </div>-->
-        <#--            </div>-->
-        <#--            <div class="btn-toolbar col-md-7" role="toolbar" aria-label="Toolbar with button groups">-->
-        <#--                <div class="input-group">-->
-        <#--                    <div class="input-group-prepend">-->
-        <#--                        <div class="btn btn-secondary disabled" id="btnGroupAddon">Mybatis</div>-->
-        <#--                    </div>-->
-        <#--                </div>-->
-        <#--                <div class="btn-group" role="group" aria-label="First group">-->
-        <#--                    <button type="button" class="btn btn-default generator" id="mybatis">mybatis</button>-->
-        <#--                    <button type="button" class="btn btn-default generator" id="mapper">mapper</button>-->
-        <#--                    <button type="button" class="btn btn-default generator" id="service">service</button>-->
-        <#--                    <button type="button" class="btn btn-default generator" id="service_impl">service_impl</button>-->
-        <#--                    <button type="button" class="btn btn-default generator" id="controller">controller</button>-->
-        <#--                </div>-->
-        <#--            </div>-->
-        <#--        </div>-->
-        <#--        <!-- Example row of columns &ndash;&gt;-->
-        <#--        <div class="row" style="margin-top: 10px;">-->
-        <#--            <div class="btn-toolbar col-md-5" role="toolbar" aria-label="Toolbar with button groups">-->
-        <#--                <div class="input-group">-->
-        <#--                    <div class="input-group-prepend">-->
-        <#--                        <div class="btn btn-secondary disabled" id="btnGroupAddon">MybatisPlus</div>-->
-        <#--                    </div>-->
-        <#--                </div>-->
-        <#--                <div class="btn-group" role="group" aria-label="First group">-->
-        <#--                    <button type="button" class="btn btn-default generator" id="plusmapper">mapper</button>-->
-        <#--                    <button type="button" class="btn btn-default generator" id="pluscontroller">controller</button>-->
-        <#--                </div>-->
-        <#--            </div>-->
-
-        <#--            <div class="btn-toolbar col-md-5" role="toolbar" aria-label="Toolbar with button groups">-->
-        <#--                <div class="input-group">-->
-        <#--                    <div class="input-group-prepend">-->
-        <#--                        <div class="btn btn-secondary disabled" id="btnGroupAddon">UI</div>-->
-        <#--                    </div>-->
-        <#--                </div>-->
-        <#--                <div class="btn-group" role="group" aria-label="First group">-->
-        <#--                    <button type="button" class="btn btn-default generator" id="swagger-ui">swagger-ui</button>-->
-        <#--                    <button type="button" class="btn btn-default generator" id="element-ui">element-ui</button>-->
-        <#--                    <button type="button" class="btn btn-default generator" id="bootstrap-ui">bootstrap-ui</button>-->
-        <#--                </div>-->
-        <#--            </div>-->
-        <#--        </div>-->
-
-        <#--        <div class="row" style="margin-top: 10px;">-->
-        <#--            <div class="btn-toolbar col-md-5" role="toolbar" aria-label="Toolbar with button groups">-->
-        <#--                <div class="input-group">-->
-        <#--                    <div class="input-group-prepend">-->
-        <#--                        <div class="btn btn-secondary disabled" id="btnGroupAddon">BeetlSQL</div>-->
-        <#--                    </div>-->
-        <#--                </div>-->
-        <#--                <div class="btn-group" role="group" aria-label="First group">-->
-        <#--                    <button type="button" class="btn btn-default generator" id="beetlmd">beetlmd</button>-->
-        <#--                    <button type="button" class="btn btn-default generator" id="beetlcontroller">beetlcontroller</button>-->
-        <#--                </div>-->
-        <#--            </div>-->
-        <#--            <div class="btn-toolbar col-md-5" role="toolbar" aria-label="Toolbar with button groups">-->
-        <#--                <div class="input-group">-->
-        <#--                    <div class="input-group-prepend">-->
-        <#--                        <div class="btn btn-secondary disabled" id="btnGroupAddon">JPA</div>-->
-        <#--                    </div>-->
-        <#--                </div>-->
-        <#--                <div class="btn-group" role="group" aria-label="First group">-->
-        <#--                    <button type="button" class="btn btn-default generator" id="entity">jpa-entity</button>-->
-        <#--                    <button type="button" class="btn btn-default generator" id="repository">repository</button>-->
-        <#--                    <button type="button" class="btn btn-default generator" id="jpacontroller">controller</button>-->
-        <#--                </div>-->
-        <#--            </div>-->
-        <#--        </div>-->
-        <#--        <div class="row" style="margin-top: 10px;">-->
-        <#--            <div class="btn-toolbar col-md-5" role="toolbar" aria-label="Toolbar with button groups">-->
-        <#--                <div class="input-group">-->
-        <#--                    <div class="input-group-prepend">-->
-        <#--                        <div class="btn btn-secondary disabled" id="btnGroupAddon">JdbcTemplate</div>-->
-        <#--                    </div>-->
-        <#--                </div>-->
-        <#--                <div class="btn-group" role="group" aria-label="First group">-->
-        <#--                    <button type="button" class="btn btn-default generator" id="jtdaoimpl">daoimpl</button>-->
-        <#--                    <button type="button" class="btn btn-default generator" id="jtdao">dao</button>-->
-        <#--                </div>-->
-        <#--            </div>-->
-        <#--        </div>-->
-        <#--        <div class="row" style="margin-top: 10px;">-->
-        <#--            <div class="btn-toolbar col-md-5" role="toolbar" aria-label="Toolbar with button groups">-->
-        <#--                <div class="input-group">-->
-        <#--                    <div class="input-group-prepend">-->
-        <#--                        <div class="btn btn-secondary disabled" id="btnGroupAddon">DTO</div>-->
-        <#--                    </div>-->
-        <#--                </div>-->
-        <#--                <div class="btn-group" role="group" aria-label="First group">-->
-        <#--                    <button type="button" class="btn btn-default generator" id="beetlentitydto">entitydto(lombok+swagger)</button>-->
-        <#--                </div>-->
-        <#--            </div>-->
-        <#--        </div>-->
-        <#--        <hr>-->
-        <#--        <textarea id="genCodeArea" class="form-control btn-lg" ></textarea>-->
-    </div>
-</div>
-
-<div class="container">
-
-    <#--    <hr>-->
-    <#--    <footer>-->
-    <#--        <footer class="bd-footer text-muted" role="contentinfo">-->
-    <#--            <div class="container">-->
-    <#--                <strong>Copyright &copy; ${.now?string('yyyy')}-9999 &nbsp;</strong>-->
-    <#--                   <p>SGP</p>-->
-    <#--            </div>-->
-    <#--        </footer>-->
-    <#--    </footer>-->
-</div> <!-- /container -->
-
-
-</body>
-</html>