Skip to content

Commit c2a1385

Browse files
Merge pull request #90 from geekidea/dev
🚔 1.4.0 用户角色权限部门
2 parents 3a673c4 + 11c42db commit c2a1385

File tree

118 files changed

+5779
-818
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+5779
-818
lines changed

README-zh.md

Lines changed: 79 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
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">
@@ -58,12 +58,12 @@ Redis | 3.2+ | |
5858
### 技术选型
5959
技术 | 版本 | 备注
6060
-|-|-
61-
Spring Boot | 2.1.9.RELEASE | 最新发布稳定版 |
62-
Spring Framework | 5.1.10.RELEASE | 最新发布稳定版 |
61+
Spring Boot | 2.2.0.RELEASE | 最新发布稳定版 |
62+
Spring Framework | 5.2.0.RELEASE | 最新发布稳定版 |
6363
Mybatis | 3.5.2 | 持久层框架 |
6464
Mybatis Plus | 3.2.0 | mybatis增强框架 |
6565
Alibaba Druid | 1.1.20 | 数据源 |
66-
Fastjson | 1.2.60 | JSON处理工具集 |
66+
Fastjson | 1.2.62 | JSON处理工具集 |
6767
swagger2 | 2.6.1 | api文档生成工具 |
6868
commons-lang3 | 3.9 | 常用工具包 |
6969
commons-io | 2.6 | IO工具包 |
@@ -73,9 +73,9 @@ reflections | 0.9.11 | 反射工具包 |
7373
hibernate-validator | 6.0.17.Final | 后台参数校验注解 |
7474
Shiro | 1.4.1 | 权限控制 |
7575
JWT | 3.8.3 | JSON WEB TOKEN |
76-
hutool-all | 4.6.10 | 常用工具集 |
77-
lombok | 1.18.8 | 注解生成Java Bean等工具 |
78-
mapstruct | 1.3.0.Final | 对象属性复制工具 |
76+
hutool-all | 5.0.3 | 常用工具集 |
77+
lombok | 1.18.10 | 注解生成Java Bean等工具 |
78+
mapstruct | 1.3.1.Final | 对象属性复制工具 |
7979

8080
## CHANGELOG
8181
#### [CHANGELOG.md](https://github.com/geekidea/spring-boot-plus/blob/master/CHANGELOG.md)
@@ -127,9 +127,9 @@ create table sys_user
127127
-- ----------------------------
128128
-- Records of sys_user
129129
-- ----------------------------
130-
INSERT INTO spring_boot_plus.sys_user (id, username, nickname, password, salt, remark, status, create_time, update_time)
130+
INSERT INTO spring_boot_plus.sys_user (id, username, nickname, password, salt, remark, state, create_time, update_time)
131131
VALUES (1, 'admin', '管理员', '751ade2f90ceb660cb2460f12cc6fe08268e628e4607bdb88a00605b3d66973c', 'e4cc3292e3ebc483998adb2c0e4e640e', 'Administrator Account', 1, '2019-08-26 00:52:01', null);
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 (2, 'test', '测试人员', '751ade2f90ceb660cb2460f12cc6fe08268e628e4607bdb88a00605b3d66973c', '99952b31c18156169a26bec80fd211f6', 'Tester Account', 1, '2019-10-05 14:04:27', null);
134134

135135
```
@@ -146,33 +146,78 @@ INSERT INTO spring_boot_plus.sys_user (id, username, nickname, password, salt, r
146146
```java
147147
/**
148148
* spring-boot-plus代码生成器入口类
149+
*
149150
* @author geekidea
150-
* @date 2018-11-08
151-
*/
152-
public class CodeGenerator {
153-
private static final String USER_NAME = "root";
154-
private static final String PASSWORD = "root";
155-
private static final String DRIVER_NAME = "com.mysql.jdbc.Driver";
156-
private static final String DRIVER_URL = "jdbc:mysql://localhost:3306/spring_boot_plus?useUnicode=true&characterEncoding=UTF-8&useSSL=false";
157-
// CODE...
158-
// ############################ 配置部分 start ############################
159-
// 模块名称
160-
private static final String MODULE_NAME = "system";
161-
// 作者
162-
private static final String AUTHOR = "geekidea";
163-
// 生成的表名称
164-
private static final String TABLE_NAME = "sys_user";
165-
// 主键数据库列名称
166-
private static final String PK_ID_COLUMN_NAME = "id";
167-
// 代码生成策略 true:All/false:SIMPLE
168-
private static final boolean GENERATOR_STRATEGY = true;
169-
// 分页列表查询是否排序 true:有排序参数/false:无
170-
private static final boolean PAGE_LIST_ORDER = false;
171-
// ############################ 配置部分 end ############################
172-
151+
* @date 2019-10-22
152+
**/
153+
public class SpringBootPlusGenerator {
154+
173155
public static void main(String[] args) {
174-
// Run...
156+
CodeGenerator codeGenerator = new CodeGenerator();
157+
// 公共配置
158+
// 数据库配置
159+
codeGenerator
160+
.setUserName("root")
161+
.setPassword("root")
162+
.setDriverName("com.mysql.jdbc.Driver")
163+
.setDriverUrl("jdbc:mysql://localhost:3306/spring_boot_plus?useUnicode=true&characterEncoding=UTF-8&useSSL=false");
164+
165+
// 包信息
166+
codeGenerator
167+
.setProjectPackagePath("io/geekidea/springbootplus")
168+
.setParentPackage("io.geekidea.springbootplus");
169+
170+
// 组件作者等配置
171+
codeGenerator
172+
.setModuleName("system")
173+
.setAuthor("geekidea")
174+
.setPkIdColumnName("id");
175+
176+
// 生成策略
177+
codeGenerator
178+
.setGeneratorStrategy(CodeGenerator.GeneratorStrategy.ALL)
179+
.setPageListOrder(true)
180+
.setParamValidation(true);
181+
182+
// 生成实体映射相关代码,可用于数据库字段更新
183+
// 当数据库字段更新时,可自定义自动生成哪些那文件
184+
codeGenerator
185+
.setGeneratorEntity(true)
186+
.setGeneratorQueryParam(true)
187+
.setGeneratorQueryVo(true);
188+
189+
// 生成业务相关代码
190+
codeGenerator
191+
.setGeneratorController(true)
192+
.setGeneratorService(true)
193+
.setGeneratorServiceImpl(true)
194+
.setGeneratorMapper(true)
195+
.setGeneratorMapperXml(true);
196+
197+
// 是否覆盖已有文件
198+
codeGenerator.setFileOverride(true);
199+
200+
// 初始化公共变量
201+
codeGenerator.init();
202+
203+
// 需要生成的表数组
204+
// xxx,yyy,zzz为需要生成代码的表名称
205+
String[] tables = {
206+
"xxx",
207+
"yyy",
208+
"zzz",
209+
};
210+
211+
// 循环生成
212+
for (String table : tables) {
213+
// 设置需要生成的表名称
214+
codeGenerator.setTableName(table);
215+
// 生成代码
216+
codeGenerator.generator();
217+
}
218+
175219
}
220+
176221
}
177222
```
178223

README.md

Lines changed: 76 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
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
6161
Component| 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 |
6565
Mybatis | 3.5.2 | DAO Framework |
6666
Mybatis Plus | 3.2.0 | mybatis Enhanced framework |
6767
Alibaba Druid | 1.1.20 | Data source |
68-
Fastjson | 1.2.60 | JSON processing toolset |
68+
Fastjson | 1.2.62 | JSON processing toolset |
6969
swagger2 | 2.6.1 | Api document generation tool |
7070
commons-lang3 | 3.9 | Apache language toolkit |
7171
commons-io | 2.6 | Apache IO Toolkit |
@@ -75,9 +75,9 @@ reflections | 0.9.11 | Reflection Toolkit |
7575
hibernate-validator | 6.0.17.Final | Validator toolkit |
7676
Shiro | 1.4.1 | Permission control |
7777
JWT | 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

Comments
 (0)