Skip to content

Commit a68989b

Browse files
committed
1.springboot2内置tomcat更换为性能更强大的undertow 2.修复tinyintTransType参数丢失问题
1.springboot2内置tomcat更换为性能更强大的undertow 2.修复tinyintTransType参数丢失问题
1 parent 65b0584 commit a68989b

File tree

7 files changed

+45
-25
lines changed

7 files changed

+45
-25
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
|更新日期|更新内容|
2828
|-|-|
29+
|20191126|1.springboot2内置tomcat更换为性能更强大的undertow 2.修复tinyintTransType参数丢失问题 |
2930
|20191124|1.java代码结构优化. 2.新增简单的json生成模式 3.新增简单的正则表达式匹配模式(感谢@ydq的贡献) 4.新增对复制String代码中的乱SQL代码的支持 5.优化对JSON的父子节点/处理,JSONObject和JSONArray节点处理,子节点缺失'{'头处理|
3031
|20191123|1.移除频繁出错和被过滤的layer,改为jquery-toast. 2.Util功能优化,新增json和xml.|
3132
|20191116|优化对primary关键字的处理(感谢@liujiansgit的反馈). |

codegenerator4.png

147 KB
Loading

generator-web/pom.xml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
<artifactId>spring-boot-starter-data-jpa</artifactId>
3939
</dependency>-->
4040

41-
<dependency>
41+
<!--<dependency>
4242
<groupId>junit</groupId>
4343
<artifactId>junit</artifactId>
44-
</dependency>
44+
</dependency>-->
4545

4646
</dependencies>
4747

@@ -65,7 +65,7 @@
6565
<plugin>
6666
<groupId>org.apache.maven.plugins</groupId>
6767
<artifactId>maven-compiler-plugin</artifactId>
68-
<version>3.1</version>
68+
<version>3.8.1</version>
6969
<configuration>
7070
<skip>true</skip>
7171
<compilerId>javac</compilerId>
@@ -87,25 +87,24 @@
8787
<plugin>
8888
<groupId>org.apache.maven.plugins</groupId>
8989
<artifactId>maven-resources-plugin</artifactId>
90-
<version>3.0.1</version>
90+
<version>3.1.0</version>
9191
<configuration>
9292
<!--<failOnMissingWebXml>false</failOnMissingWebXml>-->
9393
<includeEmptyDirs>true</includeEmptyDirs>
9494
</configuration>
9595
</plugin>
96-
<plugin>
96+
<!--<plugin>
9797
<groupId>org.apache.maven.plugins</groupId>
9898
<artifactId>maven-war-plugin</artifactId>
99-
<version>2.1.1</version>
99+
<version>3.2.3</version>
100100
<configuration>
101101
<failOnMissingWebXml>false</failOnMissingWebXml>
102102
<warSourceExcludes>upload/**</warSourceExcludes>
103103
</configuration>
104-
</plugin>
104+
</plugin>-->
105105
<plugin>
106106
<groupId>org.springframework.boot</groupId>
107107
<artifactId>spring-boot-maven-plugin</artifactId>
108-
<version>2.0.4.RELEASE</version>
109108
<executions>
110109
<execution>
111110
<goals>

generator-web/src/main/java/com/softdev/system/generator/controller/IndexController.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public ReturnT<Map<String, String>> codeGenerate( ParamInfo paramInfo ) {
6262
params.put("packageName", paramInfo.getPackageName());
6363
params.put("returnUtil", paramInfo.getReturnUtil());
6464

65+
log.info("generator table:"+(classInfo==null?"":classInfo.getTableName()));
66+
6567
// generate the code 需要加新的模板请在里面改
6668
Map<String, String> result = generatorService.getResultByParams(params);
6769

generator-web/src/main/java/com/softdev/system/generator/util/TableParseUtil.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ public static ClassInfo processTableIntoClassInfo(ParamInfo paramInfo)
4242
//deal with special character
4343
tableSql = tableSql.trim().replaceAll("'","`").replaceAll("\"","`").replaceAll(",",",").toLowerCase();
4444
//deal with java string copy \n"
45-
System.out.println(tableSql);
4645
tableSql = tableSql.trim().replaceAll("n`","").replaceAll("\\+","").replaceAll("``","`").replaceAll("\\\\","");
47-
System.out.println(tableSql);
4846
// table Name
4947
String tableName = null;
5048
if (tableSql.contains("TABLE") && tableSql.contains("(")) {

generator-web/src/main/resources/application.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,25 @@ server:
22
port: 1234
33
servlet:
44
context-path: /generator
5-
tomcat:
6-
remote-ip-header: x-forward-for
7-
uri-encoding: UTF-8
8-
max-threads: 10
9-
background-processor-delay: 30
10-
basedir: ${user.home}/tomcat/
5+
#tomcat:
6+
# remote-ip-header: x-forward-for
7+
# uri-encoding: UTF-8
8+
# max-threads: 10
9+
# background-processor-delay: 30
10+
# basedir: ${user.home}/tomcat/
11+
undertow:
12+
# 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
13+
# 不要设置过大,如果过大,启动项目会报错:打开文件数过多
14+
io-threads: 4
15+
# 阻塞任务线程池, 当执行类似servlet请求阻塞IO操作, undertow会从这个线程池中取得线程
16+
# 它的值设置取决于系统线程执行任务的阻塞系数,默认值是IO线程数*8
17+
worker-threads: 64
18+
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
19+
# 每块buffer的空间大小,越小的空间被利用越充分,不要设置太大,以免影响其他应用,合适即可
20+
buffer-size: 1024
21+
# 是否分配的直接内存(NIO直接分配的堆外内存)
22+
direct-buffers: true
1123
spring:
12-
cloud:
13-
nacos:
14-
discovery:
15-
server-addr: 127.0.0.1:8848
1624
banner:
1725
charset: UTF-8
1826
http:

pom.xml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@
3131
<dependency>
3232
<groupId>org.springframework.boot</groupId>
3333
<artifactId>spring-boot-starter-web</artifactId>
34+
<!-- 排除Tomcat依赖 -->
35+
<exclusions>
36+
<exclusion>
37+
<groupId>org.springframework.boot</groupId>
38+
<artifactId>spring-boot-starter-tomcat</artifactId>
39+
</exclusion>
40+
</exclusions>
41+
</dependency>
42+
<!-- 添加 Undertow依赖 -->
43+
<dependency>
44+
<groupId>org.springframework.boot</groupId>
45+
<artifactId>spring-boot-starter-undertow</artifactId>
3446
</dependency>
3547

3648
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
@@ -67,7 +79,7 @@
6779
<dependency>
6880
<groupId>cn.hutool</groupId>
6981
<artifactId>hutool-all</artifactId>
70-
<version>4.6.1</version>
82+
<version>5.0.6</version>
7183
</dependency>
7284

7385
<!-- lombok -->
@@ -134,7 +146,7 @@
134146
<plugin>
135147
<groupId>org.apache.maven.plugins</groupId>
136148
<artifactId>maven-compiler-plugin</artifactId>
137-
<version>3.1</version>
149+
<version>3.8.1</version>
138150
<configuration>
139151
<skip>true</skip>
140152
<compilerId>javac</compilerId>
@@ -156,21 +168,21 @@
156168
<plugin>
157169
<groupId>org.apache.maven.plugins</groupId>
158170
<artifactId>maven-resources-plugin</artifactId>
159-
<version>3.0.1</version>
171+
<version>3.1.0</version>
160172
<configuration>
161173
<!--<failOnMissingWebXml>false</failOnMissingWebXml>-->
162174
<includeEmptyDirs>true</includeEmptyDirs>
163175
</configuration>
164176
</plugin>
165-
<plugin>
177+
<!--<plugin>
166178
<groupId>org.apache.maven.plugins</groupId>
167179
<artifactId>maven-war-plugin</artifactId>
168180
<version>2.1.1</version>
169181
<configuration>
170182
<failOnMissingWebXml>false</failOnMissingWebXml>
171183
<warSourceExcludes>upload/**</warSourceExcludes>
172184
</configuration>
173-
</plugin>
185+
</plugin>-->
174186
<plugin>
175187
<groupId>org.springframework.boot</groupId>
176188
<artifactId>spring-boot-maven-plugin</artifactId>

0 commit comments

Comments
 (0)