mirror of
https://gitee.com/raoxy/kongx.git
synced 2025-07-10 00:00:02 +08:00
Compare commits
28 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
7638d3e386 | ||
|
93f1214db7 | ||
|
03af3ce80e | ||
|
6269e3ce1c | ||
|
424d7b0da9 | ||
|
54fa042da2 | ||
|
61224f5da9 | ||
|
d01e280cf4 | ||
|
ebc9264206 | ||
|
a01d1f0b1e | ||
|
0adb867fb7 | ||
|
0786a823a2 | ||
|
71cdbaf39d | ||
|
247c847266 | ||
|
e663192f57 | ||
|
560b044d6b | ||
|
6836ab7cfe | ||
|
a02c3d1938 | ||
|
ccf0a38548 | ||
|
10ee910c8f | ||
|
e603a9b47b | ||
|
ab43b03afa | ||
|
a7cebff190 | ||
|
6212311f68 | ||
|
01998df98d | ||
|
1711668a9c | ||
|
6dff4ef19a | ||
|
06e7a9f33f |
4
.travis.yml
Normal file
4
.travis.yml
Normal file
@ -0,0 +1,4 @@
|
||||
language: java
|
||||
|
||||
jdk:
|
||||
- oraclejdk8
|
53
.workflow/branch-pipeline.yml
Normal file
53
.workflow/branch-pipeline.yml
Normal file
@ -0,0 +1,53 @@
|
||||
version: '1.0'
|
||||
name: branch-pipeline
|
||||
displayName: BranchPipeline
|
||||
stages:
|
||||
- stage:
|
||||
name: compile
|
||||
displayName: 编译
|
||||
steps:
|
||||
- step: build@maven
|
||||
name: build_maven
|
||||
displayName: Maven 构建
|
||||
# 支持6、7、8、9、10、11六个版本
|
||||
jdkVersion: 8
|
||||
# 支持2.2.1、3.2.5、3.3.9、3.5.2、3.5.3、3.5.4、3.6.1、3.6.3八个版本
|
||||
mavenVersion: 3.3.9
|
||||
# 构建命令
|
||||
commands:
|
||||
- mvn -B clean package -Dmaven.test.skip=true
|
||||
# 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除
|
||||
artifacts:
|
||||
# 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
|
||||
- name: BUILD_ARTIFACT
|
||||
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径,如通常jar包在target目录下。当前目录为代码库根目录
|
||||
path:
|
||||
- ./target
|
||||
- step: publish@general_artifacts
|
||||
name: publish_general_artifacts
|
||||
displayName: 上传制品
|
||||
# 上游构建任务定义的产物名,默认BUILD_ARTIFACT
|
||||
dependArtifact: BUILD_ARTIFACT
|
||||
# 上传到制品库时的制品命名,默认output
|
||||
artifactName: output
|
||||
dependsOn: build_maven
|
||||
- stage:
|
||||
name: release
|
||||
displayName: 发布
|
||||
steps:
|
||||
- step: publish@release_artifacts
|
||||
name: publish_release_artifacts
|
||||
displayName: '发布'
|
||||
# 上游上传制品任务的产出
|
||||
dependArtifact: output
|
||||
# 发布制品版本号
|
||||
version: '1.0.0.0'
|
||||
# 是否开启版本号自增,默认开启
|
||||
autoIncrement: true
|
||||
triggers:
|
||||
push:
|
||||
branches:
|
||||
exclude:
|
||||
- master
|
||||
include:
|
||||
- .*
|
51
.workflow/master-pipeline.yml
Normal file
51
.workflow/master-pipeline.yml
Normal file
@ -0,0 +1,51 @@
|
||||
version: '1.0'
|
||||
name: master-pipeline
|
||||
displayName: MasterPipeline
|
||||
stages:
|
||||
- stage:
|
||||
name: compile
|
||||
displayName: 编译
|
||||
steps:
|
||||
- step: build@maven
|
||||
name: build_maven
|
||||
displayName: Maven 构建
|
||||
# 支持6、7、8、9、10、11六个版本
|
||||
jdkVersion: 8
|
||||
# 支持2.2.1、3.2.5、3.3.9、3.5.2、3.5.3、3.5.4、3.6.1、3.6.3八个版本
|
||||
mavenVersion: 3.3.9
|
||||
# 构建命令
|
||||
commands:
|
||||
- mvn -B clean package -Dmaven.test.skip=true
|
||||
# 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除
|
||||
artifacts:
|
||||
# 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
|
||||
- name: BUILD_ARTIFACT
|
||||
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径,如通常jar包在target目录下。当前目录为代码库根目录
|
||||
path:
|
||||
- ./target
|
||||
- step: publish@general_artifacts
|
||||
name: publish_general_artifacts
|
||||
displayName: 上传制品
|
||||
# 上游构建任务定义的产物名,默认BUILD_ARTIFACT
|
||||
dependArtifact: BUILD_ARTIFACT
|
||||
# 上传到制品库时的制品命名,默认output
|
||||
artifactName: output
|
||||
dependsOn: build_maven
|
||||
- stage:
|
||||
name: release
|
||||
displayName: 发布
|
||||
steps:
|
||||
- step: publish@release_artifacts
|
||||
name: publish_release_artifacts
|
||||
displayName: '发布'
|
||||
# 上游上传制品任务的产出
|
||||
dependArtifact: output
|
||||
# 发布制品版本号
|
||||
version: '1.0.0.0'
|
||||
# 是否开启版本号自增,默认开启
|
||||
autoIncrement: true
|
||||
triggers:
|
||||
push:
|
||||
branches:
|
||||
include:
|
||||
- master
|
40
.workflow/pr-pipeline.yml
Normal file
40
.workflow/pr-pipeline.yml
Normal file
@ -0,0 +1,40 @@
|
||||
version: '1.0'
|
||||
name: pr-pipeline
|
||||
displayName: PRPipeline
|
||||
stages:
|
||||
- stage:
|
||||
name: compile
|
||||
displayName: 编译
|
||||
steps:
|
||||
- step: build@maven
|
||||
name: build_maven
|
||||
displayName: Maven 构建
|
||||
# 支持6、7、8、9、10、11六个版本
|
||||
jdkVersion: 8
|
||||
# 支持2.2.1、3.2.5、3.3.9、3.5.2、3.5.3、3.5.4、3.6.1、3.6.3八个版本
|
||||
mavenVersion: 3.3.9
|
||||
# 构建命令
|
||||
commands:
|
||||
- mvn -B clean package -Dmaven.test.skip=true
|
||||
# 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除
|
||||
artifacts:
|
||||
# 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
|
||||
- name: BUILD_ARTIFACT
|
||||
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径,如通常jar包在target目录下。当前目录为代码库根目录
|
||||
path:
|
||||
- ./target
|
||||
- step: publish@general_artifacts
|
||||
name: publish_general_artifacts
|
||||
displayName: 上传制品
|
||||
# 上游构建任务定义的产物名,默认BUILD_ARTIFACT
|
||||
dependArtifact: BUILD_ARTIFACT
|
||||
# 构建产物制品库,默认default,系统默认创建
|
||||
artifactRepository: default
|
||||
# 上传到制品库时的制品命名,默认output
|
||||
artifactName: output
|
||||
dependsOn: build_maven
|
||||
triggers:
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- master
|
30
README.md
30
README.md
@ -1,17 +1,21 @@
|
||||
# kongx
|
||||
|
||||
|
||||
kongx(最新版本2.0.1)是网关kong的可视化界面管理平台(参考konga的部分界面布局方式),能够集中化管理应用不同环境的网关配置,提供同步各环境的网关配置功能,并且具备规范的权限管理、参数配置、环境管理及日志审计等特性。
|
||||
kongx(最新版本3.1.0)是网关kong的可视化界面管理平台(参考konga的部分界面布局方式),能够集中化管理应用不同环境的网关配置,提供同步各环境的网关配置功能,并且具备规范的权限管理、参数配置、环境管理及日志审计等特性。
|
||||
|
||||
基于Spring Boot和Spring Cloud开发,打包后可以直接运行,不需要额外安装Tomcat等应用容器,支持在线Shell。
|
||||
|
||||
Kongx 使用指南请参考:[Wiki](https://www.kancloud.cn/raoxiaoyan/kongx/1984321)
|
||||
|
||||
kongxe的前端页面[kongx-web](https://gitee.com/raoxy/kongx-web)
|
||||
|
||||
平台快速部署请参见[Quick Start](https://www.kancloud.cn/raoxiaoyan/kongx/1984323)
|
||||
|
||||
Docker部署(2.0.0+支持)请参见[Docker Quick Start](./docker-quick-start/readme.md)
|
||||
Docker部署(3.0.0+支持)请参见[Docker Quick Start](./docker-quick-start/readme.md)
|
||||
|
||||
演示地址:http://49.232.174.106/ (用户名: guest/123456)
|
||||
可视化设计网关pipeline使用文档请参考[网关流水线](https://www.kancloud.cn/raoxiaoyan/kongx/2055265)
|
||||
|
||||
演示地址:http://159.75.135.225/ (用户名: guest/123456)
|
||||
|
||||
系统环境默认用户:admin/123456(部署登录后,请前往'个人设置'页面,及时修改密码)
|
||||
## Screenshots
|
||||
@ -19,12 +23,10 @@ Docker部署(2.0.0+支持)请参见[Docker Quick Start](./docker-quick-start/rea
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
@ -33,6 +35,7 @@ Docker部署(2.0.0+支持)请参见[Docker Quick Start](./docker-quick-start/rea
|
||||
## Features
|
||||
|
||||
- Kong Manage:Upstream,Service,Route,Plugin,Consumer,Certificates及Ca Certificates等
|
||||
- 支持网关流水线
|
||||
- 同步Kong配置:不同环境间的kong配置进行同步,便于多环境配置管理;
|
||||
- 系统管理:具有完善的权限管理系统,包括:用户管理、菜单管理、角色管理及用户组管理等功能;
|
||||
- 参数管理:具有良好的扩展性,基于平台的参数管理可扩展多环境及服务管理;包括:环境管理、参数参数等
|
||||
@ -48,6 +51,8 @@ Docker部署(2.0.0+支持)请参见[Docker Quick Start](./docker-quick-start/rea
|
||||
- [Kong与consul自主发现服务](https://www.kancloud.cn/raoxiaoyan/kongx/1984357)
|
||||
- 如何应用灰度插件(canary)及使用场景介绍
|
||||
- kong插件开发实践
|
||||
- [kong的健康检查及熔断](https://www.kancloud.cn/raoxiaoyan/kongx/2044771)
|
||||
- kong网关流水线
|
||||
- 整理中...尽情期待
|
||||
|
||||
|
||||
@ -55,11 +60,11 @@ Docker部署(2.0.0+支持)请参见[Docker Quick Start](./docker-quick-start/rea
|
||||
|
||||
|
||||
## RoadMap
|
||||
1、初步计划kongx自适应kong后续所有版本;(2.0.0版本,已完成自动适配至2.1.x版本)
|
||||
1、初步计划kongx自适应kong后续所有版本;(3.1.0版本,已完成自动适配至3.1.x版本)
|
||||
|
||||
2、增加shell界面和可视化管理界面(2.0.1版本支持, 2020/11/18 已完成);
|
||||
|
||||
2、增加网关流水线的图形化界面设计;
|
||||
3、增加网关流水线的图形化界面设计;
|
||||
|
||||
## 技术支持
|
||||
<table>
|
||||
@ -69,8 +74,8 @@ Docker部署(2.0.0+支持)请参见[Docker Quick Start](./docker-quick-start/rea
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><img src="https://raw.githubusercontent.com/raoxiaoyan/kongx/master/docs/kongx_tech1.png" alt="tech-support-qq-1"></td>
|
||||
<td><img src="https://raw.githubusercontent.com/raoxiaoyan/kongx/master/docs/cooperate.jpg" alt="cooperate" width="230px;"></td>
|
||||
<td><img src="./docs/kongx_tech1.png" alt="tech-support-qq-1"></td>
|
||||
<td><img src="./docs/cooperate.jpg" alt="cooperate" width="230px;"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -80,7 +85,8 @@ Docker部署(2.0.0+支持)请参见[Docker Quick Start](./docker-quick-start/rea
|
||||
| 序号 | kongx版本 | Kong版本 | 说明 |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | 1.2.x | 1.2.x | 1.2.x测试|
|
||||
| 1 | 2.0.0 | 1.2.x、1.3.x、1.4.x、1.5.x、2.0.x | 目前仅针对kong版本1.2.x、1.3.x测试通过,对1.4.x以上版本与1.3.x对比差异,原则上基础功能全部可用,(参考差异对比)[https://www.kancloud.cn/raoxiaoyan/kongx/1991178]|
|
||||
| 2 | 2.0.0 | 1.2.x、1.3.x、1.4.x、1.5.x、2.0.x | 目前仅针对kong版本1.2.x、1.3.x测试通过,对1.4.x以上版本与1.3.x对比差异,原则上基础功能全部可用,(参考差异对比)[https://www.kancloud.cn/raoxiaoyan/kongx/1991178]|
|
||||
| 3 | 2.1.0 | 1.2.x、1.3.x、1.4.x、1.5.x、2.0.x | 目前仅针对kong版本1.2.x、1.3.x测试通过,对1.4.x以上版本与1.3.x对比差异,原则上基础功能全部可用,(参考差异对比)[https://www.kancloud.cn/raoxiaoyan/kongx/1991178]|
|
||||
|
||||
## Upgrade
|
||||
[更新历史](docs/upgrade.md)
|
||||
|
@ -2,7 +2,7 @@ FROM openjdk:8-jre-alpine
|
||||
|
||||
|
||||
ENV KONGX_RUN_MODE "Docker"
|
||||
ENV VERSION 2.0.1
|
||||
ENV VERSION 2.2.0
|
||||
ENV SERVER_PORT 8095
|
||||
|
||||
RUN \
|
||||
|
@ -7,3 +7,4 @@ default-character-set=utf8mb4
|
||||
[mysqld]
|
||||
character-set-server=utf8mb4
|
||||
collation-server=utf8mb4_general_ci
|
||||
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
|
||||
|
@ -1,4 +1,4 @@
|
||||
#Docker quick start
|
||||
# Docker quick start
|
||||
## 1. docker环境准备
|
||||
docker及docker-compose的安装,请参考:
|
||||
|
||||
@ -8,7 +8,7 @@ https://www.runoob.com/docker/docker-compose.html
|
||||
## 2. 安装准备
|
||||
将docker-quick-start 上传到linux目录下(如:/opt/kongx)
|
||||
## 3. 下载安装包
|
||||
从gitee下载:点击[发布版本](https://gitee.com/raoxy/kongx/releases)下载kong-serve-2.0.0.zip
|
||||
从gitee下载:点击[发布版本](https://gitee.com/raoxy/kongx/releases)下载kongx-serve-2.0.0.zip(此处仅示例,请根据需要下载对应的版本)
|
||||
下载后,安装目录结构如下显示:
|
||||
```text
|
||||
./
|
||||
|
@ -34,15 +34,28 @@ CREATE TABLE `kongx_operation_log` (
|
||||
`operation_type` varchar(255) DEFAULT NULL,
|
||||
`content` json DEFAULT NULL,
|
||||
`target` varchar(255) DEFAULT NULL,
|
||||
`ip` varchar(64) DEFAULT NULL,
|
||||
`create_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`remark` varchar(2048) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_target_hash` (`target`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=335 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_operation_log
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_service_pipeline`;
|
||||
CREATE TABLE `kongx_service_pipeline` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(1024) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '用户组名称',
|
||||
`create_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`creator` varchar(255) DEFAULT NULL COMMENT '创建人',
|
||||
`modifier` varchar(255) DEFAULT NULL COMMENT '修改人',
|
||||
`modify_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`remark` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '备注',
|
||||
`link_list` json DEFAULT NULL,
|
||||
`node_list` json DEFAULT NULL,
|
||||
`origin` json DEFAULT NULL,
|
||||
`profile` varchar(255) DEFAULT NULL COMMENT '所属环境',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_server_config
|
||||
@ -142,11 +155,11 @@ CREATE TABLE `kongx_system_function` (
|
||||
-- ----------------------------
|
||||
INSERT INTO `kongx_system_function` VALUES ('1', '-1', '', '首页', 'icon-shouye', 'page/wel', '/home', 'y', 'menu', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('4', '5', '', 'Kong Shell', 'icon-shell', 'views/gateway/shell/index', 'shell', 'y', 'menu', 'kongx', '9');
|
||||
INSERT INTO `kongx_system_function` VALUES ('5', '-1', null, 'Gateway', 'icon-gateway', '', '/gateway', 'y', 'menu', 'kongx', '4');
|
||||
INSERT INTO `kongx_system_function` VALUES ('6', '5', '', 'Upstreams', 'icon-gateway', 'views/gateway/upstream/index', 'upstream', 'y', 'menu', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('7', '5', null, 'Services', 'icon-services', 'views/gateway/service/index', 'service', 'y', 'menu', 'kongx', '3');
|
||||
INSERT INTO `kongx_system_function` VALUES ('8', '5', '', 'Routes', 'icon-route', 'views/gateway/routing/index', 'routing', 'y', 'menu', 'kongx', '4');
|
||||
INSERT INTO `kongx_system_function` VALUES ('9', '5', '', 'Plugins', 'icon-plugin', 'views/gateway/plugin/index', 'plugin', 'y', 'menu', 'kongx', '5');
|
||||
INSERT INTO `kongx_system_function` VALUES ('5', '-1', null, '网关管理', 'icon-gateway', '', '/gateway', 'y', 'menu', 'kongx', '4');
|
||||
INSERT INTO `kongx_system_function` VALUES ('6', '5', '', '上游管理', 'icon-gateway', 'views/gateway/upstream/index', 'upstream', 'y', 'menu', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('7', '5', null, '服务管理', 'icon-services', 'views/gateway/service/index', 'service', 'y', 'menu', 'kongx', '3');
|
||||
INSERT INTO `kongx_system_function` VALUES ('8', '5', '', '路由管理', 'icon-route', 'views/gateway/routing/index', 'routing', 'y', 'menu', 'kongx', '4');
|
||||
INSERT INTO `kongx_system_function` VALUES ('9', '5', '', '插件管理', 'icon-plugin', 'views/gateway/plugin/index', 'plugin', 'y', 'menu', 'kongx', '5');
|
||||
INSERT INTO `kongx_system_function` VALUES ('10', '-1', '', '系统管理', 'icon-system', '', '/system', 'y', 'menu', 'kongx', '6');
|
||||
INSERT INTO `kongx_system_function` VALUES ('11', '10', null, '用户管理', 'icon-yonghuguanli', 'views/admin/user/index', 'user', 'y', 'menu', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('12', '10', null, '角色管理', 'icon-quanxianguanli', 'views/admin/role/index', 'role', 'y', 'menu', 'kongx', '2');
|
||||
@ -204,6 +217,16 @@ INSERT INTO `kongx_system_function` VALUES ('64', '60', 'certificate_view', '查
|
||||
INSERT INTO `kongx_system_function` VALUES ('65', '60', 'certificate_add', '新增certificate', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('66', '60', 'certificate_update', '修改certificate', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('67', '60', 'certificate_delete', '删除certificate', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('68', '-1', 'gateway-pipeline', '网关流水线', 'icon-pipeline', '', '', 'y', 'menu', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('69', '68', 'pipeline', '流水线管理', 'icon-pipeline', 'views/gateway/flow/index', 'pipeline', 'y', 'menu', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('70', '69', 'add_pipeline', '新增流水线', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('71', '69', 'update_pipeline', '更新流水线', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('72', '69', 'remove_pipeline', '删除流水线', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('73', '69', 'config_pipeline', '配置流水线', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('74', '69', 'view_pipeline', '查看流水线', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('75', '69', 'view_config_pipeline', '查看流水线配置', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_system_profile
|
||||
|
BIN
docs/pipeline.png
Normal file
BIN
docs/pipeline.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 64 KiB |
@ -1,8 +1,28 @@
|
||||
## 升级向导
|
||||
# 2.1.0 发布(2020/12/01)
|
||||
### 1. 升级要点
|
||||
> 1. 增加网关流水线功能
|
||||
> 2. 修复网关插件表格显示错误问题
|
||||
### 2. 直接升级到2.1.0
|
||||
参考Kongx [Quick Start](https://www.kancloud.cn/raoxiaoyan/kongx/1984323)
|
||||
|
||||
### 3. 2.0.0升级到2.1.0
|
||||
3.1、 下载2.0.0的kongx安装包,具体安装步骤参考 [Quick Start](https://www.kancloud.cn/raoxiaoyan/kongx/1984323)
|
||||
|
||||
3.2、 下载数据库升级脚本,[2.0.1 to 2.1.0.sql](upgrade/2.0.1to2.1.0log.md),在原2.0.1版本数据库基础上执行即可。
|
||||
### 4. 1.2.x 升级到2.1.0
|
||||
4.1 先由1.2.x升级到2.0.0
|
||||
|
||||
4.2 再由2.0.0升级到2.1.0,参照 [3. 2.0.0升级到2.1.0]的升级步骤
|
||||
# 2.0.2 发布(2020/11/26)
|
||||
> 1. 修复issue#I26XHN:Kong 1.3.1 下添加路由失败
|
||||
> 2. 修复插件下拉列表无法回显问题
|
||||
|
||||
直接升级即可
|
||||
# 2.0.1 发布(2020/11/18)
|
||||
### 1. 升级要点
|
||||
>
|
||||
>
|
||||
> 1. 增加kong shell支持
|
||||
> 2. 优化日志功能
|
||||
### 2. 直接升级2.0.1
|
||||
参考Kongx [Quick Start](https://www.kancloud.cn/raoxiaoyan/kongx/1984323)
|
||||
### 3. 2.0.0升级到2.0.1
|
||||
|
@ -20,14 +20,14 @@ where not EXISTS (select * from kongx_system_role_function b where a.function_id
|
||||
|
||||
|
||||
insert into kongx_system_role_function(role_id,half_checked,function_id)
|
||||
select * from (
|
||||
select '2' role_id,'y' half_checked,'-1' as function_id
|
||||
union
|
||||
select '2' role_id,'y' half_checked,id as function_id from kongx_system_function where name in ('Gateway','Upstreams','Services','Routes','Plugins','Kong Shell','Consumers','Certificates','日志管理')
|
||||
union
|
||||
select '2' role_id,'n' half_checked,id as function_id from kongx_system_function where code in ('service_view','upstream_view','route_view','plugin_view','consumer_view','certificate_view')
|
||||
union
|
||||
select '2' role_id,'n' half_checked,id as function_id from kongx_system_function where name='操作日志'
|
||||
) a
|
||||
where not EXISTS (select * from kongx_system_role_function b where a.function_id=b.function_id and b.role_id=a.role_id);
|
||||
select * from (
|
||||
select '2' role_id,'y' half_checked,'-1' as function_id
|
||||
union
|
||||
select '2' role_id,'y' half_checked,id as function_id from kongx_system_function where name in ('Gateway','Upstreams','Services','Routes','Plugins','Kong Shell','Consumers','Certificates','日志管理')
|
||||
union
|
||||
select '2' role_id,'n' half_checked,id as function_id from kongx_system_function where code in ('service_view','upstream_view','route_view','plugin_view','consumer_view','certificate_view')
|
||||
union
|
||||
select '2' role_id,'n' half_checked,id as function_id from kongx_system_function where name='操作日志'
|
||||
) a
|
||||
where not EXISTS (select * from kongx_system_role_function b where a.function_id=b.function_id and b.role_id=a.role_id);
|
||||
```
|
51
docs/upgrade/2.0.1to2.1.0log.md
Normal file
51
docs/upgrade/2.0.1to2.1.0log.md
Normal file
@ -0,0 +1,51 @@
|
||||
# 2.0.1 升级2.1.0 sql脚本
|
||||
```sql
|
||||
ALTER TABLE kongx_operation_log ADD ip VARCHAR (64);
|
||||
CREATE TABLE `kongx_service_pipeline` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(1024) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '用户组名称',
|
||||
`create_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`creator` varchar(255) DEFAULT NULL COMMENT '创建人',
|
||||
`modifier` varchar(255) DEFAULT NULL COMMENT '修改人',
|
||||
`modify_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`remark` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '备注',
|
||||
`link_list` json DEFAULT NULL,
|
||||
`node_list` json DEFAULT NULL,
|
||||
`origin` json DEFAULT NULL,
|
||||
`profile` varchar(255) DEFAULT NULL COMMENT '所属环境',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
|
||||
INSERT INTO `kongx_system_function` ( `parent_id`, `code`, `name`, `menu_icon`, `visit_view`, `visit_path`, `use_yn`, `menu_type`, `application_code`, `sort_order`) VALUES ( '-1', 'gateway-pipeline', '网关流水线', 'icon-pipeline', '', '', 'y', 'menu', 'kongx', '2');
|
||||
|
||||
INSERT INTO `kongx_system_function` (`parent_id`, `code`, `name`, `menu_icon`, `visit_view`, `menu_type`, `application_code`)
|
||||
select (select id from kongx_system_function where code='gateway-pipeline' and parent_id=-1) as parent_id ,'pipeline' as code,'Pipeline' as name,'icon-pipeline' as menu_icon ,'views/gateway/flow/index' as visit_view ,
|
||||
'menu' as menu_type ,'kongx' as application_code;
|
||||
|
||||
INSERT INTO `kongx_system_function` (`parent_id`, `code`, `name`, `menu_type`, `application_code`)
|
||||
select (select id from kongx_system_function where code='pipeline') as parent_id ,'add_pipeline' as code,'新增流水线' as name,'point' as menu_type ,'kongx' as application_code
|
||||
union
|
||||
select (select id from kongx_system_function where code='pipeline') as parent_id ,'update_pipeline' as code,'更新流水线' as name,'point' as menu_type ,'kongx' as application_code
|
||||
union
|
||||
select (select id from kongx_system_function where code='pipeline') as parent_id ,'remove_pipeline' as code,'删除流水线' as name,'point' as menu_type ,'kongx' as application_code
|
||||
union
|
||||
select (select id from kongx_system_function where code='pipeline') as parent_id ,'config_pipeline' as code,'配置流水线' as name,'point' as menu_type ,'kongx' as application_code
|
||||
union
|
||||
select (select id from kongx_system_function where code='pipeline') as parent_id ,'view_pipeline' as code,'查看流水线' as name,'point' as menu_type ,'kongx' as application_code
|
||||
union
|
||||
select (select id from kongx_system_function where code='pipeline') as parent_id ,'view_config_pipeline' as code,'查看流水线配置' as name,'point' as menu_type ,'kongx' as application_code;
|
||||
|
||||
|
||||
insert into kongx_system_role_function(role_id,half_checked,function_id)
|
||||
select * from (
|
||||
select '1' role_id,'n' half_checked,'-1' as function_id
|
||||
union all
|
||||
select '1' role_id,'n' half_checked,id as function_id from kongx_system_function
|
||||
) a
|
||||
where not EXISTS (select * from kongx_system_role_function b where a.function_id=b.function_id and b.role_id=a.role_id);
|
||||
|
||||
insert into kongx_system_role_function(role_id,half_checked,function_id)
|
||||
select * from (
|
||||
select '2' role_id,'n' half_checked,id as function_id from kongx_system_function where code like '%pipeline'
|
||||
) a
|
||||
where not EXISTS (select * from kongx_system_role_function b where a.function_id=b.function_id and b.role_id=a.role_id);
|
||||
```
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>kongx</artifactId>
|
||||
<groupId>com.kongx</groupId>
|
||||
<version>2.0.1</version>
|
||||
<version>3.1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class KongxBanner implements Banner {
|
||||
|
||||
@Override
|
||||
public void printBanner(Environment environment, Class<?> sourceClass, PrintStream printStream) {
|
||||
this.print(" :: Support kong :: ", "(v2.0.0)", printStream);
|
||||
this.print(" :: Support kong :: ", "(v2.1.0)", printStream);
|
||||
printStream.println(BANNER);
|
||||
String copyright = " :: Copyright@2020 :: ";
|
||||
String version = SpringBootVersion.getVersion();
|
||||
|
@ -183,9 +183,7 @@ public class JsonHeaderWrapper<T extends Object> {
|
||||
Success(0, "全部成功"), //
|
||||
Success4M(200, "全部成功"),
|
||||
//无线端统一使用200作为成功代码返回
|
||||
PartialSuccess(202, "库存数不足"), //
|
||||
Timeout(405, "接口超时返回"), //
|
||||
OverFlowCtrl(406, "客户流量超量"), //
|
||||
NOT_FOUND(404, "not found"),
|
||||
Failed(500, "全部失败"), //
|
||||
ParamError(505, "传入参数错误"), //
|
||||
UnknownOther(599, "未知错误,系统错误");
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>kongx</artifactId>
|
||||
<groupId>com.kongx</groupId>
|
||||
<version>2.0.1</version>
|
||||
<version>3.1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>com.kongx</groupId>
|
||||
<artifactId>kongx-common</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -15,7 +15,6 @@ import org.springframework.context.annotation.Import;
|
||||
@Import(KongxConfig.class)
|
||||
@MapperScan("com.kongx.serve.mapper")
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication application = new SpringApplication(Application.class);
|
||||
application.setBanner(new KongxBanner());
|
||||
|
@ -0,0 +1,177 @@
|
||||
package com.kongx.serve.controller.flow;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.kongx.common.core.entity.UserInfo;
|
||||
import com.kongx.common.jsonwrapper.JsonHeaderWrapper;
|
||||
import com.kongx.common.utils.Jackson2Helper;
|
||||
import com.kongx.serve.controller.system.DefaultController;
|
||||
import com.kongx.serve.entity.flow.FlowNode;
|
||||
import com.kongx.serve.entity.flow.NodeMeta;
|
||||
import com.kongx.serve.entity.flow.ServicePipeline;
|
||||
import com.kongx.serve.entity.gateway.KongEntity;
|
||||
import com.kongx.serve.entity.gateway.TargetHealth;
|
||||
import com.kongx.serve.entity.system.OperationLog;
|
||||
import com.kongx.serve.entity.system.SystemProfile;
|
||||
import com.kongx.serve.service.IBaseService;
|
||||
import com.kongx.serve.service.flow.ServicePipelineService;
|
||||
import com.kongx.serve.service.gateway.TargetService;
|
||||
import com.kongx.serve.service.gateway.TruncateEntityService;
|
||||
import com.kongx.serve.service.system.SystemProfileService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController("/ServiceFlowController")
|
||||
@RequestMapping("/kong/api/pipeline")
|
||||
public class ServicePipelineController extends DefaultController<ServicePipeline, Integer> {
|
||||
|
||||
@Autowired
|
||||
private TruncateEntityService truncateEntityService;
|
||||
@Autowired
|
||||
private ServicePipelineService servicePipelineService;
|
||||
|
||||
@Autowired
|
||||
private TargetService targetService;
|
||||
|
||||
@Autowired
|
||||
private SystemProfileService systemProfileService;
|
||||
|
||||
@Override
|
||||
@Resource(name = "servicePipelineService")
|
||||
protected void setBaseService(IBaseService<ServicePipeline, Integer> iBaseService) {
|
||||
this.baseService = iBaseService;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/list/profile", method = RequestMethod.GET)
|
||||
public List<ServicePipeline> findAll(UserInfo userInfo, ServicePipeline project) {
|
||||
return servicePipelineService.findAll(this.systemProfile(userInfo), project);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/truncate/entity", method = RequestMethod.POST)
|
||||
public JsonHeaderWrapper<ServicePipeline> removeEntity(UserInfo userInfo, @RequestBody FlowNode flowNode) {
|
||||
JsonHeaderWrapper jsonHeaderWrapper = this.init();
|
||||
try {
|
||||
if (!flowNode.getMeta().isReady()) {
|
||||
jsonHeaderWrapper.setStatus(JsonHeaderWrapper.StatusEnum.Failed.getCode());
|
||||
jsonHeaderWrapper.setErrmsg("该实体未进行配置,请检查后再试!");
|
||||
return jsonHeaderWrapper;
|
||||
}
|
||||
this.truncateEntityService.remove(this.systemProfile(userInfo), this.wrapUri(flowNode));
|
||||
} catch (Exception e) {
|
||||
String content = e.getMessage();
|
||||
if (content.contains("Not found")) {
|
||||
jsonHeaderWrapper.setStatus(JsonHeaderWrapper.StatusEnum.NOT_FOUND.getCode());
|
||||
} else {
|
||||
jsonHeaderWrapper.setStatus(JsonHeaderWrapper.StatusEnum.Failed.getCode());
|
||||
}
|
||||
jsonHeaderWrapper.setErrmsg(content);
|
||||
}
|
||||
return jsonHeaderWrapper;
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/{id}", method = RequestMethod.GET)
|
||||
@Override
|
||||
public JsonHeaderWrapper findById(UserInfo userInfo, @PathVariable Integer id) {
|
||||
JsonHeaderWrapper jsonHeaderWrapper = init();
|
||||
try {
|
||||
ServicePipeline servicePipeline = this.servicePipelineService.findById(id);
|
||||
SystemProfile systemProfile = this.systemProfileService.findByProfile(servicePipeline.getProfile());
|
||||
List<FlowNode> flowNodeList = Jackson2Helper.jsonToList(Jackson2Helper.toJsonString(servicePipeline.getNodeList()), FlowNode.class);
|
||||
KongEntity<TargetHealth> kongEntity = null;
|
||||
for (FlowNode flowNode : flowNodeList) {
|
||||
if (flowNode.getMeta().isReady()) {
|
||||
this.wrapFlowNode(systemProfile, flowNode, kongEntity);
|
||||
}
|
||||
}
|
||||
servicePipeline.setNodeList(flowNodeList);
|
||||
jsonHeaderWrapper.setData(servicePipeline);
|
||||
} catch (Exception e) {
|
||||
jsonHeaderWrapper.setStatus(JsonHeaderWrapper.StatusEnum.Failed.getCode());
|
||||
jsonHeaderWrapper.setErrmsg(e.getMessage());
|
||||
}
|
||||
return jsonHeaderWrapper;
|
||||
}
|
||||
|
||||
private FlowNode wrapFlowNode(SystemProfile systemProfile, FlowNode flowNode, KongEntity<TargetHealth> kongEntity) {
|
||||
try {
|
||||
if (flowNode.getMeta().getProp().equals("targets")) {
|
||||
if (kongEntity == null) {
|
||||
kongEntity = Jackson2Helper.parsonObject(
|
||||
Jackson2Helper.toJsonString(this.targetService.findAllHealth(systemProfile, flowNode.getMeta().getParent().getId())),
|
||||
new TypeReference<KongEntity<TargetHealth>>() {
|
||||
});
|
||||
}
|
||||
for (TargetHealth datum : kongEntity.getData()) {
|
||||
if (datum.getId().equals(flowNode.getMeta().getId())) {
|
||||
flowNode.getMeta().setEntity(Jackson2Helper.parsonObject(Jackson2Helper.toJsonString(datum), new TypeReference<Map>() {
|
||||
}));
|
||||
return flowNode;
|
||||
}
|
||||
}
|
||||
flowNode.getMeta().setReady(false);
|
||||
|
||||
Map parent = new HashMap();
|
||||
parent.put("id", flowNode.getMeta().getParent().getId());
|
||||
flowNode.getMeta().setEntity(parent);
|
||||
} else {
|
||||
String uri = this.wrapUri(flowNode);
|
||||
flowNode.getMeta().setEntity(this.truncateEntityService.findById(systemProfile, uri));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
flowNode.getMeta().setReady(false);
|
||||
if (flowNode.getMeta().getParent() != null) {
|
||||
Map parent = new HashMap();
|
||||
parent.put("id", flowNode.getMeta().getParent().getId());
|
||||
flowNode.getMeta().setEntity(parent);
|
||||
}
|
||||
|
||||
}
|
||||
return flowNode;
|
||||
}
|
||||
|
||||
private String wrapUri(FlowNode flowNode) {
|
||||
String url = flowNode.getMeta().getProp();
|
||||
String id = flowNode.getMeta().getId();
|
||||
if ("targets".equals(url)) {
|
||||
NodeMeta parent = flowNode.getMeta().getParent();
|
||||
url = "/" + parent.getProp() + "/%s/" + url + "/%s";
|
||||
url = String.format(url, parent.getId(), id);
|
||||
} else {
|
||||
url = "/" + url + "/%s";
|
||||
url = String.format(url, id);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/query/entity", method = RequestMethod.POST)
|
||||
public JsonHeaderWrapper<Map> findEntityById(UserInfo userInfo, @RequestBody FlowNode flowNode) {
|
||||
JsonHeaderWrapper jsonHeaderWrapper = this.init();
|
||||
try {
|
||||
if (!flowNode.getMeta().isReady()) {
|
||||
jsonHeaderWrapper.setStatus(JsonHeaderWrapper.StatusEnum.Failed.getCode());
|
||||
jsonHeaderWrapper.setErrmsg("该实体未进行配置,请检查后再试!");
|
||||
return jsonHeaderWrapper;
|
||||
}
|
||||
jsonHeaderWrapper.setData(this.truncateEntityService.findById(this.systemProfile(userInfo), this.wrapUri(flowNode)));
|
||||
} catch (Exception e) {
|
||||
String content = e.getMessage();
|
||||
if (content.contains("Not found")) {
|
||||
jsonHeaderWrapper.setStatus(JsonHeaderWrapper.StatusEnum.NOT_FOUND.getCode());
|
||||
jsonHeaderWrapper.setErrmsg("该实体可能已被移除,请检查后再试!");
|
||||
} else {
|
||||
jsonHeaderWrapper.setStatus(JsonHeaderWrapper.StatusEnum.Failed.getCode());
|
||||
jsonHeaderWrapper.setErrmsg(content);
|
||||
}
|
||||
}
|
||||
return jsonHeaderWrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected OperationLog.OperationTarget operationTarget() {
|
||||
return OperationLog.OperationTarget.SERVICE_PIPELINE;
|
||||
}
|
||||
}
|
@ -37,7 +37,6 @@ public class PluginController extends BaseController {
|
||||
* @throws URISyntaxException
|
||||
*/
|
||||
@RequestMapping(value = PLUGIN_URI, method = RequestMethod.GET)
|
||||
@KongLog(operation = OperationLog.OperationType.OPERATION_ADD, target = OperationLog.OperationTarget.GLOBAL_PLUGIN, content = "#userInfo")
|
||||
public JsonHeaderWrapper findAll(UserInfo userInfo) {
|
||||
JsonHeaderWrapper jsonHeaderWrapper = this.init();
|
||||
try {
|
||||
|
@ -113,8 +113,8 @@ public class RouteController extends BaseController {
|
||||
public JsonHeaderWrapper add(UserInfo userInfo, @PathVariable String serviceId, @RequestBody Route route) {
|
||||
JsonHeaderWrapper jsonHeaderWrapper = this.init();
|
||||
try {
|
||||
KongEntity<Route> routeKongEntity = this.kongFeignService.add(systemProfile(userInfo), serviceId, route.clear());
|
||||
jsonHeaderWrapper.setData(routeKongEntity.getData());
|
||||
Route results = this.kongFeignService.add(systemProfile(userInfo), serviceId, route.clear());
|
||||
jsonHeaderWrapper.setData(results);
|
||||
} catch (Exception e) {
|
||||
jsonHeaderWrapper.setStatus(JsonHeaderWrapper.StatusEnum.Failed.getCode());
|
||||
jsonHeaderWrapper.setErrmsg(e.getMessage());
|
||||
|
@ -60,9 +60,8 @@ public class TargetController extends BaseController {
|
||||
public JsonHeaderWrapper add(UserInfo userInfo, @PathVariable String id, @RequestBody Target target) {
|
||||
JsonHeaderWrapper jsonHeaderWrapper = init();
|
||||
try {
|
||||
this.targetFeignService.add(systemProfile(userInfo), id, target);
|
||||
jsonHeaderWrapper.setData(this.targetFeignService.add(systemProfile(userInfo), id, target));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
jsonHeaderWrapper.setStatus(JsonHeaderWrapper.StatusEnum.Failed.getCode());
|
||||
jsonHeaderWrapper.setErrmsg(e.getMessage());
|
||||
}
|
||||
@ -77,7 +76,7 @@ public class TargetController extends BaseController {
|
||||
* @throws URISyntaxException
|
||||
*/
|
||||
@RequestMapping(value = TARGET_URI_ID_PATH, method = RequestMethod.DELETE)
|
||||
@KongLog(target = OperationLog.OperationTarget.TARGETS, content = "#id 从属于上游服务 #upstreamId")
|
||||
@KongLog(target = OperationLog.OperationTarget.TARGETS, content = "#id")
|
||||
public JsonHeaderWrapper remove(UserInfo userInfo, @PathVariable String upstreamId, @PathVariable String id) {
|
||||
JsonHeaderWrapper jsonHeaderWrapper = init();
|
||||
try {
|
||||
|
@ -6,6 +6,7 @@ import com.kongx.common.jsonwrapper.JsonHeaderWrapper;
|
||||
import com.kongx.serve.controller.BaseController;
|
||||
import com.kongx.serve.entity.system.OperationLog;
|
||||
import com.kongx.serve.service.IBaseService;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@ -65,6 +66,30 @@ public abstract class DefaultController<T, PK> extends BaseController {
|
||||
return jsonHeaderWrapper;
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/{id}", method = RequestMethod.GET)
|
||||
public JsonHeaderWrapper findById(UserInfo userInfo, @PathVariable Integer id) {
|
||||
JsonHeaderWrapper jsonHeaderWrapper = init();
|
||||
try {
|
||||
jsonHeaderWrapper.setData(this.baseService.findById(id));
|
||||
} catch (Exception e) {
|
||||
jsonHeaderWrapper.setStatus(JsonHeaderWrapper.StatusEnum.Failed.getCode());
|
||||
jsonHeaderWrapper.setErrmsg(e.getMessage());
|
||||
}
|
||||
return jsonHeaderWrapper;
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/{id}", method = RequestMethod.DELETE)
|
||||
public JsonHeaderWrapper removeById(@PathVariable Integer id) {
|
||||
JsonHeaderWrapper jsonHeaderWrapper = init();
|
||||
try {
|
||||
this.baseService.remove(id);
|
||||
} catch (Exception e) {
|
||||
jsonHeaderWrapper.setStatus(JsonHeaderWrapper.StatusEnum.Failed.getCode());
|
||||
jsonHeaderWrapper.setErrmsg(e.getMessage());
|
||||
}
|
||||
return jsonHeaderWrapper;
|
||||
}
|
||||
|
||||
protected abstract void setBaseService(IBaseService<T, PK> iBaseService);
|
||||
|
||||
protected abstract OperationLog.OperationTarget operationTarget();
|
||||
|
@ -0,0 +1,15 @@
|
||||
package com.kongx.serve.entity.flow;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class FlowNode {
|
||||
private List coordinate = new ArrayList<Integer>();
|
||||
private int height;
|
||||
private String id;
|
||||
private NodeMeta meta;
|
||||
private int width;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.kongx.serve.entity.flow;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class NodeMeta {
|
||||
private Map entity;
|
||||
private String id;
|
||||
private NodeMeta parent;
|
||||
private String name;
|
||||
private String prop;
|
||||
private boolean ready;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.kongx.serve.entity.flow;
|
||||
|
||||
import com.kongx.common.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class ServicePipeline extends BaseEntity {
|
||||
private String name;
|
||||
private String img = "/img/plugins/kong.svg";
|
||||
private List linkList = new ArrayList<Map>();
|
||||
private List nodeList = new ArrayList<FlowNode>();
|
||||
private List origin = new ArrayList<Integer>();
|
||||
private String profile;
|
||||
}
|
@ -98,6 +98,7 @@ public class OperationLog {
|
||||
USER_INFO("user_info", "用户信息"),
|
||||
SYSTEM_PROFILE("system_profile", "系统环境"),
|
||||
SERVER_CONFIG("service_config", "系统配置"),
|
||||
SERVICE_PIPELINE("service_pipeline", "网关服务流水线"),
|
||||
LOGGER_LEVEL("logger_level", "日志级别");
|
||||
private String type;
|
||||
private String target;
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.kongx.serve.feign;
|
||||
|
||||
import feign.RequestLine;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Map;
|
||||
|
||||
@FeignClient(name = "truncateEntityFeignService")
|
||||
public interface TruncateEntityFeignService {
|
||||
|
||||
@RequestLine("GET")
|
||||
Map findById(URI uri);
|
||||
|
||||
@RequestLine("DELETE")
|
||||
void remove(URI uri);
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.kongx.serve.mapper;
|
||||
|
||||
import com.kongx.common.handler.JSONHandler;
|
||||
import com.kongx.serve.entity.flow.ServicePipeline;
|
||||
import com.kongx.serve.entity.system.SystemProfile;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ServicePipelineMapper {
|
||||
@Select({"<script>", "SELECT * FROM kongx_service_pipeline where 1=1 and profile=#{profile.profile}",
|
||||
"<when test='job.name!=null'>",
|
||||
" and (name like CONCAT('%',#{job.name},'%'))",
|
||||
"</when>",
|
||||
"order by create_at desc", "</script>"})
|
||||
@Results({
|
||||
@Result(property = "linkList", column = "link_list", typeHandler = JSONHandler.class),
|
||||
@Result(property = "nodeList", column = "node_list", typeHandler = JSONHandler.class),
|
||||
@Result(property = "origin", column = "origin", typeHandler = JSONHandler.class),
|
||||
})
|
||||
List<ServicePipeline> findAll(@Param("profile") SystemProfile systemProfile, @Param("job") ServicePipeline project);
|
||||
|
||||
@Insert({"insert into kongx_service_pipeline(name,link_list,node_list,origin,remark,creator,create_at,profile) values (",
|
||||
"#{name},#{linkList,typeHandler=com.kongx.common.handler.JSONHandler},",
|
||||
"#{nodeList,typeHandler=com.kongx.common.handler.JSONHandler},",
|
||||
"#{origin,typeHandler=com.kongx.common.handler.JSONHandler},",
|
||||
"#{remark},",
|
||||
"#{creator}, #{create_at, jdbcType=TIMESTAMP},#{profile}",
|
||||
")"})
|
||||
int insert(ServicePipeline project);
|
||||
|
||||
@Update({"update kongx_service_pipeline set " +
|
||||
"name=#{name},",
|
||||
"link_list=#{linkList,typeHandler=com.kongx.common.handler.JSONHandler},",
|
||||
"node_list=#{nodeList,typeHandler=com.kongx.common.handler.JSONHandler},",
|
||||
"origin=#{origin,typeHandler=com.kongx.common.handler.JSONHandler},",
|
||||
"modifier=#{modifier},modify_at=#{modify_at, jdbcType=TIMESTAMP},",
|
||||
"remark=#{remark} where id=#{id} "})
|
||||
int update(ServicePipeline project);
|
||||
|
||||
@Select({"select * from kongx_service_pipeline where id = #{id} "})
|
||||
@Results({
|
||||
@Result(property = "linkList", column = "link_list", typeHandler = JSONHandler.class),
|
||||
@Result(property = "nodeList", column = "node_list", typeHandler = JSONHandler.class),
|
||||
@Result(property = "origin", column = "origin", typeHandler = JSONHandler.class),
|
||||
})
|
||||
ServicePipeline findById(int id);
|
||||
|
||||
@Delete("delete from kongx_service_pipeline where id=#{id}")
|
||||
int deleteById(int id);
|
||||
|
||||
}
|
@ -15,7 +15,7 @@ public interface UserInfoMapper {
|
||||
@Results({
|
||||
@Result(property = "userId", column = "user_id"),
|
||||
})
|
||||
List<UserInfo> findAllUser();
|
||||
List<UserInfoVO> findAllUser();
|
||||
|
||||
@Select({"<script>", "select t.user_id,t.name,t.mobile,t.status,t.email,t.creator,t.create_at,t.user_id uid from kongx_user_info t where 1=1 ",
|
||||
"<when test='job.name!=null'>",
|
||||
@ -65,7 +65,8 @@ public interface UserInfoMapper {
|
||||
|
||||
@Select({"<script>", "SELECT DISTINCT",
|
||||
"b.id,b.parent_id parentId,",
|
||||
" b.NAME label,",
|
||||
"b.NAME label,",
|
||||
"b.sort_order,",
|
||||
"b.menu_icon icon,",
|
||||
"b.visit_view component,",
|
||||
"b.code code,",
|
||||
|
@ -17,6 +17,9 @@ public interface IBaseService<T, PK> {
|
||||
|
||||
void add(T entity, UserInfo userInfo);
|
||||
|
||||
default void remove(int pk) {
|
||||
}
|
||||
|
||||
void update(T entity, UserInfo userInfo);
|
||||
|
||||
T findById(PK id);
|
||||
|
@ -0,0 +1,59 @@
|
||||
package com.kongx.serve.service.flow;
|
||||
|
||||
import com.kongx.common.core.entity.UserInfo;
|
||||
import com.kongx.serve.entity.flow.ServicePipeline;
|
||||
import com.kongx.serve.entity.system.SystemProfile;
|
||||
import com.kongx.serve.mapper.ServicePipelineMapper;
|
||||
import com.kongx.serve.service.IBaseService;
|
||||
import com.kongx.serve.service.system.SystemProfileService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service("servicePipelineService")
|
||||
public class ServicePipelineService implements IBaseService<ServicePipeline, Integer> {
|
||||
|
||||
@Autowired
|
||||
private ServicePipelineMapper servicePipelineMapper;
|
||||
@Autowired
|
||||
private SystemProfileService systemProfileService;
|
||||
|
||||
public List<ServicePipeline> findAll(SystemProfile systemProfile, ServicePipeline entity) {
|
||||
return this.servicePipelineMapper.findAll(systemProfile, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(ServicePipeline entity, UserInfo userInfo) {
|
||||
entity.setCreator(userInfo.getName());
|
||||
entity.setCreate_at(new Date());
|
||||
entity.setProfile(systemProfileService.getClientByName(userInfo.getUserId()).getProfile());
|
||||
this.servicePipelineMapper.insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(ServicePipeline entity, UserInfo userInfo) {
|
||||
entity.setModifier(userInfo.getName());
|
||||
entity.setModify_at(new Date());
|
||||
this.servicePipelineMapper.update(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(int pk) {
|
||||
ServicePipeline servicePipeline = this.servicePipelineMapper.findById(pk);
|
||||
if (servicePipeline.getNodeList().isEmpty()) {
|
||||
|
||||
this.servicePipelineMapper.deleteById(pk);
|
||||
} else {
|
||||
throw new RuntimeException("请删除相关配置后再执行本操作");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServicePipeline findById(Integer id) {
|
||||
ServicePipeline servicePipeline = this.servicePipelineMapper.findById(id);
|
||||
return servicePipeline;
|
||||
}
|
||||
}
|
@ -74,9 +74,10 @@ public class RouteService extends AbstractCacheService<KongEntity<Route>> {
|
||||
* @return
|
||||
* @throws URISyntaxException
|
||||
*/
|
||||
public KongEntity<Route> add(SystemProfile systemProfile, String serviceId, Route route) throws URISyntaxException {
|
||||
this.kongFeignService.add(uri(systemProfile, String.format(ROUTE_SERVICE_URI, serviceId)), route);
|
||||
return this.refresh(systemProfile, CACHE_ROUTES_KEY).getData();
|
||||
public Route add(SystemProfile systemProfile, String serviceId, Route route) throws URISyntaxException {
|
||||
Route results = this.kongFeignService.add(uri(systemProfile, String.format(ROUTE_SERVICE_URI, serviceId)), route);
|
||||
this.refresh(systemProfile, CACHE_ROUTES_KEY);
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -63,9 +63,8 @@ public class TargetService extends AbstractCacheService {
|
||||
* @return
|
||||
* @throws URISyntaxException
|
||||
*/
|
||||
public KongEntity<Target> add(SystemProfile systemProfile, String id, Target target) throws URISyntaxException {
|
||||
this.targetFeignService.add(uri(systemProfile, String.format(TARGET_URI, id)), target);
|
||||
return findAll(systemProfile, id);
|
||||
public Target add(SystemProfile systemProfile, String id, Target target) throws URISyntaxException {
|
||||
return this.targetFeignService.add(uri(systemProfile, String.format(TARGET_URI, id)), target);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,37 @@
|
||||
package com.kongx.serve.service.gateway;
|
||||
|
||||
import com.kongx.serve.entity.system.SystemProfile;
|
||||
import com.kongx.serve.feign.TruncateEntityFeignService;
|
||||
import com.kongx.serve.service.AbstractCacheService;
|
||||
import feign.Feign;
|
||||
import feign.Target;
|
||||
import feign.codec.Decoder;
|
||||
import feign.codec.Encoder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cloud.openfeign.FeignClientsConfiguration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Component("truncateEntityService")
|
||||
@Import(FeignClientsConfiguration.class)
|
||||
public class TruncateEntityService extends AbstractCacheService {
|
||||
private TruncateEntityFeignService truncateEntityFeignService;
|
||||
|
||||
@Autowired
|
||||
public TruncateEntityService(Decoder decoder, Encoder encoder) {
|
||||
truncateEntityFeignService = Feign.builder().encoder(encoder).decoder(decoder).target(Target.EmptyTarget.create(TruncateEntityFeignService.class));
|
||||
}
|
||||
|
||||
public void remove(SystemProfile systemProfile, String uri) throws URISyntaxException {
|
||||
this.truncateEntityFeignService.remove(uri(systemProfile, uri));
|
||||
}
|
||||
|
||||
public Map findById(SystemProfile systemProfile, String uri) throws URISyntaxException {
|
||||
return this.truncateEntityFeignService.findById(uri(systemProfile, uri));
|
||||
}
|
||||
}
|
@ -25,8 +25,9 @@ public class UserInfoService implements IBaseService<UserInfoVO, String> {
|
||||
@Autowired
|
||||
private UserInfoMapper userInfoMapper;
|
||||
|
||||
public List<UserInfo> findAll() {
|
||||
List<UserInfo> allUser = userInfoMapper.findAllUser();
|
||||
@Override
|
||||
public List<UserInfoVO> findAll(UserInfoVO userInfo) {
|
||||
List<UserInfoVO> allUser = userInfoMapper.findAllUser();
|
||||
return allUser;
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><html><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=black><meta name=format-detection content="telephone=no"><meta http-equiv=X-UA-Compatible content="chrome=1"><link rel=stylesheet href=cdn/element-ui/2.13.0/theme-chalk/index.css><link rel=stylesheet href=cdn/animate/3.5.2/animate.css><link rel=stylesheet href=cdn/iconfont/1.0.0/index.css><link rel=stylesheet href="https://fonts.googleapis.com/icon?family=Material+Icons"><link rel=icon href=favicon.ico><title>kongx</title><style>html,
|
||||
<!DOCTYPE html><html><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=black><meta name=format-detection content="telephone=no"><meta http-equiv=X-UA-Compatible content="chrome=1"><link rel=stylesheet href=cdn/element-ui/2.13.0/theme-chalk/index.css><link rel=stylesheet href=cdn/animate/3.5.2/animate.css><link rel=stylesheet href=cdn/iconfont/1.0.0/index.css><link rel=stylesheet href="https://fonts.googleapis.com/icon?family=Material+Icons"><link rel=icon href=favicon.ico><script src=https://cdn.staticfile.org/jsPlumb/2.11.1/js/jsplumb.min.js></script><title>kongx</title><style>html,
|
||||
body,
|
||||
#app {
|
||||
height: 100%;
|
||||
@ -51,4 +51,4 @@
|
||||
.avue-home__sub-title {
|
||||
color: #ABABAB;
|
||||
font-size: 12px;
|
||||
}</style><link href=css/chunk-05d1190a.889d7b72.css rel=prefetch><link href=css/chunk-e71f815c.ab7edb4f.css rel=prefetch><link href=css/page.5cf41a71.css rel=prefetch><link href=js/chunk-05d1190a.b42234c2.js rel=prefetch><link href=js/chunk-2d0e4caf.fea686c4.js rel=prefetch><link href=js/chunk-e71f815c.1647f971.js rel=prefetch><link href=js/page.114cf767.js rel=prefetch><link href=js/views.4d62ea9b.js rel=prefetch><link href=css/app.6db76f0a.css rel=preload as=style><link href=css/chunk-vendors.e426cd01.css rel=preload as=style><link href=js/app.b22022b5.js rel=preload as=script><link href=js/chunk-vendors.48ed5c43.js rel=preload as=script><link href=css/chunk-vendors.e426cd01.css rel=stylesheet><link href=css/app.6db76f0a.css rel=stylesheet></head><body><noscript><strong>很抱歉,如果没有 JavaScript 支持,Avue-cli 将不能正常工作。请启用浏览器的 JavaScript 然后继续。</strong></noscript><div id=app><div class=avue-home><div class=avue-home__main><img class=avue-home__loading src=./svg/loading-spin.svg alt=loading><div class=avue-home__title>正在加载资源</div><div class=avue-home__sub-title>初次加载资源可能需要较多时间 请耐心等待</div></div><div class=avue-home__footer><a href=https://gitee.com/raoxy/kongx target=_blank>https://gitee.com/raoxy/kongx</a></div></div></div><script src=util/aes.js charset=utf-8></script><script src=cdn/vue/2.6.10/vue.min.js charset=utf-8></script><script src=cdn/vuex/3.0.1/vuex.min.js charset=utf-8></script><script src=cdn/vue-router/3.0.1/vue-router.min.js charset=utf-8></script><script src=cdn/axios/1.0.0/axios.min.js charset=utf-8></script><script src=cdn/element-ui/2.13.0/index.js charset=utf-8></script><script src=cdn/xlsx/0.14.1/xlsx.full.min.js charset=utf-8></script><script src=cdn/fileSaver/1.3.8/FileSaver.min.js charset=utf-8></script><script src=cdn/lodash/4.13.1/lodash.min.js charset=utf-8></script><script src=js/chunk-vendors.48ed5c43.js></script><script src=js/app.b22022b5.js></script></body></html>
|
||||
}</style><link href=css/chunk-05d1190a.b408897f.css rel=prefetch><link href=css/chunk-9f41b982.9f0e9512.css rel=prefetch><link href=css/page.87c16261.css rel=prefetch><link href=js/chunk-05d1190a.191e8a4f.js rel=prefetch><link href=js/chunk-2d0e4caf.9583d2b4.js rel=prefetch><link href=js/chunk-9f41b982.e37a47c2.js rel=prefetch><link href=js/page.b44fcb74.js rel=prefetch><link href=js/views.2d373629.js rel=prefetch><link href=css/app.69c5c49e.css rel=preload as=style><link href=css/chunk-vendors.501c96bc.css rel=preload as=style><link href=js/app.cd42d598.js rel=preload as=script><link href=js/chunk-vendors.cf824341.js rel=preload as=script><link href=css/chunk-vendors.501c96bc.css rel=stylesheet><link href=css/app.69c5c49e.css rel=stylesheet></head><body><noscript><strong>很抱歉,如果没有 JavaScript 支持,Avue-cli 将不能正常工作。请启用浏览器的 JavaScript 然后继续。</strong></noscript><div id=app><div class=avue-home><div class=avue-home__main><img class=avue-home__loading src=./svg/loading-spin.svg alt=loading><div class=avue-home__title>正在加载资源</div><div class=avue-home__sub-title>初次加载资源可能需要较多时间 请耐心等待</div></div><div class=avue-home__footer><a href=https://gitee.com/raoxy/kongx target=_blank>https://gitee.com/raoxy/kongx</a></div></div></div><script src=util/aes.js charset=utf-8></script><script src=cdn/vue/2.6.10/vue.min.js charset=utf-8></script><script src=cdn/vuex/3.0.1/vuex.min.js charset=utf-8></script><script src=cdn/vue-router/3.0.1/vue-router.min.js charset=utf-8></script><script src=cdn/axios/1.0.0/axios.min.js charset=utf-8></script><script src=cdn/element-ui/2.13.0/index.js charset=utf-8></script><script src=cdn/xlsx/0.14.1/xlsx.full.min.js charset=utf-8></script><script src=cdn/fileSaver/1.3.8/FileSaver.min.js charset=utf-8></script><script src=cdn/lodash/4.13.1/lodash.min.js charset=utf-8></script><script src=js/chunk-vendors.cf824341.js></script><script src=js/app.cd42d598.js></script></body></html>
|
File diff suppressed because one or more lines are too long
1
kongx-serve/src/main/resources/static/js/app.cd42d598.js
Normal file
1
kongx-serve/src/main/resources/static/js/app.cd42d598.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
pom.xml
2
pom.xml
@ -13,7 +13,7 @@
|
||||
<groupId>com.kongx</groupId>
|
||||
<artifactId>kongx</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>2.0.1</version>
|
||||
<version>3.1.0</version>
|
||||
<modules>
|
||||
<module>kongx-serve</module>
|
||||
<module>kongx-common</module>
|
||||
|
3136
replay_pid17152.log
Normal file
3136
replay_pid17152.log
Normal file
File diff suppressed because one or more lines are too long
@ -1,9 +1,9 @@
|
||||
@echo off
|
||||
|
||||
rem kongx serve db info
|
||||
set kongx_serve_db_url="jdbc:mysql://kongx_db:3306/kongx_serve?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true"
|
||||
set kongx_serve_db_url="jdbc:mysql://localhost:3306/kongx_serve?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true"
|
||||
set kongx_serve_db_username="root"
|
||||
set kongx_serve_db_password=""
|
||||
set kongx_serve_db_password="123456"
|
||||
|
||||
rem =============== Please do not modify the following content ===============
|
||||
rem go to script directory
|
||||
|
369
scripts/db/mysql/kongx-2.0.1.sql
Normal file
369
scripts/db/mysql/kongx-2.0.1.sql
Normal file
@ -0,0 +1,369 @@
|
||||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : 192.168.66.1
|
||||
Source Server Version : 50725
|
||||
Source Host : 192.168.66.1:3306
|
||||
Source Database : kongx_serve
|
||||
|
||||
Target Server Type : MYSQL
|
||||
Target Server Version : 50725
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 2020-11-02 14:12:14
|
||||
*/
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
CREATE DATABASE IF NOT EXISTS kongx_serve DEFAULT CHARACTER SET = utf8mb4;
|
||||
|
||||
Use kongx_serve;
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_operation_log
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_operation_log`;
|
||||
CREATE TABLE `kongx_operation_log` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`userId` varchar(64) DEFAULT NULL,
|
||||
`profile` varchar(32) DEFAULT NULL,
|
||||
`creator` varchar(255) DEFAULT NULL,
|
||||
`operation_type` varchar(255) DEFAULT NULL,
|
||||
`content` json DEFAULT NULL,
|
||||
`target` varchar(255) DEFAULT NULL,
|
||||
`ip` varchar(64) DEFAULT NULL,
|
||||
`create_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`remark` varchar(2048) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_target_hash` (`target`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=335 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_operation_log
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_server_config
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_server_config`;
|
||||
CREATE TABLE `kongx_server_config` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`config_key` varchar(255) DEFAULT NULL,
|
||||
`config_value` text,
|
||||
`config_type` varchar(255) DEFAULT NULL COMMENT '参数类型',
|
||||
`comment` varchar(2048) DEFAULT NULL,
|
||||
`create_at` timestamp NULL DEFAULT NULL,
|
||||
`creator` varchar(255) DEFAULT NULL,
|
||||
`modifier` varchar(255) DEFAULT NULL,
|
||||
`modify_at` varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `unique_config_key` (`config_key`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_server_config
|
||||
-- ----------------------------
|
||||
INSERT INTO `kongx_server_config` VALUES ('1', 'super_admin', 'admin,zhangshan', 'system', '超级管理员', '2019-12-12 16:34:07', 'admin', null, '2019-12-12 16:33:58.156');
|
||||
INSERT INTO `kongx_server_config` VALUES ('6', 'envs', '[\n {\n \"name\": \"开发环境\",\n \"code\": \"dev\",\n \"deployType\": \"beta\",\n \"profiles\": [\n {\n \"profile\":\"f\",\n \"code\":\"betaf\"\n }\n ]\n },\n {\n \"name\": \"测试环境\",\n \"code\": \"beta\",\n \"deployType\": \"beta\",\n \"profiles\": [\n {\n \"profile\":\"a\",\n \"code\":\"betaa\"\n }]\n }]\n', 'system', '环境列表,默认支持', '2019-12-16 17:06:27', null, null, '2019-12-16 16:37:53.122');
|
||||
INSERT INTO `kongx_server_config` VALUES ('7', 'envs_extension', '[]', 'extension', '环境列表的扩展配置', '2019-12-16 16:09:21', null, null, '2019-12-16 16:08:59.814');
|
||||
INSERT INTO `kongx_server_config` VALUES ('13', 'default_domains', '[\"examples.com\",\"a.examples.com\"]', null, '默认的网关域名列表', '2020-01-19 11:43:34', null, null, '2020-01-19 11:43:45.75');
|
||||
INSERT INTO `kongx_server_config` VALUES ('20', 'config_type', '[{\"label\":\"内置参数\",\"value\":\"system\"},{\"label\":\"扩展参数\",\"value\":\"extension\"}]', 'system', '系统内置参数', '2020-04-09 16:36:52', null, null, '2020-04-09 19:19:56.202');
|
||||
INSERT INTO `kongx_server_config` VALUES ('21', 'config_type_extension', '[]', 'extension', '扩展参数类型', '2020-04-09 19:31:05', null, null, '2020-04-09 19:31:05.433');
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_sync_config
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_sync_config`;
|
||||
CREATE TABLE `kongx_sync_config` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`sync_no` varchar(255) DEFAULT NULL,
|
||||
`services` json DEFAULT NULL,
|
||||
`dest_clients` json DEFAULT NULL,
|
||||
`comment` varchar(4000) DEFAULT NULL,
|
||||
`status` varchar(255) DEFAULT NULL,
|
||||
`creator` varchar(255) DEFAULT NULL,
|
||||
`create_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`data_type` varchar(255) DEFAULT NULL,
|
||||
`policy` varchar(255) DEFAULT NULL,
|
||||
`src_client` json DEFAULT NULL,
|
||||
`log_type` int(11) DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_sync_config
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_sync_log
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_sync_log`;
|
||||
CREATE TABLE `kongx_sync_log` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`sync_no` varchar(255) DEFAULT NULL,
|
||||
`service` varchar(255) DEFAULT NULL,
|
||||
`src_client` varchar(255) DEFAULT NULL,
|
||||
`dest_client` varchar(255) DEFAULT NULL,
|
||||
`creator` varchar(255) DEFAULT NULL,
|
||||
`create_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`status` varchar(255) DEFAULT NULL,
|
||||
`content` json DEFAULT NULL,
|
||||
`comment` varchar(2048) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_sync_log
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_system_function
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_system_function`;
|
||||
CREATE TABLE `kongx_system_function` (
|
||||
`id` int(64) NOT NULL AUTO_INCREMENT,
|
||||
`parent_id` bigint(20) DEFAULT NULL COMMENT '父ID',
|
||||
`code` varchar(64) DEFAULT NULL COMMENT '编码',
|
||||
`name` varchar(64) NOT NULL COMMENT '菜单名称',
|
||||
`menu_icon` varchar(512) DEFAULT NULL COMMENT '图标icon',
|
||||
`visit_view` varchar(2048) DEFAULT NULL COMMENT '访问视图',
|
||||
`visit_path` varchar(1024) DEFAULT NULL COMMENT '访问路径',
|
||||
`use_yn` varchar(6) NOT NULL DEFAULT 'y' COMMENT '是否可用n-不可用,y-可用',
|
||||
`menu_type` varchar(20) NOT NULL DEFAULT 'menu' COMMENT '菜单类型(menu=菜单,point=功能点)',
|
||||
`application_code` varchar(64) NOT NULL DEFAULT 'kongx' COMMENT '所属系统code',
|
||||
`sort_order` int(11) DEFAULT '0' COMMENT '排序,小的在前面',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `nh_parentid` (`parent_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8mb4 COMMENT='系统菜单表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_system_function
|
||||
-- ----------------------------
|
||||
INSERT INTO `kongx_system_function` VALUES ('1', '-1', '', '首页', 'icon-shouye', 'page/wel', '/home', 'y', 'menu', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('4', '5', '', 'Kong Shell', 'icon-shell', 'views/gateway/shell/index', 'shell', 'y', 'menu', 'kongx', '9');
|
||||
INSERT INTO `kongx_system_function` VALUES ('5', '-1', null, 'Gateway', 'icon-gateway', '', '/gateway', 'y', 'menu', 'kongx', '4');
|
||||
INSERT INTO `kongx_system_function` VALUES ('6', '5', '', 'Upstreams', 'icon-gateway', 'views/gateway/upstream/index', 'upstream', 'y', 'menu', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('7', '5', null, 'Services', 'icon-services', 'views/gateway/service/index', 'service', 'y', 'menu', 'kongx', '3');
|
||||
INSERT INTO `kongx_system_function` VALUES ('8', '5', '', 'Routes', 'icon-route', 'views/gateway/routing/index', 'routing', 'y', 'menu', 'kongx', '4');
|
||||
INSERT INTO `kongx_system_function` VALUES ('9', '5', '', 'Plugins', 'icon-plugin', 'views/gateway/plugin/index', 'plugin', 'y', 'menu', 'kongx', '5');
|
||||
INSERT INTO `kongx_system_function` VALUES ('10', '-1', '', '系统管理', 'icon-system', '', '/system', 'y', 'menu', 'kongx', '6');
|
||||
INSERT INTO `kongx_system_function` VALUES ('11', '10', null, '用户管理', 'icon-yonghuguanli', 'views/admin/user/index', 'user', 'y', 'menu', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('12', '10', null, '角色管理', 'icon-quanxianguanli', 'views/admin/role/index', 'role', 'y', 'menu', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('13', '10', null, '菜单管理', 'icon-caidanguanli', 'views/admin/menu/index', 'menu', 'y', 'menu', 'kongx', '4');
|
||||
INSERT INTO `kongx_system_function` VALUES ('14', '-1', null, '参数管理', 'icon-canshuguanli', '', '/operating', 'y', 'menu', 'kongx', '7');
|
||||
INSERT INTO `kongx_system_function` VALUES ('15', '14', null, '环境管理', 'icon-huanjingguanli', 'views/operating/env/index', 'envs', 'y', 'menu', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('16', '14', null, '系统参数', 'icon-xitongcanshu', 'views/operating/params/index', 'params', 'y', 'menu', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('17', '-1', null, '日志管理', 'icon-rizhiguanli1', '', '/audit', 'y', 'menu', 'kongx', '8');
|
||||
INSERT INTO `kongx_system_function` VALUES ('18', '17', '', '同步日志', 'icon-sync', 'views/operating/synclog/index', 'synclog', 'y', 'menu', 'kongx', '3');
|
||||
INSERT INTO `kongx_system_function` VALUES ('19', '17', null, '操作日志', 'icon-log', 'views/operating/log/index', 'operationlog', 'y', 'menu', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('20', '6', 'upstream_add', '新增上游代理', '', '', '', 'y', 'point', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('21', '6', 'upstream_update', '修改上游代理', '', '', '', 'y', 'point', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('22', '6', 'upstream_delete', '删除上游代理', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('23', '7', 'service_add', '新增服务', '', '', '', 'y', 'point', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('24', '7', 'service_update', '修改服务', '', '', '', 'y', 'point', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('25', '7', 'service_delete', '删除服务', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('26', '7', 'service_sync', '同步服务', '', '', '', 'y', 'point', 'kongx', '4');
|
||||
INSERT INTO `kongx_system_function` VALUES ('27', '8', 'route_update', '更新路由', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('28', '8', 'route_delete', '删除路由', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('29', '9', 'plugin_update', '更新插件', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('30', '9', 'plugin_delete', '删除插件', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('31', '9', 'plugin_add', '新增插件', '', '', '', 'y', 'point', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('32', '11', 'user_authority', '用户授权', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('33', '13', 'menu_add', '新建菜单', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('34', '13', 'menu_delete', '删除菜单', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('35', '13', 'menu_update', '修改菜单', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('36', '12', 'role_add', '新建角色', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('37', '12', 'role_update', '修改角色', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('38', '12', 'role_config', '配置权限', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('39', '7', 'service_view', '查看服务', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('40', '6', 'upstream_view', '查看上游代理', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('41', '8', 'route_view', '查看路由', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('42', '9', 'plugin_view', '查看插件', '', '', '', 'y', 'point', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('43', '11', 'user_view', '查看用户列表', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('44', '13', 'menu_view', '查看菜单', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('45', '12', 'role_view', '查看角色', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('46', '16', 'params_view', '查看系统参数', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('47', '10', null, '用户组管理', 'icon-yonghuzuguanli', 'views/admin/usergroup/index', 'group', 'y', 'menu', 'kongx', '3');
|
||||
INSERT INTO `kongx_system_function` VALUES ('48', '47', 'usergroup_add', '新增用户组', '', '', '', 'y', 'point', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('49', '47', 'usergroup_update', '修改用户组', '', '', '', 'y', 'point', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('50', '47', 'usergroup_delete', '删除用户组', '', '', '', 'y', 'point', 'kongx', '3');
|
||||
INSERT INTO `kongx_system_function` VALUES ('51', '47', 'usergroup_view', '查看用户组', '', '', '', 'y', 'point', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('52', '47', 'usergroup_config', '用户组配置', '', '', '', 'y', 'point', 'kongx', '4');
|
||||
INSERT INTO `kongx_system_function` VALUES ('53', '5', '', 'Consumers', 'icon-consumer', 'views/gateway/consumer/index', '', 'y', 'menu', 'kongx', '6');
|
||||
INSERT INTO `kongx_system_function` VALUES ('54', '53', 'consumer_view', '查看consumer', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('55', '16', 'params_add', '新增参数', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('56', '16', 'params_update', '修改参数', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('58', '15', 'manage_env', '环境维护', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('59', '5', '', 'Snis', 'icon-sni', 'views/gateway/sni/index', 'snis', 'y', 'menu', 'kongx', '7');
|
||||
INSERT INTO `kongx_system_function` VALUES ('60', '5', '', 'Certificates', 'icon-certificate', 'views/gateway/certificate/index', 'certificate', 'y', 'menu', 'kongx', '8');
|
||||
INSERT INTO `kongx_system_function` VALUES ('61', '53', 'consumer_add', '新增consumer', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('62', '53', 'consumer_update', '更新consumer', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('63', '53', 'consumer_delete', '删除consumer', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('64', '60', 'certificate_view', '查看certificate', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('65', '60', 'certificate_add', '新增certificate', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('66', '60', 'certificate_update', '修改certificate', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('67', '60', 'certificate_delete', '删除certificate', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_system_profile
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_system_profile`;
|
||||
CREATE TABLE `kongx_system_profile` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`profile_code` varchar(255) DEFAULT NULL COMMENT '环境编码',
|
||||
`name` varchar(255) DEFAULT NULL,
|
||||
`env` varchar(255) DEFAULT NULL COMMENT '所属环境',
|
||||
`deploy_type` varchar(255) DEFAULT NULL COMMENT '部署类型',
|
||||
`ab` varchar(255) DEFAULT NULL COMMENT '简称',
|
||||
`version` varchar(255) DEFAULT '' COMMENT 'kong版本号',
|
||||
`url` varchar(255) DEFAULT NULL,
|
||||
`extensions` varchar(4000) DEFAULT NULL,
|
||||
`create_at` timestamp NULL DEFAULT NULL,
|
||||
`profile` varchar(255) DEFAULT NULL,
|
||||
`creator` varchar(255) DEFAULT NULL,
|
||||
`remark` varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uh_profile_code` (`profile_code`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_system_role
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_system_role`;
|
||||
CREATE TABLE `kongx_system_role` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(64) DEFAULT NULL COMMENT '角色编码',
|
||||
`name` varchar(64) DEFAULT NULL COMMENT '角色名称',
|
||||
`role_type` varchar(32) DEFAULT NULL COMMENT '角色类型: roleType 菜单角色,数据权限角色',
|
||||
`sort_order` bigint(20) DEFAULT NULL COMMENT '排序',
|
||||
`use_yn` varchar(6) DEFAULT NULL COMMENT '是否可用n-不可用,y-可用',
|
||||
`remark` varchar(1024) DEFAULT NULL COMMENT '备注',
|
||||
`create_at` timestamp NULL DEFAULT NULL,
|
||||
`creator` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
|
||||
`modifier` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '修改人',
|
||||
`modify_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='系统角色表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_system_role
|
||||
-- ----------------------------
|
||||
INSERT INTO `kongx_system_role` VALUES ('1', 'super_admin', '超级管理员', 'menu', null, 'y', null, '2020-05-11 16:00:00', 'admin', 'admin', '2020-09-28 15:05:49');
|
||||
INSERT INTO `kongx_system_role` VALUES ('2', 'domestic_consumer', '普通用户', 'menu', null, 'y', null, '2020-05-09 16:42:53', 'admin', 'admin', '2020-09-28 15:05:51');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_system_role_function
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_system_role_function`;
|
||||
CREATE TABLE `kongx_system_role_function` (
|
||||
`id` int(64) NOT NULL AUTO_INCREMENT,
|
||||
`role_id` bigint(20) DEFAULT NULL COMMENT '角色Id',
|
||||
`half_checked` varchar(11) DEFAULT 'y' COMMENT '是否半选中',
|
||||
`function_id` bigint(20) DEFAULT NULL COMMENT '菜单id',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=854 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='系统角色与菜单关系表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_system_user_role
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_system_user_role`;
|
||||
CREATE TABLE `kongx_system_user_role` (
|
||||
`id` int(64) NOT NULL AUTO_INCREMENT,
|
||||
`user_id` varchar(64) DEFAULT NULL COMMENT '用户Id',
|
||||
`role_id` bigint(20) DEFAULT NULL COMMENT '角色id',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户与角色关系表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_system_user_role
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_user_group
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_user_group`;
|
||||
CREATE TABLE `kongx_user_group` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(1024) DEFAULT NULL COMMENT '用户组名称',
|
||||
`use_yn` varchar(255) DEFAULT NULL COMMENT '是否可用',
|
||||
`create_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`creator` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '创建人',
|
||||
`modifier` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '修改人',
|
||||
`modify_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='用户组';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_user_group
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_user_group_role
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_user_group_role`;
|
||||
CREATE TABLE `kongx_user_group_role` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`group_id` int(11) NOT NULL COMMENT '用户组ID',
|
||||
`role_id` int(11) NOT NULL COMMENT '角色ID',
|
||||
`profile` varchar(255) NOT NULL COMMENT '所属环境',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户组与角色关系表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_user_group_role
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_user_group_user
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_user_group_user`;
|
||||
CREATE TABLE `kongx_user_group_user` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`group_id` int(11) NOT NULL COMMENT '用户组ID',
|
||||
`user_id` varchar(255) NOT NULL COMMENT '用户ID',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户组与用户的关系表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_user_group_user
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_user_info
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_user_info`;
|
||||
CREATE TABLE `kongx_user_info` (
|
||||
`user_id` varchar(50) NOT NULL COMMENT '用户Id',
|
||||
`name` varchar(50) NOT NULL COMMENT '用户名',
|
||||
`email` varchar(50) DEFAULT '' COMMENT '邮箱',
|
||||
`mobile` varchar(50) DEFAULT NULL COMMENT '手机号',
|
||||
`password` varchar(255) NOT NULL,
|
||||
`status` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '状态',
|
||||
`creator` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '创建人',
|
||||
`create_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
|
||||
PRIMARY KEY (`user_id`),
|
||||
KEY `mobile` (`mobile`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_user_info
|
||||
-- ----------------------------
|
||||
INSERT INTO `kongx_user_info` VALUES ('admin', 'admin', '', '', '60029c3f5fdb5f1291362f52f7251702507ebc5b', 'activate', 'admin', '2020-09-10 18:21:38');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_system_role_function super_admin的权限信息
|
||||
-- ----------------------------
|
||||
insert into kongx_system_role_function(role_id,half_checked,function_id)
|
||||
select '1' role_id,'n' half_checked,'-1' as function_id
|
||||
union all
|
||||
select '1' role_id,'n' half_checked,id as function_id from kongx_system_function;
|
||||
-- ----------------------------
|
||||
-- Records of kongx_system_role_function 初始化domestic_consumer权限信息
|
||||
-- ----------------------------
|
||||
insert into kongx_system_role_function(role_id,half_checked,function_id)
|
||||
select '2' role_id,'y' half_checked,'-1' as function_id
|
||||
union
|
||||
select '2' role_id,'y' half_checked,id as function_id from kongx_system_function where name in ('Gateway','Upstreams','Services','Routes','Plugins','Kong Shell','Consumers','Certificates','日志管理')
|
||||
union
|
||||
select '2' role_id,'n' half_checked,id as function_id from kongx_system_function where code in ('service_view','upstream_view','route_view','plugin_view','consumer_view','certificate_view')
|
||||
union
|
||||
select '2' role_id,'n' half_checked,id as function_id from kongx_system_function where name='操作日志'
|
395
scripts/db/mysql/kongx-2.1.0.sql
Normal file
395
scripts/db/mysql/kongx-2.1.0.sql
Normal file
@ -0,0 +1,395 @@
|
||||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : 192.168.66.1
|
||||
Source Server Version : 50725
|
||||
Source Host : 192.168.66.1:3306
|
||||
Source Database : kongx_serve
|
||||
|
||||
Target Server Type : MYSQL
|
||||
Target Server Version : 50725
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 2020-11-02 14:12:14
|
||||
*/
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
# Create Database
|
||||
# ------------------------------------------------------------
|
||||
|
||||
CREATE DATABASE IF NOT EXISTS kongx_serve DEFAULT CHARACTER SET = utf8mb4;
|
||||
|
||||
Use kongx_serve;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_operation_log
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_operation_log`;
|
||||
CREATE TABLE `kongx_operation_log` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`userId` varchar(64) DEFAULT NULL,
|
||||
`profile` varchar(32) DEFAULT NULL,
|
||||
`creator` varchar(255) DEFAULT NULL,
|
||||
`operation_type` varchar(255) DEFAULT NULL,
|
||||
`content` json DEFAULT NULL,
|
||||
`target` varchar(255) DEFAULT NULL,
|
||||
`ip` varchar(64) DEFAULT NULL,
|
||||
`create_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`remark` varchar(2048) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_target_hash` (`target`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=335 DEFAULT CHARSET=utf8;
|
||||
|
||||
DROP TABLE IF EXISTS `kongx_service_pipeline`;
|
||||
CREATE TABLE `kongx_service_pipeline` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(1024) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '用户组名称',
|
||||
`create_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`creator` varchar(255) DEFAULT NULL COMMENT '创建人',
|
||||
`modifier` varchar(255) DEFAULT NULL COMMENT '修改人',
|
||||
`modify_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`remark` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '备注',
|
||||
`link_list` json DEFAULT NULL,
|
||||
`node_list` json DEFAULT NULL,
|
||||
`origin` json DEFAULT NULL,
|
||||
`profile` varchar(255) DEFAULT NULL COMMENT '所属环境',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_server_config
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_server_config`;
|
||||
CREATE TABLE `kongx_server_config` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`config_key` varchar(255) DEFAULT NULL,
|
||||
`config_value` text,
|
||||
`config_type` varchar(255) DEFAULT NULL COMMENT '参数类型',
|
||||
`comment` varchar(2048) DEFAULT NULL,
|
||||
`create_at` timestamp NULL DEFAULT NULL,
|
||||
`creator` varchar(255) DEFAULT NULL,
|
||||
`modifier` varchar(255) DEFAULT NULL,
|
||||
`modify_at` varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `unique_config_key` (`config_key`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_server_config
|
||||
-- ----------------------------
|
||||
INSERT INTO `kongx_server_config` VALUES ('1', 'super_admin', 'admin,zhangshan', 'system', '超级管理员', '2019-12-12 16:34:07', 'admin', null, '2019-12-12 16:33:58.156');
|
||||
INSERT INTO `kongx_server_config` VALUES ('6', 'envs', '[\n {\n \"name\": \"开发环境\",\n \"code\": \"dev\",\n \"deployType\": \"beta\",\n \"profiles\": [\n {\n \"profile\":\"f\",\n \"code\":\"betaf\"\n }\n ]\n },\n {\n \"name\": \"测试环境\",\n \"code\": \"beta\",\n \"deployType\": \"beta\",\n \"profiles\": [\n {\n \"profile\":\"a\",\n \"code\":\"betaa\"\n }]\n }]\n', 'system', '环境列表,默认支持', '2019-12-16 17:06:27', null, null, '2019-12-16 16:37:53.122');
|
||||
INSERT INTO `kongx_server_config` VALUES ('7', 'envs_extension', '[]', 'extension', '环境列表的扩展配置', '2019-12-16 16:09:21', null, null, '2019-12-16 16:08:59.814');
|
||||
INSERT INTO `kongx_server_config` VALUES ('13', 'default_domains', '[\"examples.com\",\"a.examples.com\"]', null, '默认的网关域名列表', '2020-01-19 11:43:34', null, null, '2020-01-19 11:43:45.75');
|
||||
INSERT INTO `kongx_server_config` VALUES ('20', 'config_type', '[{\"label\":\"内置参数\",\"value\":\"system\"},{\"label\":\"扩展参数\",\"value\":\"extension\"}]', 'system', '系统内置参数', '2020-04-09 16:36:52', null, null, '2020-04-09 19:19:56.202');
|
||||
INSERT INTO `kongx_server_config` VALUES ('21', 'config_type_extension', '[]', 'extension', '扩展参数类型', '2020-04-09 19:31:05', null, null, '2020-04-09 19:31:05.433');
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_sync_config
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_sync_config`;
|
||||
CREATE TABLE `kongx_sync_config` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`sync_no` varchar(255) DEFAULT NULL,
|
||||
`services` json DEFAULT NULL,
|
||||
`dest_clients` json DEFAULT NULL,
|
||||
`comment` varchar(4000) DEFAULT NULL,
|
||||
`status` varchar(255) DEFAULT NULL,
|
||||
`creator` varchar(255) DEFAULT NULL,
|
||||
`create_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`data_type` varchar(255) DEFAULT NULL,
|
||||
`policy` varchar(255) DEFAULT NULL,
|
||||
`src_client` json DEFAULT NULL,
|
||||
`log_type` int(11) DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_sync_config
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_sync_log
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_sync_log`;
|
||||
CREATE TABLE `kongx_sync_log` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`sync_no` varchar(255) DEFAULT NULL,
|
||||
`service` varchar(255) DEFAULT NULL,
|
||||
`src_client` varchar(255) DEFAULT NULL,
|
||||
`dest_client` varchar(255) DEFAULT NULL,
|
||||
`creator` varchar(255) DEFAULT NULL,
|
||||
`create_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`status` varchar(255) DEFAULT NULL,
|
||||
`content` json DEFAULT NULL,
|
||||
`comment` varchar(2048) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_sync_log
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_system_function
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_system_function`;
|
||||
CREATE TABLE `kongx_system_function` (
|
||||
`id` int(64) NOT NULL AUTO_INCREMENT,
|
||||
`parent_id` bigint(20) DEFAULT NULL COMMENT '父ID',
|
||||
`code` varchar(64) DEFAULT NULL COMMENT '编码',
|
||||
`name` varchar(64) NOT NULL COMMENT '菜单名称',
|
||||
`menu_icon` varchar(512) DEFAULT NULL COMMENT '图标icon',
|
||||
`visit_view` varchar(2048) DEFAULT NULL COMMENT '访问视图',
|
||||
`visit_path` varchar(1024) DEFAULT NULL COMMENT '访问路径',
|
||||
`use_yn` varchar(6) NOT NULL DEFAULT 'y' COMMENT '是否可用n-不可用,y-可用',
|
||||
`menu_type` varchar(20) NOT NULL DEFAULT 'menu' COMMENT '菜单类型(menu=菜单,point=功能点)',
|
||||
`application_code` varchar(64) NOT NULL DEFAULT 'kongx' COMMENT '所属系统code',
|
||||
`sort_order` int(11) DEFAULT '0' COMMENT '排序,小的在前面',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `nh_parentid` (`parent_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8mb4 COMMENT='系统菜单表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_system_function
|
||||
-- ----------------------------
|
||||
INSERT INTO `kongx_system_function` VALUES ('1', '-1', '', '首页', 'icon-shouye', 'page/wel', '/home', 'y', 'menu', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('4', '5', '', 'Kong Shell', 'icon-shell', 'views/gateway/shell/index', 'shell', 'y', 'menu', 'kongx', '9');
|
||||
INSERT INTO `kongx_system_function` VALUES ('5', '-1', null, 'Gateway', 'icon-gateway', '', '/gateway', 'y', 'menu', 'kongx', '4');
|
||||
INSERT INTO `kongx_system_function` VALUES ('6', '5', '', 'Upstreams', 'icon-gateway', 'views/gateway/upstream/index', 'upstream', 'y', 'menu', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('7', '5', null, 'Services', 'icon-services', 'views/gateway/service/index', 'service', 'y', 'menu', 'kongx', '3');
|
||||
INSERT INTO `kongx_system_function` VALUES ('8', '5', '', 'Routes', 'icon-route', 'views/gateway/routing/index', 'routing', 'y', 'menu', 'kongx', '4');
|
||||
INSERT INTO `kongx_system_function` VALUES ('9', '5', '', 'Plugins', 'icon-plugin', 'views/gateway/plugin/index', 'plugin', 'y', 'menu', 'kongx', '5');
|
||||
INSERT INTO `kongx_system_function` VALUES ('10', '-1', '', '系统管理', 'icon-system', '', '/system', 'y', 'menu', 'kongx', '6');
|
||||
INSERT INTO `kongx_system_function` VALUES ('11', '10', null, '用户管理', 'icon-yonghuguanli', 'views/admin/user/index', 'user', 'y', 'menu', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('12', '10', null, '角色管理', 'icon-quanxianguanli', 'views/admin/role/index', 'role', 'y', 'menu', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('13', '10', null, '菜单管理', 'icon-caidanguanli', 'views/admin/menu/index', 'menu', 'y', 'menu', 'kongx', '4');
|
||||
INSERT INTO `kongx_system_function` VALUES ('14', '-1', null, '参数管理', 'icon-canshuguanli', '', '/operating', 'y', 'menu', 'kongx', '7');
|
||||
INSERT INTO `kongx_system_function` VALUES ('15', '14', null, '环境管理', 'icon-huanjingguanli', 'views/operating/env/index', 'envs', 'y', 'menu', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('16', '14', null, '系统参数', 'icon-xitongcanshu', 'views/operating/params/index', 'params', 'y', 'menu', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('17', '-1', null, '日志管理', 'icon-rizhiguanli1', '', '/audit', 'y', 'menu', 'kongx', '8');
|
||||
INSERT INTO `kongx_system_function` VALUES ('18', '17', '', '同步日志', 'icon-sync', 'views/operating/synclog/index', 'synclog', 'y', 'menu', 'kongx', '3');
|
||||
INSERT INTO `kongx_system_function` VALUES ('19', '17', null, '操作日志', 'icon-log', 'views/operating/log/index', 'operationlog', 'y', 'menu', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('20', '6', 'upstream_add', '新增上游代理', '', '', '', 'y', 'point', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('21', '6', 'upstream_update', '修改上游代理', '', '', '', 'y', 'point', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('22', '6', 'upstream_delete', '删除上游代理', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('23', '7', 'service_add', '新增服务', '', '', '', 'y', 'point', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('24', '7', 'service_update', '修改服务', '', '', '', 'y', 'point', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('25', '7', 'service_delete', '删除服务', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('26', '7', 'service_sync', '同步服务', '', '', '', 'y', 'point', 'kongx', '4');
|
||||
INSERT INTO `kongx_system_function` VALUES ('27', '8', 'route_update', '更新路由', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('28', '8', 'route_delete', '删除路由', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('29', '9', 'plugin_update', '更新插件', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('30', '9', 'plugin_delete', '删除插件', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('31', '9', 'plugin_add', '新增插件', '', '', '', 'y', 'point', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('32', '11', 'user_authority', '用户授权', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('33', '13', 'menu_add', '新建菜单', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('34', '13', 'menu_delete', '删除菜单', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('35', '13', 'menu_update', '修改菜单', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('36', '12', 'role_add', '新建角色', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('37', '12', 'role_update', '修改角色', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('38', '12', 'role_config', '配置权限', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('39', '7', 'service_view', '查看服务', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('40', '6', 'upstream_view', '查看上游代理', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('41', '8', 'route_view', '查看路由', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('42', '9', 'plugin_view', '查看插件', '', '', '', 'y', 'point', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('43', '11', 'user_view', '查看用户列表', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('44', '13', 'menu_view', '查看菜单', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('45', '12', 'role_view', '查看角色', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('46', '16', 'params_view', '查看系统参数', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('47', '10', null, '用户组管理', 'icon-yonghuzuguanli', 'views/admin/usergroup/index', 'group', 'y', 'menu', 'kongx', '3');
|
||||
INSERT INTO `kongx_system_function` VALUES ('48', '47', 'usergroup_add', '新增用户组', '', '', '', 'y', 'point', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('49', '47', 'usergroup_update', '修改用户组', '', '', '', 'y', 'point', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('50', '47', 'usergroup_delete', '删除用户组', '', '', '', 'y', 'point', 'kongx', '3');
|
||||
INSERT INTO `kongx_system_function` VALUES ('51', '47', 'usergroup_view', '查看用户组', '', '', '', 'y', 'point', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('52', '47', 'usergroup_config', '用户组配置', '', '', '', 'y', 'point', 'kongx', '4');
|
||||
INSERT INTO `kongx_system_function` VALUES ('53', '5', '', 'Consumers', 'icon-consumer', 'views/gateway/consumer/index', '', 'y', 'menu', 'kongx', '6');
|
||||
INSERT INTO `kongx_system_function` VALUES ('54', '53', 'consumer_view', '查看consumer', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('55', '16', 'params_add', '新增参数', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('56', '16', 'params_update', '修改参数', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('58', '15', 'manage_env', '环境维护', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('59', '5', '', 'Snis', 'icon-sni', 'views/gateway/sni/index', 'snis', 'y', 'menu', 'kongx', '7');
|
||||
INSERT INTO `kongx_system_function` VALUES ('60', '5', '', 'Certificates', 'icon-certificate', 'views/gateway/certificate/index', 'certificate', 'y', 'menu', 'kongx', '8');
|
||||
INSERT INTO `kongx_system_function` VALUES ('61', '53', 'consumer_add', '新增consumer', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('62', '53', 'consumer_update', '更新consumer', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('63', '53', 'consumer_delete', '删除consumer', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('64', '60', 'certificate_view', '查看certificate', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('65', '60', 'certificate_add', '新增certificate', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('66', '60', 'certificate_update', '修改certificate', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('67', '60', 'certificate_delete', '删除certificate', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('68', '-1', 'gateway-pipeline', '网关流水线', 'icon-pipeline', '', '', 'y', 'menu', 'kongx', '2');
|
||||
INSERT INTO `kongx_system_function` VALUES ('69', '68', 'pipeline', 'Pipeline', 'icon-pipeline', 'views/gateway/flow/index', 'pipeline', 'y', 'menu', 'kongx', '1');
|
||||
INSERT INTO `kongx_system_function` VALUES ('70', '69', 'add_pipeline', '新增流水线', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('71', '69', 'update_pipeline', '更新流水线', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('72', '69', 'remove_pipeline', '删除流水线', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('73', '69', 'config_pipeline', '配置流水线', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('74', '69', 'view_pipeline', '查看流水线', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
INSERT INTO `kongx_system_function` VALUES ('75', '69', 'view_config_pipeline', '查看流水线配置', '', '', '', 'y', 'point', 'kongx', '999');
|
||||
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_system_profile
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_system_profile`;
|
||||
CREATE TABLE `kongx_system_profile` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`profile_code` varchar(255) DEFAULT NULL COMMENT '环境编码',
|
||||
`name` varchar(255) DEFAULT NULL,
|
||||
`env` varchar(255) DEFAULT NULL COMMENT '所属环境',
|
||||
`deploy_type` varchar(255) DEFAULT NULL COMMENT '部署类型',
|
||||
`ab` varchar(255) DEFAULT NULL COMMENT '简称',
|
||||
`version` varchar(255) DEFAULT '' COMMENT 'kong版本号',
|
||||
`url` varchar(255) DEFAULT NULL,
|
||||
`extensions` varchar(4000) DEFAULT NULL,
|
||||
`create_at` timestamp NULL DEFAULT NULL,
|
||||
`profile` varchar(255) DEFAULT NULL,
|
||||
`creator` varchar(255) DEFAULT NULL,
|
||||
`remark` varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uh_profile_code` (`profile_code`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_system_role
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_system_role`;
|
||||
CREATE TABLE `kongx_system_role` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(64) DEFAULT NULL COMMENT '角色编码',
|
||||
`name` varchar(64) DEFAULT NULL COMMENT '角色名称',
|
||||
`role_type` varchar(32) DEFAULT NULL COMMENT '角色类型: roleType 菜单角色,数据权限角色',
|
||||
`sort_order` bigint(20) DEFAULT NULL COMMENT '排序',
|
||||
`use_yn` varchar(6) DEFAULT NULL COMMENT '是否可用n-不可用,y-可用',
|
||||
`remark` varchar(1024) DEFAULT NULL COMMENT '备注',
|
||||
`create_at` timestamp NULL DEFAULT NULL,
|
||||
`creator` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
|
||||
`modifier` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '修改人',
|
||||
`modify_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='系统角色表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_system_role
|
||||
-- ----------------------------
|
||||
INSERT INTO `kongx_system_role` VALUES ('1', 'super_admin', '超级管理员', 'menu', null, 'y', null, '2020-05-11 16:00:00', 'admin', 'admin', '2020-09-28 15:05:49');
|
||||
INSERT INTO `kongx_system_role` VALUES ('2', 'domestic_consumer', '普通用户', 'menu', null, 'y', null, '2020-05-09 16:42:53', 'admin', 'admin', '2020-09-28 15:05:51');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_system_role_function
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_system_role_function`;
|
||||
CREATE TABLE `kongx_system_role_function` (
|
||||
`id` int(64) NOT NULL AUTO_INCREMENT,
|
||||
`role_id` bigint(20) DEFAULT NULL COMMENT '角色Id',
|
||||
`half_checked` varchar(11) DEFAULT 'y' COMMENT '是否半选中',
|
||||
`function_id` bigint(20) DEFAULT NULL COMMENT '菜单id',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=854 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='系统角色与菜单关系表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_system_user_role
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_system_user_role`;
|
||||
CREATE TABLE `kongx_system_user_role` (
|
||||
`id` int(64) NOT NULL AUTO_INCREMENT,
|
||||
`user_id` varchar(64) DEFAULT NULL COMMENT '用户Id',
|
||||
`role_id` bigint(20) DEFAULT NULL COMMENT '角色id',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户与角色关系表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_system_user_role
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_user_group
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_user_group`;
|
||||
CREATE TABLE `kongx_user_group` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(1024) DEFAULT NULL COMMENT '用户组名称',
|
||||
`use_yn` varchar(255) DEFAULT NULL COMMENT '是否可用',
|
||||
`create_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`creator` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '创建人',
|
||||
`modifier` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '修改人',
|
||||
`modify_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='用户组';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_user_group
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_user_group_role
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_user_group_role`;
|
||||
CREATE TABLE `kongx_user_group_role` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`group_id` int(11) NOT NULL COMMENT '用户组ID',
|
||||
`role_id` int(11) NOT NULL COMMENT '角色ID',
|
||||
`profile` varchar(255) NOT NULL COMMENT '所属环境',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户组与角色关系表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_user_group_role
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_user_group_user
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_user_group_user`;
|
||||
CREATE TABLE `kongx_user_group_user` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`group_id` int(11) NOT NULL COMMENT '用户组ID',
|
||||
`user_id` varchar(255) NOT NULL COMMENT '用户ID',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户组与用户的关系表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_user_group_user
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kongx_user_info
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kongx_user_info`;
|
||||
CREATE TABLE `kongx_user_info` (
|
||||
`user_id` varchar(50) NOT NULL COMMENT '用户Id',
|
||||
`name` varchar(50) NOT NULL COMMENT '用户名',
|
||||
`email` varchar(50) DEFAULT '' COMMENT '邮箱',
|
||||
`mobile` varchar(50) DEFAULT NULL COMMENT '手机号',
|
||||
`password` varchar(255) NOT NULL,
|
||||
`status` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '状态',
|
||||
`creator` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '创建人',
|
||||
`create_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
|
||||
PRIMARY KEY (`user_id`),
|
||||
KEY `mobile` (`mobile`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_user_info
|
||||
-- ----------------------------
|
||||
INSERT INTO `kongx_user_info` VALUES ('admin', 'admin', '', '', '60029c3f5fdb5f1291362f52f7251702507ebc5b', 'activate', 'admin', '2020-09-10 18:21:38');
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kongx_system_role_function super_admin的权限信息
|
||||
-- ----------------------------
|
||||
insert into kongx_system_role_function(role_id,half_checked,function_id)
|
||||
select '1' role_id,'n' half_checked,'-1' as function_id
|
||||
union all
|
||||
select '1' role_id,'n' half_checked,id as function_id from kongx_system_function;
|
||||
-- ----------------------------
|
||||
-- Records of kongx_system_role_function 初始化domestic_consumer权限信息
|
||||
-- ----------------------------
|
||||
insert into kongx_system_role_function(role_id,half_checked,function_id)
|
||||
select '2' role_id,'y' half_checked,'-1' as function_id
|
||||
union
|
||||
select '2' role_id,'y' half_checked,id as function_id from kongx_system_function where name in ('Gateway','Upstreams','Services','Routes','Plugins','Kong Shell','Consumers','Certificates','日志管理')
|
||||
union
|
||||
select '2' role_id,'n' half_checked,id as function_id from kongx_system_function where code in ('service_view','upstream_view','route_view','plugin_view','consumer_view','certificate_view')
|
||||
union
|
||||
select '2' role_id,'n' half_checked,id as function_id from kongx_system_function where name='操作日志'
|
Loading…
x
Reference in New Issue
Block a user