📝 编写文档

This commit is contained in:
冷冷 committed 2018-08-03 08:59:19 +08:00
1 parent 3a80957f29
commit 33b50b694b
3 files changed
+85 -6

No files matched your search

+4 -2
View File
@@ -1,3 +1,5 @@
[部署说明](deploy.md)
> [部署说明](deploy.md)
[swagger使用](swagger.md)
> [swagger使用](swagger.md)
> [代码生成使用](codegen.md)
+77
View File
@@ -0,0 +1,77 @@
## 代码生成使用
v 1.4.0 提供了代码图形化生成功能。
### 功能支持
##### 前端:
> api.js
> crud.js
>
> index.vue
##### 后端
> entity
>
> mapper
>
> service
>
> Controller
### 升级要点
> 升级pigx-ui pigx 到 **v 1.4.0**版本
>
> 更新数据库脚本,doc/pigx.sql
### 开始使用
##### 项目启动
1. 启动 pigx-eureka、pigx-config、pigx-gateway、pigx-auth、pigx-upms-biz
2. 启动**PigxCodeGenApplication**
3. 启动**pigx-ui**
##### 界面操作
1. 代码生成模块
![](http://obq1lvsd9.bkt.clouddn.com/20180803083802.png)
2. 选择要生成的表
> 以下为空则从**pigx-codegen/generator.properties** 获取
![](http://obq1lvsd9.bkt.clouddn.com/20180803084058.png)
3. 解压下载的**pigx_code_gen.zip**
> 生成代码结构,安装前后端 maven 、vue-cli 目录生成,可以覆盖到指定业务模块
![](http://obq1lvsd9.bkt.clouddn.com/20180803084524.png)
4. **重点讲解生成的SQL使用**
> 生成的SQL脚本,不要直接执行,完善 菜单、按钮的菜单ID 的层级
>
> PS: 为什么菜单ID 不自动生成呢?
>
> - [x] ​ 通过自己录入保证,数据库展示层级。
>
> - [x] ​ 比如 父菜单 ID 为 1,子菜单的ID 则为 11,按钮ID 为 12,13,14
```lua
1
├── 11
├── 12
├── 13
├── 14
```
![](http://obq1lvsd9.bkt.clouddn.com/20180803084905.png)
##### 最后给角色分配,你新增的菜单和按钮喔
@@ -2,12 +2,12 @@
-- 菜单SQL
insert into `pigx`.`sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
values ( '1', 'views/${moduleName}/${pathName}/index', '菜单ID', '0', '${pathName}', 'icon-bangzhushouji', '8', '0', '2018-01-20 13:17:19', '8', '2018-07-29 13:38:19', '${comments}管理');
values ( '父菜单ID', 'views/${moduleName}/${pathName}/index', '菜单ID', '0', '${pathName}', 'icon-bangzhushouji', '8', '0', '2018-01-20 13:17:19', '8', '2018-07-29 13:38:19', '${comments}管理');
-- 菜单对应按钮SQL
insert into `pigx`.`sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
values ( '子按钮ID1', null, '${moduleName}_${pathName}_add', '1', null, '1', '81', '0', '2018-05-15 21:35:18', '0', '2018-07-29 13:38:59', '${comments}新增');
values ( '子按钮ID1', null, '${moduleName}_${pathName}_add', '1', null, '1', '菜单ID', '0', '2018-05-15 21:35:18', '0', '2018-07-29 13:38:59', '${comments}新增');
insert into `pigx`.`sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
values ( '子按钮ID2', null, '${moduleName}_${pathName}_edit', '1', null, '1', '81', '0', '2018-05-15 21:35:18', '1', '2018-07-29 13:38:59', '${comments}修改');
values ( '子按钮ID2', null, '${moduleName}_${pathName}_edit', '1', null, '1', '菜单ID', '0', '2018-05-15 21:35:18', '1', '2018-07-29 13:38:59', '${comments}修改');
insert into `pigx`.`sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
values ( '子按钮ID3', null, '${moduleName}_${pathName}_del', '1', null, '1', '81', '0', '2018-05-15 21:35:18', '2', '2018-07-29 13:38:59', '${comments}删除');
values ( '子按钮ID3', null, '${moduleName}_${pathName}_del', '1', null, '1', '菜单ID', '0', '2018-05-15 21:35:18', '2', '2018-07-29 13:38:59', '${comments}删除');