Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1095661

Browse files
| 2024年12月29日 | 优化前端加载速度,优化输出代码着色,CDN改字节跳动静态资源公共库。
1 parent c69d6ad commit 1095661

File tree

14 files changed

+51
-296
lines changed

14 files changed

+51
-296
lines changed

‎README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SpringBootCodeGenerator
22
----
33
又名`Java代码生成器``JAVA在线代码生成平台``sql转java``大狼狗代码生成器``mybatis在线生成器``SQL转Java JPA、MYBATIS实现类代码生成平台`<br>
4-
![image](https://img.shields.io/badge/SpringBoot2-%E2%98%85%E2%98%85%E2%98%85%E2%98%85%E2%98%85-blue.svg)
4+
![image](https://img.shields.io/badge/SpringBoot3-%E2%98%85%E2%98%85%E2%98%85%E2%98%85%E2%98%85-blue.svg)
55
![image](https://img.shields.io/badge/Freemarker-%E2%98%85%E2%98%85%E2%98%85%E2%98%85%E2%98%85-blue.svg)
66
![image](https://img.shields.io/badge/CodeGenerator-%E2%98%85%E2%98%85%E2%98%85%E2%98%85%E2%98%85-blue.svg)
77
[![Java CI with Maven](https://github.com/moshowgame/SpringBootCodeGenerator/actions/workflows/maven.yml/badge.svg)](https://github.com/moshowgame/SpringBootCodeGenerator/actions/workflows/maven.yml)
@@ -73,6 +73,7 @@
7373
# Update Logs
7474
| 更新日期 | 更新内容 |
7575
|:-----------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
76+
| 2024年12月29日 | 优化前端加载速度,优化输出代码着色,CDN改字节跳动静态资源公共库。<br> |
7677
| 2024年12月23日 | 新增InsertSQL模式,采用JSQLParser引擎进行封装<br>优化代码封装<br>CDN恢复为staticfile.org加速(如果本地卡的话,建议切换local模式)。<br> |
7778
| 2024年04月23日 | 切换为更快更稳定的BootCDN进行加速。<br>前端NEWUI改版(基于AdminLTE+Bootstrap+Vue+ElementUI混合模式)。 |
7879
| 2024年04月22日 | [Java CI with Maven](https://github.com/moshowgame/SpringBootCodeGenerator/actions/workflows/maven.yml) 更新<br>SpringBoot升级到3.2.5<br>FastJSON升级到FastJSON2.0.49 |

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.softdev.system.generator.controller;
22

3+
import com.alibaba.fastjson2.JSONArray;
34
import com.softdev.system.generator.entity.ClassInfo;
45
import com.softdev.system.generator.entity.ParamInfo;
56
import com.softdev.system.generator.entity.ReturnT;
@@ -49,7 +50,7 @@ public ModelAndView mainPage() {
4950
@ResponseBody
5051
public ReturnT getAllTemplates() throws Exception {
5152
String templates = generatorService.getTemplateConfig();
52-
return ReturnT.ok().put("templates",templates);
53+
return ReturnT.ok().put("templates",JSONArray.parseArray(templates));
5354
}
5455
@PostMapping("/code/generate")
5556
@ResponseBody
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
spring:
22
profiles:
3-
active: bejson
3+
active: dev

‎generator-web/src/main/resources/statics/js/main.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ $(function(){
1717

1818
// init output code area
1919
$.outputArea = CodeMirror.fromTextArea(document.getElementById("outputArea"), {
20+
mode: "text/x-java", // JAV
2021
theme: "idea", // IDEA主题
2122
lineNumbers: true, //显示行号
2223
smartIndent: true, // 自动缩进
@@ -128,15 +129,21 @@ const vm = new Vue({
128129
}
129130
setAllCookie();
130131
//console.log(res.outputJson);
131-
vm.outputJson=res.outputJson;
132+
//兼容后端返回数据格式
133+
if(res.data){
134+
vm.outputJson = res.data.outputJson;
135+
}else {
136+
vm.outputJson = res.outputJson;
137+
}
138+
132139
// console.log(vm.outputJson["bootstrap-ui"]);
133140
vm.outputStr=vm.outputJson[vm.currentSelect].trim();
134141
//console.log(vm.outputJson["bootstrap-ui"]);
135142
//console.log(vm.outputStr);
136143
$.outputArea.setValue(vm.outputStr);
137144
$.outputArea.setSize('auto', 'auto');
138145
//add to historicalData
139-
vm.setHistoricalData(res.outputJson.tableName);
146+
vm.setHistoricalData(vm.outputJson.tableName);
140147
alert("生成成功");
141148
});
142149
},
@@ -150,8 +157,14 @@ const vm = new Vue({
150157
id:1234
151158
}).then(function(res){
152159
//console.log(res.templates);
153-
vm.templates = JSON.parse(res.templates);
154-
// console.log(vm.templates);
160+
// vm.templates = JSON.parse(res.templates);
161+
// console.log(res);
162+
//兼容后端返回数据格式
163+
if(res.data){
164+
vm.templates = res.data.templates;
165+
}else {
166+
vm.templates = res.templates;
167+
}
155168
});
156169
},
157170
updated: function () {

‎generator-web/src/main/resources/statics/libs/jquery.min.js

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎generator-web/src/main/resources/statics/libs/vue.min.js

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎generator-web/src/main/resources/statics/plugins/element-ui/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎generator-web/src/main/resources/statics/plugins/element-ui/theme-chalk/index.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎generator-web/src/main/resources/templates/header-CDN-v2.html

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,26 @@
33
<!--#################-->
44

55
<!--jquery | vue | element-ui | axios-->
6-
<script src="//cdn.staticfile.net/jquery/3.5.1/jquery.min.js"></script>
7-
<script src="//cdn.staticfile.net/vue/2.6.12/vue.min.js"></script>
8-
<script src="//cdn.staticfile.net/element-ui/2.15.14/index.min.js"></script>
9-
<linkrel="stylesheet" href="//cdn.staticfile.net/element-ui/2.15.0/theme-chalk/index.min.css">
10-
<scriptsrc="//cdn.staticfile.net/axios/0.1.0/axios.min.js"></script>
6+
<script src="//lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js"></script>
7+
<script src="//lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/2.6.14/vue.min.js"></script>
8+
<script src="//lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/axios/0.26.0/axios.min.js"></script>
9+
<scriptsrc="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/element-ui/2.15.7/index.min.js"></script>
10+
<linkhref="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/element-ui/2.15.7/theme-chalk/index.min.css" type="text/css" rel="stylesheet" />
1111

1212
<!--common.js-->
1313
<script src="${request.contextPath}/statics/js/common.js"></script>
1414
<!-- <link rel="stylesheet" href="${request.contextPath}/statics/css/main.css"> -->
1515

16-
<!--[if lt IE 9]>
17-
<script src="//cdn.staticfile.net/html5shiv/3.7.3/html5shiv.min.js"></script>
18-
<script src="//cdn.staticfile.net/respond.js/1.4.2/respond.min.js"></script>
19-
<![endif]-->
20-
21-
<!-- Bootstrap 4 -->
22-
<script src="//cdn.staticfile.net/bootstrap/4.6.2/js/bootstrap.bundle.min.js"></script>
23-
<!-- AdminLTE 3 -->
24-
<script src="//cdn.staticfile.net/admin-lte/3.2.0/js/adminlte.min.js"></script>
25-
<!-- Toastr 2 -->
26-
<script src="//cdn.staticfile.net/toastr.js/2.1.4/toastr.min.js"></script>
16+
<script src="//lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/toastr.js/2.1.4/toastr.min.js"></script>
17+
<!-- Toastr CSS -->
18+
<link href="//lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/toastr.js/2.1.4/toastr.min.css" rtype="text/css" rel="stylesheet" >
2719

2820
<!-- import codemirror -->
29-
<script src="//cdn.staticfile.net/codemirror/6.65.7/codemirror.min.js"></script>
30-
<script src="//cdn.staticfile.net/codemirror/6.65.7/mode/sql/sql.min.js"></script>
31-
<script src="//cdn.staticfile.net/codemirror/6.65.7/mode/xml/xml.min.js"></script>
32-
<script src="//cdn.staticfile.net/codemirror/6.65.7/mode/clike/clike.min.js"></script>
33-
<script src="//cdn.staticfile.net/codemirror/6.65.7/mode/javascript/javascript.min.js"></script>
34-
<link rel="stylesheet" href="//cdn.staticfile.net/codemirror/6.65.7/codemirror.min.css">
35-
<link rel="stylesheet" href="//cdn.staticfile.net/codemirror/6.65.7/theme/idea.min.css">
36-
37-
<!--bootsrap css-->
38-
<link rel="stylesheet" href="//cdn.staticfile.net/bootstrap/4.6.2/css/bootstrap.min.css">
39-
<link rel="stylesheet" href="${request.contextPath}/statics/plugins/fontawesome-free/css/all.min.css">
21+
<script src="//lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/codemirror/5.65.2/codemirror.min.js"></script>
22+
<script src="//lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/codemirror/5.65.2/mode/sql/sql.min.js"></script>
23+
<link href="//lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/codemirror/5.65.2/mode/clike/clike.min.js" type="text/css" rel="stylesheet" >
24+
<link href="//lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/codemirror/5.65.2/codemirror.min.css" type="text/css" rel="stylesheet" >
25+
<link href="//lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/codemirror/5.65.2/theme/idea.min.css" type="text/css" rel="stylesheet" >
4026

4127
<!-- Admin-LTE主题样式 -->
42-
<link rel="stylesheet" href="//cdn.staticfile.net/admin-lte/3.2.0/css/adminlte.min.css">
43-
44-
<!-- Toastr CSS -->
45-
<link href="//cdn.staticfile.net/toastr.js/2.1.4/toastr.min.css" rel="stylesheet">
28+
<link href="//lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/admin-lte/3.2.0/css/adminlte.min.css" type="text/css" rel="stylesheet" >

‎generator-web/src/main/resources/templates/header-CDN.html

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /