99
1010<p align =" center " >
1111 <a href =" https://github.com/geekidea/spring-boot-plus/ " >
12- <img alt="spring-boot-plus version" src="https://img.shields.io/badge/spring--boot--plus-1.3.1.RELEASE -blue">
12+ <img alt="spring-boot-plus version" src="https://img.shields.io/badge/spring--boot--plus-1.4.0 -blue">
1313 </a >
1414 <a href =" https://github.com/spring-projects/spring-boot " >
15- <img alt="spring boot version" src="https://img.shields.io/badge/spring%20boot-2.1.9 .RELEASE-brightgreen">
15+ <img alt="spring boot version" src="https://img.shields.io/badge/spring%20boot-2.2.0 .RELEASE-brightgreen">
1616 </a >
1717 <a href =" https://www.apache.org/licenses/LICENSE-2.0 " >
1818 <img alt="code style" src="https://img.shields.io/badge/license-Apache%202-4EB1BA.svg?style=flat-square">
@@ -60,12 +60,12 @@ Redis | 3.2+ | |
6060### Technology stack
6161Component| Version | Remark
6262-|-|-
63- Spring Boot | 2.1.9 .RELEASE | Latest release stable version |
64- Spring Framework | 5.1.10 .RELEASE | Latest release stable version |
63+ Spring Boot | 2.2.0 .RELEASE | Latest release stable version |
64+ Spring Framework | 5.2.0 .RELEASE | Latest release stable version |
6565Mybatis | 3.5.2 | DAO Framework |
6666Mybatis Plus | 3.2.0 | mybatis Enhanced framework |
6767Alibaba Druid | 1.1.20 | Data source |
68- Fastjson | 1.2.60 | JSON processing toolset |
68+ Fastjson | 1.2.62 | JSON processing toolset |
6969swagger2 | 2.6.1 | Api document generation tool |
7070commons-lang3 | 3.9 | Apache language toolkit |
7171commons-io | 2.6 | Apache IO Toolkit |
@@ -75,9 +75,9 @@ reflections | 0.9.11 | Reflection Toolkit |
7575hibernate-validator | 6.0.17.Final | Validator toolkit |
7676Shiro | 1.4.1 | Permission control |
7777JWT | 3.8.3 | JSON WEB TOKEN |
78- hutool-all | 4.6.10 | Common toolset |
79- lombok | 1.18.8 | Automatically plugs |
80- mapstruct | 1.3.0 .Final | Object property replication tool |
78+ hutool-all | 5.0.3 | Common toolset |
79+ lombok | 1.18.10 | Automatically plugs |
80+ mapstruct | 1.3.1 .Final | Object property replication tool |
8181
8282## CHANGELOG
8383#### [ CHANGELOG.md] ( https://github.com/geekidea/spring-boot-plus/blob/master/CHANGELOG.md )
@@ -129,10 +129,10 @@ create table sys_user
129129-- ----------------------------
130130-- Records of sys_user
131131-- ----------------------------
132- INSERT INTO spring_boot_plus .sys_user (id, username, nickname, password, salt, remark, status , create_time, update_time)
132+ INSERT INTO spring_boot_plus .sys_user (id, username, nickname, password, salt, remark, state , create_time, update_time)
133133 VALUES (1 , ' admin' , ' Administrators' , ' 751ade2f90ceb660cb2460f12cc6fe08268e628e4607bdb88a00605b3d66973c' , ' e4cc3292e3ebc483998adb2c0e4e640e' , ' Administrator Account' , 1 , ' 2019-08-26 00:52:01' , null );
134134
135- INSERT INTO spring_boot_plus .sys_user (id, username, nickname, password, salt, remark, status , create_time, update_time)
135+ INSERT INTO spring_boot_plus .sys_user (id, username, nickname, password, salt, remark, state , create_time, update_time)
136136 VALUES (2 , ' test' , ' Testers' , ' 751ade2f90ceb660cb2460f12cc6fe08268e628e4607bdb88a00605b3d66973c' , ' 99952b31c18156169a26bec80fd211f6' , ' Tester Account' , 1 , ' 2019-10-05 14:04:27' , null );
137137
138138```
@@ -149,33 +149,76 @@ INSERT INTO spring_boot_plus.sys_user (id, username, nickname, password, salt, r
149149``` java
150150/**
151151 * spring-boot-plus Code Generator
152+ *
152153 * @author geekidea
153- * @date 2018-11-08
154- */
155- public class CodeGenerator {
156- private static final String USER_NAME = " root" ;
157- private static final String PASSWORD = " root" ;
158- private static final String DRIVER_NAME = " com.mysql.jdbc.Driver" ;
159- private static final String DRIVER_URL = " jdbc:mysql://localhost:3306/spring_boot_plus?useUnicode=true&characterEncoding=UTF-8&useSSL=false" ;
160- // CODE...
161- // ############################ Config start ############################
162- // Module name
163- private static final String MODULE_NAME = " system" ;
164- // Author
165- private static final String AUTHOR = " geekidea" ;
166- // Table name
167- private static final String TABLE_NAME = " sys_user" ;
168- // Primary key id
169- private static final String PK_ID_COLUMN_NAME = " id" ;
170- // Generator strategy. true:All / false:SIMPLE
171- private static final boolean GENERATOR_STRATEGY = true ;
172- // Pagination list query Whether to sort. true:sort/false:non
173- private static final boolean PAGE_LIST_ORDER = false ;
174- // ############################ Config end ############################
154+ * @date 2019-10-22
155+ **/
156+ public class SpringBootPlusGenerator {
175157
176158 public static void main (String [] args ) {
177- // Run...
159+ CodeGenerator codeGenerator = new CodeGenerator ();
160+ // Common configuration
161+ // Database configuration
162+ codeGenerator
163+ .setUserName(" root" )
164+ .setPassword(" root" )
165+ .setDriverName(" com.mysql.jdbc.Driver" )
166+ .setDriverUrl(" jdbc:mysql://localhost:3306/spring_boot_plus?useUnicode=true&characterEncoding=UTF-8&useSSL=false" );
167+
168+ // Configuration package information
169+ codeGenerator
170+ .setProjectPackagePath(" io/geekidea/springbootplus" )
171+ .setParentPackage(" io.geekidea.springbootplus" );
172+
173+ // Configuration of component author, etc.
174+ codeGenerator
175+ .setModuleName(" system" )
176+ .setAuthor(" geekidea" )
177+ .setPkIdColumnName(" id" );
178+
179+ // Generation strategy
180+ codeGenerator
181+ .setGeneratorStrategy(CodeGenerator . GeneratorStrategy . ALL )
182+ .setPageListOrder(true )
183+ .setParamValidation(true );
184+
185+ // Customize which files are generated automatically
186+ codeGenerator
187+ .setGeneratorEntity(true )
188+ .setGeneratorQueryParam(true )
189+ .setGeneratorQueryVo(true );
190+
191+ // Generate business related codes
192+ codeGenerator
193+ .setGeneratorController(true )
194+ .setGeneratorService(true )
195+ .setGeneratorServiceImpl(true )
196+ .setGeneratorMapper(true )
197+ .setGeneratorMapperXml(true );
198+
199+ // Overwrite existing file or not
200+ codeGenerator. setFileOverride(true );
201+
202+ // Initialize common variables
203+ codeGenerator. init();
204+
205+ // Table array to be generated
206+ String [] tables = {
207+ " xxx" ,
208+ " yyy" ,
209+ " zzz" ,
210+ };
211+
212+ // Cycle generation
213+ for (String table : tables) {
214+ // Set the name of the table to be generated
215+ codeGenerator. setTableName(table);
216+ // Generate code
217+ codeGenerator. generator();
218+ }
219+
178220 }
221+
179222}
180223```
181224
0 commit comments