Browse Source

优化部署脚本,优化saber代码生成

test
smallchill 6 years ago
parent
commit
9355a10f9f
  1. 8
      blade-ops/blade-develop/src/main/resources/templates/saber/crud.vue.vm
  2. 8
      blade-ops/blade-develop/src/test/resources/templates/saber/crud.vue.vm
  3. 4
      doc/docker/README.md
  4. 4
      doc/nacos/blade-prod.yaml
  5. 4
      doc/nacos/blade-test.yaml
  6. 60
      doc/sql/bladex-tenant-mysql-update-RC5.sql
  7. 2
      pom.xml
  8. 2
      script/docker/.env
  9. 3
      script/docker/deploy.sh
  10. 20
      script/docker/docker-compose.yml
  11. 0
      script/docker/nacos/init.d/custom.properties

8
blade-ops/blade-develop/src/main/resources/templates/saber/crud.vue.vm

@ -69,10 +69,10 @@
...mapGetters(["permission"]), ...mapGetters(["permission"]),
permissionList() { permissionList() {
return { return {
addBtn: this.permission.$!{table.entityPath}_add, addBtn: this.vaildData(this.permission.$!{table.entityPath}_add),
viewBtn: this.permission.$!{table.entityPath}_view, viewBtn: this.vaildData(this.permission.$!{table.entityPath}_view),
delBtn: this.permission.$!{table.entityPath}_delete, delBtn: this.vaildData(this.permission.$!{table.entityPath}_delete),
editBtn: this.permission.$!{table.entityPath}_edit editBtn: this.vaildData(this.permission.$!{table.entityPath}_edit)
}; };
}, },
ids() { ids() {

8
blade-ops/blade-develop/src/test/resources/templates/saber/crud.vue.vm

@ -69,10 +69,10 @@
...mapGetters(["permission"]), ...mapGetters(["permission"]),
permissionList() { permissionList() {
return { return {
addBtn: this.permission.$!{table.entityPath}_add, addBtn: this.vaildData(this.permission.$!{table.entityPath}_add),
viewBtn: this.permission.$!{table.entityPath}_view, viewBtn: this.vaildData(this.permission.$!{table.entityPath}_view),
delBtn: this.permission.$!{table.entityPath}_delete, delBtn: this.vaildData(this.permission.$!{table.entityPath}_delete),
editBtn: this.permission.$!{table.entityPath}_edit editBtn: this.vaildData(this.permission.$!{table.entityPath}_edit)
}; };
}, },
ids() { ids() {

4
doc/docker/README.md

@ -4,7 +4,7 @@
``` ```
<servers> <servers>
<server> <server>
<id>10.211.55.5</id> <id>192.168.0.157</id>
<username>admin</username> <username>admin</username>
<password>Harbor12345</password> <password>Harbor12345</password>
<configuration> <configuration>
@ -20,7 +20,7 @@
###2. docker开启远程访问 ###2. docker开启远程访问
如果没有远程访问,会报 `Connect to 10.211.55.5:2375 [/10.211.55.5] failed: Connection refused: connect` 如果没有远程访问,会报 `Connect to 192.168.0.157:2375 [/192.168.0.157] failed: Connection refused: connect`
在`/usr/lib/systemd/system/docker.service`,配置远程访问。主要是在[Service]这个部分,加上下面两个参数: 在`/usr/lib/systemd/system/docker.service`,配置远程访问。主要是在[Service]这个部分,加上下面两个参数:

4
doc/nacos/blade-prod.yaml

@ -2,7 +2,7 @@
spring: spring:
redis: redis:
##redis 单机环境配置 ##redis 单机环境配置
host: 10.211.55.5 host: 192.168.0.157
port: 3379 port: 3379
password: password:
database: 0 database: 0
@ -17,6 +17,6 @@ blade:
#通用开发生产环境数据库地址(特殊情况可在对应的子工程里配置覆盖) #通用开发生产环境数据库地址(特殊情况可在对应的子工程里配置覆盖)
datasource: datasource:
prod: prod:
url: jdbc:mysql://10.211.55.5:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8 url: jdbc:mysql://192.168.0.157:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8
username: root username: root
password: root password: root

4
doc/nacos/blade-test.yaml

@ -2,7 +2,7 @@
spring: spring:
redis: redis:
##redis 单机环境配置 ##redis 单机环境配置
host: 10.211.55.5 host: 192.168.0.157
port: 3379 port: 3379
password: password:
database: 0 database: 0
@ -17,6 +17,6 @@ blade:
#通用开发生产环境数据库地址(特殊情况可在对应的子工程里配置覆盖) #通用开发生产环境数据库地址(特殊情况可在对应的子工程里配置覆盖)
datasource: datasource:
test: test:
url: jdbc:mysql://10.211.55.5:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8 url: jdbc:mysql://192.168.0.157:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8
username: root username: root
password: root password: root

60
doc/sql/bladex-tenant-mysql-update-RC5.sql

@ -1,60 +0,0 @@
-- ----------------------------
-- 租户字段增加
-- ----------------------------
ALTER TABLE `bladex`.`blade_notice`
ADD COLUMN `tenant_code` varchar(12) NULL DEFAULT '000000' COMMENT '租户编号' AFTER `id`;
ALTER TABLE `bladex`.`blade_dept`
ADD COLUMN `tenant_code` varchar(12) NULL DEFAULT '000000' COMMENT '租户编号' AFTER `id`;
ALTER TABLE `bladex`.`blade_role`
ADD COLUMN `tenant_code` varchar(12) NULL DEFAULT '000000' COMMENT '租户编号' AFTER `id`;
ALTER TABLE `bladex`.`blade_user`
ADD COLUMN `tenant_code` varchar(12) NULL DEFAULT '000000' COMMENT '租户编号' AFTER `id`;
ALTER TABLE `bladex`.`blade_log_api`
ADD COLUMN `tenant_code` varchar(12) NULL DEFAULT '000000' COMMENT '租户编号' AFTER `id`;
ALTER TABLE `bladex`.`blade_log_error`
ADD COLUMN `tenant_code` varchar(12) NULL DEFAULT '000000' COMMENT '租户编号' AFTER `id`;
ALTER TABLE `bladex`.`blade_log_usual`
ADD COLUMN `tenant_code` varchar(12) NULL DEFAULT '000000' COMMENT '租户编号' AFTER `id`;
-- ----------------------------
-- 租户菜单增加
-- ----------------------------
INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES (3, 'tenant', '租户管理', 'menu', '/system/tenant', NULL, 1, 1, 0, 1, NULL, 0);
set @parentid = (SELECT LAST_INSERT_ID());
INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES (@parentid, 'tenant_add', '新增', 'add', '/system/tenant/add', 'plus', 1, 2, 1, 1, NULL, 0);
INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES (@parentid, 'tenant_edit', '修改', 'edit', '/system/tenant/edit', 'form', 1, 2, 1, 1, NULL, 0);
INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES (@parentid, 'tenant_delete', '删除', 'delete', '/api/blade-system/tenant/delete', 'delete', 1, 2, 1, 1, NULL, 0);
INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES (@parentid, 'tenant_view', '查看', 'view', '/system/tenant/view', 'file-text', 1, 2, 1, 1, NULL, 0);
-- ----------------------------
-- 租户表创建
-- ----------------------------
DROP TABLE IF EXISTS `blade_tenant`;
CREATE TABLE `blade_tenant` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '租户编号',
`tenant_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '租户名称',
`linkman` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人',
`contact_number` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系电话',
`address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系地址',
`create_user` int(11) NULL DEFAULT NULL COMMENT '创建人',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_user` int(11) NULL DEFAULT NULL COMMENT '修改人',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`status` int(2) NULL DEFAULT NULL COMMENT '状态',
`is_deleted` int(2) NULL DEFAULT 0 COMMENT '是否已删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- ----------------------------
-- 租户表数据插入
-- ----------------------------
BEGIN;
INSERT INTO `blade_tenant` VALUES (1, '000000', '管理组', 'admin', '666666', '管理组', 1, '2019-01-01 00:00:39', 1, '2019-01-01 00:00:39', 1, 0);
COMMIT;

2
pom.xml

@ -27,7 +27,7 @@
<spring.platform.version>Cairo-SR7</spring.platform.version> <spring.platform.version>Cairo-SR7</spring.platform.version>
<!-- 推荐使用Harbor --> <!-- 推荐使用Harbor -->
<docker.registry.url>10.211.55.5</docker.registry.url> <docker.registry.url>192.168.0.157</docker.registry.url>
<docker.registry.host>http://${docker.registry.url}:2375</docker.registry.host> <docker.registry.host>http://${docker.registry.url}:2375</docker.registry.host>
<docker.plugin.version>1.2.0</docker.plugin.version> <docker.plugin.version>1.2.0</docker.plugin.version>
</properties> </properties>

2
script/docker/.env

@ -0,0 +1,2 @@
REGISTER=192.168.0.157/blade
TAG=2.0.0.RC6

3
script/docker/deploy.sh

@ -10,6 +10,7 @@ port(){
firewall-cmd --add-port=88/tcp --permanent firewall-cmd --add-port=88/tcp --permanent
firewall-cmd --add-port=8000/tcp --permanent firewall-cmd --add-port=8000/tcp --permanent
firewall-cmd --add-port=8848/tcp --permanent firewall-cmd --add-port=8848/tcp --permanent
firewall-cmd --add-port=8858/tcp --permanent
firewall-cmd --add-port=3306/tcp --permanent firewall-cmd --add-port=3306/tcp --permanent
firewall-cmd --add-port=3379/tcp --permanent firewall-cmd --add-port=3379/tcp --permanent
firewall-cmd --add-port=7002/tcp --permanent firewall-cmd --add-port=7002/tcp --permanent
@ -29,7 +30,7 @@ mount(){
fi fi
if test ! -f "/docker/nacos/init.d/custom.properties" ;then if test ! -f "/docker/nacos/init.d/custom.properties" ;then
mkdir -p /docker/nacos/init.d mkdir -p /docker/nacos/init.d
cp nacos/custom.properties /docker/nacos/init.d/custom.properties cp nacos/init.d/custom.properties /docker/nacos/init.d/custom.properties
fi fi
} }

20
script/docker/docker-compose.yml

@ -15,7 +15,7 @@ services:
ipv4_address: 172.30.0.48 ipv4_address: 172.30.0.48
sentinel: sentinel:
image: bladex/sentinel-dashboard:1.4.2 image: bladex/sentinel-dashboard:1.5.0
hostname: "sentinel" hostname: "sentinel"
ports: ports:
- 8858:8858 - 8858:8858
@ -63,7 +63,7 @@ services:
- blade_net - blade_net
blade-admin: blade-admin:
image: "10.211.55.5/blade/blade-admin:2.0.0.RC6" image: "${REGISTER}/blade/blade-admin:${TAG}"
ports: ports:
- 7002:7002 - 7002:7002
privileged: true privileged: true
@ -72,7 +72,7 @@ services:
- blade_net - blade_net
blade-gateway1: blade-gateway1:
image: "10.211.55.5/blade/blade-gateway:2.0.0.RC6" image: "${REGISTER}/blade/blade-gateway:${TAG}"
privileged: true privileged: true
restart: always restart: always
networks: networks:
@ -80,7 +80,7 @@ services:
ipv4_address: 172.30.0.81 ipv4_address: 172.30.0.81
blade-gateway2: blade-gateway2:
image: "10.211.55.5/blade/blade-gateway:2.0.0.RC6" image: "${REGISTER}/blade/blade-gateway:${TAG}"
privileged: true privileged: true
restart: always restart: always
networks: networks:
@ -88,7 +88,7 @@ services:
ipv4_address: 172.30.0.82 ipv4_address: 172.30.0.82
blade-gateway3: blade-gateway3:
image: "10.211.55.5/blade/blade-gateway:2.0.0.RC6" image: "${REGISTER}/blade/blade-gateway:${TAG}"
privileged: true privileged: true
restart: always restart: always
networks: networks:
@ -96,35 +96,35 @@ services:
ipv4_address: 172.30.0.83 ipv4_address: 172.30.0.83
blade-auth: blade-auth:
image: "10.211.55.5/blade/blade-auth:2.0.0.RC6" image: "${REGISTER}/blade/blade-auth:${TAG}"
privileged: true privileged: true
restart: always restart: always
networks: networks:
- blade_net - blade_net
blade-log: blade-log:
image: "10.211.55.5/blade/blade-log:2.0.0.RC6" image: "${REGISTER}/blade/blade-log:${TAG}"
privileged: true privileged: true
restart: always restart: always
networks: networks:
- blade_net - blade_net
blade-desk: blade-desk:
image: "10.211.55.5/blade/blade-desk:2.0.0.RC6" image: "${REGISTER}/blade/blade-desk:${TAG}"
privileged: true privileged: true
restart: always restart: always
networks: networks:
- blade_net - blade_net
blade-user: blade-user:
image: "10.211.55.5/blade/blade-user:2.0.0.RC6" image: "${REGISTER}/blade/blade-user:${TAG}"
privileged: true privileged: true
restart: always restart: always
networks: networks:
- blade_net - blade_net
blade-system: blade-system:
image: "10.211.55.5/blade/blade-system:2.0.0.RC6" image: "${REGISTER}/blade/blade-system:${TAG}"
privileged: true privileged: true
restart: always restart: always
networks: networks:

0
script/docker/nacos/custom.properties → script/docker/nacos/init.d/custom.properties

Loading…
Cancel
Save