Skip to content

Commit

Permalink
Merge pull request #95 from geekidea/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
springboot-plus authored Nov 2, 2019
2 parents 5fce156 + b103023 commit cca307b
Show file tree
Hide file tree
Showing 37 changed files with 1,049 additions and 204 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG_TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# CHANGELOG TODO

## [V1.4]
- 部门树形列表

## [V1.5]
- 代码生成起优化,是否生成自定义update方法,生成version,deleted注解
- 黑白名单,配置文件和数据库可配置,并缓存到Redis
- Redis Cache注解使用
- ok http工具类
- Excel解析,导入导出
- 项目代码遵循阿里代码规范优化
- 字典表
- 配置参数表
- 上传文件附件表
- Redis分布式锁
- 接口限流,ip限流,频率限流
- Shiro Redis缓存
- ApplicationRunner


## [V1.6]
- Spring security集成
- HikariCP
127 changes: 83 additions & 44 deletions README-zh.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center">
<a href="https://github.com/geekidea/spring-boot-plus">
<img alt="spring-boot-plus logo" src="https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/img/logo.png">
<img alt="spring-boot-plus logo" src="https://springboot.plus/img/logo.png">
</a>
</p>
<p align="center">
Expand Down Expand Up @@ -102,45 +102,44 @@ mvn clean package -Plocal

### 1. 创建数据库表
```sql

-- ----------------------------
-- Table structure for sys_user
-- Table structure for foo_bar
-- ----------------------------
drop table if exists `sys_user`;
create table sys_user
DROP TABLE IF EXISTS `foo_bar`;
CREATE TABLE `foo_bar`
(
id bigint not null comment '主键'
primary key,
username varchar(20) not null comment '用户名',
nickname varchar(20) null comment '昵称',
password varchar(64) not null comment '密码',
salt varchar(32) null comment '盐值',
remark varchar(200) null comment 'remark',
status int default 1 not null comment '状态,0:禁用,1:启用',
create_time timestamp default CURRENT_TIMESTAMP null comment '创建时间',
update_time timestamp null comment '修改时间',
constraint sys_user_username_uindex
unique (username)
)
comment '系统用户';
`id` bigint(20) NOT NULL COMMENT '主键',
`name` varchar(20) NOT NULL COMMENT '名称',
`foo` varchar(20) DEFAULT NULL COMMENT 'Foo',
`bar` varchar(20) NOT NULL COMMENT 'Bar',
`remark` varchar(200) DEFAULT NULL COMMENT '备注',
`state` int(11) NOT NULL DEFAULT '1' COMMENT '状态,0:禁用,1:启用',
`version` int(11) NOT NULL DEFAULT '0' COMMENT '版本',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT ='FooBar';

-- ----------------------------
-- Records of sys_user
-- Records of foo_bar
-- ----------------------------
INSERT INTO spring_boot_plus.sys_user (id, username, nickname, password, salt, remark, state, create_time, update_time)
VALUES (1, 'admin', '管理员', '751ade2f90ceb660cb2460f12cc6fe08268e628e4607bdb88a00605b3d66973c', 'e4cc3292e3ebc483998adb2c0e4e640e', 'Administrator Account', 1, '2019-08-26 00:52:01', null);
INSERT INTO spring_boot_plus.sys_user (id, username, nickname, password, salt, remark, state, create_time, update_time)
VALUES (2, 'test', '测试人员', '751ade2f90ceb660cb2460f12cc6fe08268e628e4607bdb88a00605b3d66973c', '99952b31c18156169a26bec80fd211f6', 'Tester Account', 1, '2019-10-05 14:04:27', null);
INSERT INTO foo_bar (id, name, foo, bar, remark, state, version, create_time, update_time)
VALUES (1, 'FooBar', 'foo', 'bar', 'remark...', 1, 0, '2019-11-01 14:05:14', null);
INSERT INTO foo_bar (id, name, foo, bar, remark, state, version, create_time, update_time)
VALUES (2, 'HelloWorld', 'hello', 'world', null, 1, 0, '2019-11-01 14:05:14', null);

```


### 2.使用代码生成器生成增删改查代码
> 修改数据库信息
>修改组件名称/作者/数据库表名称/主键id
```text
/src/test/java/io/geekidea/springbootplus/test/CodeGenerator.java
/src/test/java/io/geekidea/springbootplus/test/SpringBootPlusGenerator.java
```

```java
Expand Down Expand Up @@ -169,7 +168,7 @@ public class SpringBootPlusGenerator {

// 组件作者等配置
codeGenerator
.setModuleName("system")
.setModuleName("foobar")
.setAuthor("geekidea")
.setPkIdColumnName("id");

Expand All @@ -195,7 +194,7 @@ public class SpringBootPlusGenerator {
.setGeneratorMapperXml(true);

// 是否生成Shiro RequiresPermissions注解
codeGenerator.setRequiresPermissions(true);
codeGenerator.setRequiresPermissions(false);

// 是否覆盖已有文件
codeGenerator.setFileOverride(true);
Expand All @@ -206,9 +205,7 @@ public class SpringBootPlusGenerator {
// 需要生成的表数组
// xxx,yyy,zzz为需要生成代码的表名称
String[] tables = {
"xxx",
"yyy",
"zzz",
"foo_bar"
};

// 循环生成
Expand All @@ -227,31 +224,30 @@ public class SpringBootPlusGenerator {
> 生成的代码结构
```text
/src/main/java/io/geekidea/springbootplus/system
/src/main/java/io/geekidea/springbootplus/foobar
```

```text
└── system
└── foobar
├── controller
│   └── FooBarController.java
├── entity
│   └── SysUser.java
│   └── FooBar.java
├── mapper
│   └── SysUserMapper.java
│   └── FooBarMapper.java
├── param
│   └── FooBarQueryParam.java
├── service
│   ├── SysUserService.java
│   ├── FooBarService.java
│   └── impl
│   └── SysUserServiceImpl.java
└── web
├── controller
│   └── SysUserController.java
├── param
│   └── SysUserQueryParam.java
└── vo
└── SysUserQueryVo.java
│   └── FooBarServiceImpl.java
└── vo
└── FooBarQueryVo.java
```

> Mapper XML
```text
/src/main/resources/mapper/system/SysUserMapper.xml
/src/main/resources/mapper/foobar/FooBarMapper.xml
```

### 3. 启动项目
Expand Down Expand Up @@ -350,6 +346,49 @@ sh deploy.sh
tail -f -n 1000 /root/spring-boot-plus-server/logs/spring-boot-plus.log
```
## spring-boot-plus Views
### spring-boot-plus IDEA Sources Views
![spring-boot-plus-idea](https://spring-boot-plus.gitee.io/img/home/spring-boot-plus-idea.png)
### [Spring Boot Admin Instances](http://47.105.159.10:8888/instances/e211ba082db8/details)
<p>
<a href="http://47.105.159.10:8888/instances/e211ba082db8/details">
<img src="https://spring-boot-plus.gitee.io/img/home/spring-boot-admin.png" alt="spring-boot-admin instances">
</a>
</p>
### [Spring Boot Admin Statistics](http://47.105.159.10:8888/instances/e211ba082db8/details)
<p>
<a href="http://47.105.159.10:8888/instances/e211ba082db8/details">
<img src="https://spring-boot-plus.gitee.io/img/home/spring-boot-admin-1.png" alt="spring-boot-admin statistics">
</a>
</p>
### [Spring Boot Admin Log](http://47.105.159.10:8888/instances/e211ba082db8/logfile)
<p>
<a href="http://47.105.159.10:8888/instances/e211ba082db8/logfile">
<img src="https://spring-boot-plus.gitee.io/img/home/spring-boot-admin-log.png" alt="spring-boot-admin log">
</a>
</p>
### [spring-boot-plus Swagger文档](http://47.105.159.10:8888/swagger-ui.html)
<p>
<a href="http://47.105.159.10:8888/swagger-ui.html">
<img src="https://spring-boot-plus.gitee.io/img/home/spring-boot-plus-swagger.png" alt="spring-boot-plus swagger docs">
</a>
</p>
### [spring-boot-plus Java Api Docs](http://geekidea.io/spring-boot-plus-apidocs/)
<p>
<a href="http://geekidea.io/spring-boot-plus-apidocs/">
<img src="https://spring-boot-plus.gitee.io/img/home/spring-boot-plus-java-apidocs.png" alt="spring-boot-plus Java Api Docs">
</a>
</p>
## spring-boot-plus 视频 :movie_camera:
- [5分钟完成增删改查](https://www.bilibili.com/video/av67401204)
- [CentOS 快速安装 JDK/Git/Maven/Redis/MySQL](https://www.bilibili.com/video/av67218836/)
Expand Down
Loading

0 comments on commit cca307b

Please sign in to comment.