Browse Source

Merge remote-tracking branch 'upstream/master' into dev

# Conflicts:
#	blade-example-api/blade-dubbo-provider-api/pom.xml
#	blade-example-api/pom.xml
#	blade-example/blade-dubbo-consumer/pom.xml
#	blade-example/blade-dubbo-provider/pom.xml
#	blade-example/blade-easypoi/pom.xml
#	blade-example/blade-mq-kafka/pom.xml
#	blade-example/blade-mq-rabbit/pom.xml
#	blade-example/blade-sharding-jdbc/pom.xml
#	blade-example/blade-sharding-jdbc/src/main/java/org/springblade/sharding/config/ShardingConfiguration.java
#	blade-example/blade-sharding-jdbc/src/main/resources/application-prod.yml
#	blade-example/blade-sharding-jdbc/src/main/resources/application-test.yml
#	blade-example/blade-stream-consumer/pom.xml
#	blade-example/blade-websocket/pom.xml
#	blade-example/pom.xml
#	blade-service-api/logpm-basicdata-api/pom.xml
#	blade-service-api/logpm-factory-api/pom.xml
#	blade-service/logpm-aftersales/pom.xml
#	blade-service/logpm-aftersales/src/main/resources/liteflow/demo.el.xml
#	blade-service/logpm-basic/pom.xml
#	blade-service/logpm-basic/src/main/java/com/logpm/basic/LiteFlowTest.java
#	blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicPdaClient.java
#	blade-service/logpm-statisticsdata/pom.xml
#	blade-service/logpm-trunkline/pom.xml
#	blade-service/pom.xml
#	pom.xml
training
pref_mail@163.com 1 year ago
parent
commit
b3b08d85f5
  1. 12
      README.md
  2. 2
      blade-biz-common/pom.xml
  3. 16
      blade-gateway/pom.xml
  4. 3
      blade-gateway/src/main/java/org/springblade/gateway/filter/AuthFilter.java
  5. 16
      blade-ops/blade-xxljob-admin/pom.xml
  6. 4
      blade-ops/pom.xml
  7. 9
      blade-service-api/logpm-basicdata-api/pom.xml
  8. 10
      blade-service-api/logpm-factory-api/pom.xml
  9. 4
      blade-service-api/pom.xml
  10. 39
      blade-service/blade-demo/src/main/java/com/example/demo/rule/AbizRule.java
  11. 48
      blade-service/blade-demo/src/main/java/com/example/demo/rule/BbizRule.java
  12. 44
      blade-service/blade-demo/src/main/java/com/example/demo/rule/CbizRule.java
  13. 45
      blade-service/blade-demo/src/main/java/com/example/demo/rule/DbizRule.java
  14. 21
      blade-service/blade-demo/src/main/java/com/example/demo/rule/context/BizContext.java
  15. 5
      blade-service/logpm-aftersales/pom.xml
  16. 27
      blade-service/logpm-basic/pom.xml
  17. 20
      blade-service/logpm-old-project/pom.xml
  18. 5
      blade-service/logpm-statisticsdata/pom.xml
  19. 7
      blade-service/logpm-trunkline/pom.xml
  20. 4
      blade-service/pom.xml
  21. 35
      doc/docker/README.md
  22. 23
      doc/nacos/blade-dev.yaml
  23. 19
      doc/nacos/blade-prod.yaml
  24. 19
      doc/nacos/blade-test.yaml
  25. 20
      doc/nacos/blade.yaml
  26. 138
      pom.xml
  27. 4
      script/docker/app/.env
  28. 6
      script/docker/app/deploy.sh
  29. 2
      script/docker/app/docker-compose.yml
  30. 6
      script/docker/app/nginx/web/nginx.conf

12
README.md

@ -1,20 +1,20 @@
## 版权声明
* BladeX是一个商业化软件,系列产品知识产权归**上海布雷德科技有限公司**独立所有
* 您一旦开始复制、下载、安装或者使用本产品,即被视为完全理解并接受本协议的各项条款
* 更多详情请看:[BladeX商业授权许可协议](/LICENSE)
* 更多详情请看:[BladeX商业授权许可协议](https://license.bladex.cn)
## 答疑流程
>1. 遇到问题或Bug
>2. 业务型问题打断点调试尝试找出问题所在
>3. 系统型问题通过百度、谷歌、社区查找解决方案
>4. 未解决问题则进入技术社区进行发帖提问:[https://sns.bladex.vip/](https://sns.bladex.vip/)
>4. 未解决问题则进入技术社区进行发帖提问:[https://sns.bladex.cn](https://sns.bladex.cn)
>5. 将帖子地址发至商业群,特别简单三言两语就能描述清楚的也可在答疑时间内发至商业群提问
>6. 发帖的时候一定要描述清楚,详细描述遇到问题的**重现步骤**、**报错详细信息**、**相关代码与逻辑**、**使用软件版本**以及**操作系统版本**,否则随意发帖提问将会提高我们的答疑难度。
## 答疑时间
* 工作日:9:00 ~ 17:00 提供答疑,周末、节假日休息,暂停答疑
* 请勿**私聊提问**,以免被其他用户的消息覆盖从而无法获得答疑
* 答疑时间外遇到问题可以将问题发帖至[技术社区](https://sns.bladex.vip/),我们后续会逐个回复
* 答疑时间外遇到问题可以将问题发帖至[技术社区](https://sns.bladex.cn),我们后续会逐个回复
## 授权范围
* 专业版:只可用于**个人学习**及**个人私活**项目,不可用于公司或团队,不可泄露给任何第三方
@ -22,9 +22,9 @@
* 共同遵守:若甲方需要您提供项目源码,则需代为甲方购买BladeX企业授权,甲方购买后续的所有项目都无需再次购买授权
## 商用权益
* ✔ 遵守[商业协议](/LICENSE)的前提下,将BladeX系列产品用于授权范围内的商用项目,并上线运营
* ✔ 遵守[商业协议](/LICENSE)的前提下,不限制项目数,不限制服务器数
* ✔ 遵守[商业协议](/LICENSE)的前提下,将自行编写的业务代码申请软件著作权
* ✔ 遵守[商业协议](https://license.bladex.cn)的前提下,将BladeX系列产品用于授权范围内的商用项目,并上线运营
* ✔ 遵守[商业协议](https://license.bladex.cn)的前提下,不限制项目数,不限制服务器数
* ✔ 遵守[商业协议](https://license.bladex.cn)的前提下,将自行编写的业务代码申请软件著作权
## 何为侵权
* ❌ 不遵守商业协议,私自销售商业源码

2
blade-biz-common/pom.xml

@ -5,7 +5,7 @@
<parent>
<artifactId>BladeX-Biz</artifactId>
<groupId>org.springblade</groupId>
<version>3.1.0.RELEASE</version>
<version>3.2.0.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

16
blade-gateway/pom.xml

@ -5,7 +5,7 @@
<parent>
<artifactId>BladeX-Biz</artifactId>
<groupId>org.springblade</groupId>
<version>3.1.0.RELEASE</version>
<version>3.2.0.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -78,18 +78,10 @@
<build>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<username>${docker.username}</username>
<password>${docker.password}</password>
<repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository>
<tag>${project.version}</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<skip>false</skip>
<skip>${docker.fabric.skip}</skip>
</configuration>
</plugin>
<plugin>

3
blade-gateway/src/main/java/org/springblade/gateway/filter/AuthFilter.java

@ -81,8 +81,9 @@ public class AuthFilter implements GlobalFilter, Ordered {
//判断 Token 状态
if (jwtProperties.getState()) {
String tenantId = String.valueOf(claims.get(TokenConstant.TENANT_ID));
String clientId = String.valueOf(claims.get(TokenConstant.CLIENT_ID));
String userId = String.valueOf(claims.get(TokenConstant.USER_ID));
String accessToken = JwtUtil.getAccessToken(tenantId, userId, token);
String accessToken = JwtUtil.getAccessToken(tenantId, clientId, userId, token);
if (!token.equalsIgnoreCase(accessToken)) {
return unAuth(resp, "令牌已失效");
}

16
blade-ops/blade-xxljob-admin/pom.xml

@ -3,7 +3,7 @@
<parent>
<artifactId>blade-ops</artifactId>
<groupId>org.springblade</groupId>
<version>3.1.0.RELEASE</version>
<version>3.2.0.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -92,18 +92,10 @@
<build>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<username>${docker.username}</username>
<password>${docker.password}</password>
<repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository>
<tag>${project.version}</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<skip>false</skip>
<skip>${docker.fabric.skip}</skip>
</configuration>
</plugin>
<plugin>

4
blade-ops/pom.xml

@ -5,13 +5,13 @@
<parent>
<artifactId>BladeX-Biz</artifactId>
<groupId>org.springblade</groupId>
<version>3.1.0.RELEASE</version>
<version>3.2.0.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>blade-ops</artifactId>
<name>${project.artifactId}</name>
<version>3.1.0.RELEASE</version>
<version>3.2.0.RELEASE</version>
<packaging>pom</packaging>
<modules>

9
blade-service-api/logpm-basicdata-api/pom.xml

@ -6,18 +6,23 @@
<parent>
<groupId>org.springblade</groupId>
<version>3.2.0.RELEASE</version>
<artifactId>blade-service-api</artifactId>
<version>3.1.0.RELEASE</version>
</parent>
<groupId>org.springblade</groupId>
<artifactId>logpm-basicdata-api</artifactId>
<version>3.1.0.RELEASE</version>
<version>3.2.0.RELEASE</version>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
</dependency>
</dependencies>

10
blade-service-api/logpm-factory-api/pom.xml

@ -2,18 +2,16 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springblade</groupId>
<artifactId>blade-service-api</artifactId>
<version>3.1.0.RELEASE</version>
<groupId>org.springblade</groupId>
<version>3.2.0.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.springblade</groupId>
<artifactId>logpm-factory-api</artifactId>
<version>3.1.0.RELEASE</version>
<version>${bladex.project.version}</version>
<packaging>jar</packaging>
</project>

4
blade-service-api/pom.xml

@ -5,14 +5,14 @@
<parent>
<artifactId>BladeX-Biz</artifactId>
<groupId>org.springblade</groupId>
<version>3.1.0.RELEASE</version>
<version>3.2.0.RELEASE</version>
</parent>
<description>BladeX 微服务API集合</description>
<modelVersion>4.0.0</modelVersion>
<artifactId>blade-service-api</artifactId>
<name>${project.artifactId}</name>
<version>3.1.0.RELEASE</version>
<version>3.2.0.RELEASE</version>
<packaging>pom</packaging>
<modules>
<!--工厂数据-->

39
blade-service/blade-demo/src/main/java/com/example/demo/rule/AbizRule.java

@ -0,0 +1,39 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.example.demo.rule;
import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeComponent;
import lombok.extern.slf4j.Slf4j;
/**
* A业务
*
* @author Chill
*/
@Slf4j
@LiteflowComponent(id = "abizRule", name = "A业务")
public class AbizRule extends NodeComponent {
@Override
public void process() throws Exception {
log.info("A业务执行完毕");
}
}

48
blade-service/blade-demo/src/main/java/com/example/demo/rule/BbizRule.java

@ -0,0 +1,48 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.example.demo.rule;
import com.example.demo.rule.context.BizContext;
import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeSwitchComponent;
import lombok.extern.slf4j.Slf4j;
/**
* A业务
*
* @author Chill
*/
@Slf4j
@LiteflowComponent(id = "bbizRule", name = "B业务")
public class BbizRule extends NodeSwitchComponent {
@Override
public String processSwitch() throws Exception {
// 获取上下文
BizContext contextBean = this.getContextBean(BizContext.class);
// 获取条件
Boolean isPublish = contextBean.getIsPublish();
log.info("B业务执行判断");
// 进行节点判断
if (isPublish) {
return "cbizRule";
} else {
return "dbizRule";
}
}
}

44
blade-service/blade-demo/src/main/java/com/example/demo/rule/CbizRule.java

@ -0,0 +1,44 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.example.demo.rule;
import com.example.demo.rule.context.BizContext;
import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeComponent;
import lombok.extern.slf4j.Slf4j;
/**
* A业务
*
* @author Chill
*/
@Slf4j
@LiteflowComponent(id = "cbizRule", name = "C业务")
public class CbizRule extends NodeComponent {
@Override
public void process() throws Exception {
// 获取上下文
BizContext contextBean = this.getContextBean(BizContext.class);
// 修改上下文
contextBean.setName(contextBean.getName() + "-> C");
log.info("C业务执行完毕");
}
}

45
blade-service/blade-demo/src/main/java/com/example/demo/rule/DbizRule.java

@ -0,0 +1,45 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.example.demo.rule;
import com.example.demo.rule.context.BizContext;
import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeComponent;
import lombok.extern.slf4j.Slf4j;
/**
* A业务
*
* @author Chill
*/
@Slf4j
@LiteflowComponent(id = "dbizRule", name = "D业务")
public class DbizRule extends NodeComponent {
@Override
public void process() throws Exception {
// 获取上下文
BizContext contextBean = this.getContextBean(BizContext.class);
// 修改上下文
contextBean.setName(contextBean.getName() + "-> D");
log.info("D业务执行完毕");
}
}

21
blade-service/blade-demo/src/main/java/com/example/demo/rule/context/BizContext.java

@ -0,0 +1,21 @@
package com.example.demo.rule.context;
import lombok.Data;
/**
* 上下文类
*
* @author Chill
*/
@Data
public class BizContext {
private Long id;
private String name;
private Integer category;
private Boolean isPublish;
}

5
blade-service/logpm-aftersales/pom.xml

@ -7,12 +7,13 @@
<parent>
<groupId>org.springblade</groupId>
<artifactId>blade-service</artifactId>
<version>3.1.0.RELEASE</version>
<version>3.2.0.RELEASE</version>
</parent>
<groupId>org.springblade</groupId>
<artifactId>logpm-aftersales</artifactId>
<version>${bladex.project.version}</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
@ -29,5 +30,5 @@
<scope>compile</scope>
</dependency>
</dependencies>
</project>

27
blade-service/logpm-basic/pom.xml

@ -6,9 +6,14 @@
<parent>
<groupId>org.springblade</groupId>
<artifactId>blade-service</artifactId>
<version>3.1.0.RELEASE</version>
<version>3.2.0.RELEASE</version>
</parent>
<groupId>org.springblade</groupId>
<artifactId>logpm-basic</artifactId>
<version>${bladex.project.version}</version>
<dependencies>
<dependency>
<groupId>org.springblade</groupId>
@ -57,27 +62,13 @@
</dependency>
</dependencies>
<groupId>org.springblade</groupId>
<artifactId>logpm-basic</artifactId>
<version>${bladex.project.version}</version>
<build>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<username>${docker.username}</username>
<password>${docker.password}</password>
<repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository>
<tag>${project.version}</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<skip>false</skip>
<skip>${docker.fabric.skip}</skip>
</configuration>
</plugin>
<plugin>

20
blade-service/logpm-old-project/pom.xml

@ -7,7 +7,7 @@
<parent>
<groupId>org.springblade</groupId>
<artifactId>blade-service</artifactId>
<version>3.1.0.RELEASE</version>
<version>3.2.0.RELEASE</version>
</parent>
<groupId>org.springblade</groupId>
@ -33,6 +33,10 @@
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-liteflow</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-test</artifactId>
@ -49,18 +53,10 @@
<build>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<username>${docker.username}</username>
<password>${docker.password}</password>
<repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository>
<tag>${project.version}</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<skip>false</skip>
<skip>${docker.fabric.skip}</skip>
</configuration>
</plugin>
<plugin>

5
blade-service/logpm-statisticsdata/pom.xml

@ -7,11 +7,13 @@
<parent>
<groupId>org.springblade</groupId>
<artifactId>blade-service</artifactId>
<version>3.1.0.RELEASE</version>
<version>3.2.0.RELEASE</version>
</parent>
<groupId>org.springblade</groupId>
<artifactId>logpm-statisticsdata</artifactId>
<version>${bladex.project.version}</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
@ -29,5 +31,4 @@
</dependencies>
</project>

7
blade-service/logpm-trunkline/pom.xml

@ -6,13 +6,16 @@
<parent>
<groupId>org.springblade</groupId>
<version>3.2.0.RELEASE</version>
<artifactId>blade-service</artifactId>
<version>3.1.0.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.springblade</groupId>
<artifactId>logpm-trunkline</artifactId>
<version>${bladex.project.version}</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.springblade</groupId>
@ -34,7 +37,7 @@
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-trunkline-api</artifactId>
<version>3.1.0.RELEASE</version>
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>

4
blade-service/pom.xml

@ -7,7 +7,7 @@
<parent>
<groupId>org.springblade</groupId>
<artifactId>BladeX-Biz</artifactId>
<version>3.1.0.RELEASE</version>
<version>3.2.0.RELEASE</version>
</parent>
<artifactId>blade-service</artifactId>
@ -16,8 +16,6 @@
<packaging>pom</packaging>
<description>微服务集合</description>
<modules>
<!--工厂数据-->
<module>logpm-factory</module>

35
doc/docker/README.md

@ -4,9 +4,9 @@
```
<servers>
<server>
<id>192.168.0.157</id>
<id>192.168.0.188</id>
<username>admin</username>
<password>Harbor12345</password>
<password>admin12345</password>
<configuration>
<email>smallchill@163.com</email>
</configuration>
@ -14,13 +14,13 @@
</servers>
<pluginGroups>
<pluginGroup>com.spotify</pluginGroup>
<pluginGroup>io.fabric8</pluginGroup>
</pluginGroups>
```
### 2. docker开启远程访问
如果没有远程访问,会报 `Connect to 192.168.0.157:2375 [/192.168.0.157] failed: Connection refused: connect`
如果没有远程访问,会报 `Connect to 192.168.0.188:2375 [/192.168.0.188] failed: Connection refused: connect`
在`/usr/lib/systemd/system/docker.service`,配置远程访问。主要是在[Service]这个部分,加上下面两个参数:
@ -49,7 +49,7 @@ ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
```
{
"registry-mirrors": ["https://3dse7md.mirror.aliyuncs.com"],
"insecure-registries":["192.168.0.157"]
"insecure-registries":["192.168.0.188"]
}
```
@ -59,18 +59,10 @@ ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
<build>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<username>${docker.username}</username>
<password>${docker.password}</password>
<repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository>
<tag>${project.version}</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<skip>false</skip>
<skip>${docker.fabric.skip}</skip>
</configuration>
</plugin>
</plugins>
@ -80,9 +72,9 @@ ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
### 5. 在每个需要构建子项目的根目录下加入Dockerfile,内容可参考如下
```
FROM adoptopenjdk/openjdk8-openj9:alpine-slim
FROM bladex/alpine-java:openjdk8-openj9_cn_slim
MAINTAINER smallchill@163.com
MAINTAINER bladejava@qq.com
RUN mkdir -p /blade/gateway
@ -100,10 +92,15 @@ CMD ["--spring.profiles.active=test"]
### 6. 在工程根目录的docker-compose.yml下加入配置,内容可参考如下
```
blade-gateway:
image: "${REGISTER}/blade/blade-gateway:${TAG}"
image: "${REGISTER}/blade-gateway:${TAG}"
ports:
- 80:80
networks:
blade_net:
ipv4_address: 192.168.2.1
```
### 7. 一切配置完毕,采用fabric插件命令执行构建推送:
```
mvn clean package docker:build docker:push
```

23
doc/nacos/blade-dev.yaml

@ -17,10 +17,12 @@ spring:
#driver-class-name: oracle.jdbc.OracleDriver
#driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
#driver-class-name: dm.jdbc.driver.DmDriver
#driver-class-name: com.yashandb.jdbc.Driver
druid:
# MySql、PostgreSQL、SqlServer、DaMeng校验
validation-query: select 1
# Oracle校验
# Oracle、YashanDB校验
#oracle: true
#validation-query: select 1 from dual
#项目模块集中配置
@ -30,14 +32,13 @@ blade:
enabled: false
address: redis://127.0.0.1:6379
#多团队协作服务配置
ribbon:
rule:
#开启配置
enabled: true
#负载均衡优先调用的ip段
prior-ip-pattern:
- 192.168.0.*
- 127.0.0.1
loadbalancer:
#开启配置
enabled: true
#负载均衡优先调用的ip段
prior-ip-pattern:
- 192.168.0.*
- 127.0.0.1
#通用开发生产环境数据库地址(特殊情况可在对应的子工程里配置覆盖)
datasource:
dev:
@ -61,3 +62,7 @@ blade:
#url: jdbc:dm://127.0.0.1:5236/BLADEX?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
#username: BLADEX
#password: BLADEX
# YashanDB
#url: jdbc:yasdb://127.0.0.1:1688/BLADEX
#username: BLADEX
#password: BLADEX

19
doc/nacos/blade-prod.yaml

@ -4,7 +4,7 @@ spring:
##redis 单机环境配置
##将docker脚本部署的redis服务映射为宿主机ip
##生产环境推荐使用阿里云高可用redis服务并设置密码
host: 192.168.0.157
host: 192.168.0.188
port: 3379
password:
database: 0
@ -15,13 +15,16 @@ spring:
# commandTimeout: 5000
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
#driver-class-name: org.postgresql.Driver
#driver-class-name: oracle.jdbc.OracleDriver
#driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
#driver-class-name: org.postgresql.Driver
#driver-class-name: oracle.jdbc.OracleDriver
#driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
#driver-class-name: dm.jdbc.driver.DmDriver
#driver-class-name: com.yashandb.jdbc.Driver
druid:
# MySql、PostgreSQL、SqlServer校验
# MySql、PostgreSQL、SqlServer、DaMeng校验
validation-query: select 1
# Oracle校验
# Oracle、YashanDB校验
#oracle: true
#validation-query: select 1 from dual
#项目模块集中配置
@ -32,10 +35,10 @@ blade:
enabled: false
##将docker脚本部署的redis服务映射为宿主机ip
##生产环境推荐使用阿里云高可用redis服务并设置密码
address: redis://192.168.0.157:3379
address: redis://192.168.0.188:3379
#通用开发生产环境数据库地址(特殊情况可在对应的子工程里配置覆盖)
datasource:
prod:
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&allowPublicKeyRetrieval=true
url: jdbc:mysql://192.168.0.188:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
username: root
password: root

19
doc/nacos/blade-test.yaml

@ -3,7 +3,7 @@ spring:
redis:
##redis 单机环境配置
##将docker脚本部署的redis服务映射为宿主机ip
host: 192.168.0.157
host: 192.168.0.188
port: 3379
password:
database: 0
@ -14,13 +14,16 @@ spring:
# commandTimeout: 5000
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
#driver-class-name: org.postgresql.Driver
#driver-class-name: oracle.jdbc.OracleDriver
#driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
#driver-class-name: org.postgresql.Driver
#driver-class-name: oracle.jdbc.OracleDriver
#driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
#driver-class-name: dm.jdbc.driver.DmDriver
#driver-class-name: com.yashandb.jdbc.Driver
druid:
# MySql、PostgreSQL、SqlServer校验
# MySql、PostgreSQL、SqlServer、DaMeng校验
validation-query: select 1
# Oracle校验
# Oracle、YashanDB校验
#oracle: true
#validation-query: select 1 from dual
#项目模块集中配置
@ -30,10 +33,10 @@ blade:
##是否启用分布式锁
enabled: false
##将docker脚本部署的redis服务映射为宿主机ip
address: redis://192.168.0.157:3379
address: redis://192.168.0.188:3379
#通用开发生产环境数据库地址(特殊情况可在对应的子工程里配置覆盖)
datasource:
test:
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&allowPublicKeyRetrieval=true
url: jdbc:mysql://192.168.0.188:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
username: root
password: root

20
doc/nacos/blade.yaml

@ -68,7 +68,7 @@ knife4j:
swagger:
title: BladeX 接口文档系统
description: BladeX 接口文档系统
version: 3.1.0.RELEASE
version: 3.2.0.RELEASE
license: Powered By BladeX
license-url: https://bladex.vip
terms-of-service-url: https://bladex.vip
@ -83,8 +83,13 @@ blade:
token:
#是否有状态
state: false
#是否单用户登录
single: false
#单用户登录范围
single-level: all
#token签名
sign-key: 请配置签名
#使用 blade-auth服务 @org.springblade.test.SignKeyGenerator 获取
sign-key: 请配置32位签名
#redis序列化方式
redis:
serializer-type: protostuff
@ -106,6 +111,17 @@ blade:
big-num-to-string: true
#支持text文本请求,与报文加密同时开启
support-text-plain: false
#日志配置
log:
request:
#开启控制台请求日志
enabled: true
#控制台请求日志忽略
skip-url:
- /blade-desk/notice/list
- /blade-chat/weixin/**
#开启错误日志入库
error-log: true
#xss配置
xss:
enabled: true

138
pom.xml

@ -5,7 +5,7 @@
<groupId>org.springblade</groupId>
<artifactId>BladeX-Biz</artifactId>
<version>3.1.0.RELEASE</version>
<version>3.2.0.RELEASE</version>
<packaging>pom</packaging>
<properties>
@ -19,13 +19,13 @@
<flowable.version>6.4.2</flowable.version>
<dubbo.version>2.7.8</dubbo.version>
<!-- 推荐使用Harbor -->
<docker.registry.url>192.168.0.157</docker.registry.url>
<docker.registry.host>http://${docker.registry.url}:2375</docker.registry.host>
<!-- Docker仓库服务配置 -->
<docker.registry.url>192.168.0.188</docker.registry.url>
<docker.username>admin</docker.username>
<docker.password>Harbor12345</docker.password>
<docker.password>admin12345</docker.password>
<docker.namespace>blade</docker.namespace>
<docker.plugin.version>1.4.13</docker.plugin.version>
<docker.fabric.skip>false</docker.fabric.skip>
<docker.fabric.version>0.42.0</docker.fabric.version>
</properties>
<modules>
@ -54,6 +54,32 @@
</dependencyManagement>
<dependencies>
<!-- Oracle -->
<!--<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId>
</dependency>-->
<!-- PostgreSql -->
<!--<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>-->
<!-- SqlServer -->
<!--<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
</dependency>-->
<!-- DaMeng -->
<!--<dependency>
<groupId>com.dameng</groupId>
<artifactId>DmJdbcDriver18</artifactId>
</dependency>-->
<!--YashanDB-->
<!--<dependency>
<groupId>com.yashandb.jdbc</groupId>
<artifactId>yasdb-jdbc</artifactId>
</dependency>-->
<!--lombok-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
@ -87,7 +113,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.7.10</version>
<version>2.7.11</version>
<configuration>
<fork>true</fork>
<finalName>${project.build.finalName}</finalName>
@ -101,29 +127,29 @@
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${docker.plugin.version}</version>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker.fabric.version}</version>
<configuration>
<username>${docker.username}</username>
<password>${docker.password}</password>
<repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository>
<tag>${project.version}</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<skip>true</skip>
<authConfig>
<username>${docker.username}</username>
<password>${docker.password}</password>
</authConfig>
<registry>${docker.registry.url}</registry>
<images>
<image>
<name>${docker.namespace}/${project.build.finalName}:${project.version}</name>
<alias>${project.name}</alias>
<build>
<dockerFile>${project.basedir}/Dockerfile</dockerFile>
</build>
</image>
</images>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
<JAR_FILE>${basedir}/target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
<!--子服务添加如下配置,运行 mvn deploy 命令便会自动打包镜像-->
<!--<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>-->
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -148,13 +174,6 @@
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
@ -179,36 +198,43 @@
</plugins>
</build>
<!--<repositories>-->
<!--<repository>-->
<!--<id>aliyun-repos</id>-->
<!--<url>https://maven.aliyun.com/repository/public/</url>-->
<!--<snapshots>-->
<!--<enabled>false</enabled>-->
<!--</snapshots>-->
<!--</repository>-->
<!--<repository>-->
<!--<id>blade-release</id>-->
<!--<name>Release Repository</name>-->
<!--<url>http://nexus.bladex.vip/repository/maven-releases/</url>-->
<!--</repository>-->
<!--&lt;!&ndash; 本地仓库 &ndash;&gt;-->
<!--<repository>-->
<!--<id>logpm-release</id>-->
<!--<name>Release Repository</name>-->
<!--<url>http://192.168.2.100:8081/repository/logpm-release/</url>-->
<!--</repository>-->
<!--</repositories>-->
<repositories>
<repository>
<id>aliyun-repos</id>
<name>Aliyun Public Repository</name>
<url>https://maven.aliyun.com/repository/public</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>bladex</id>
<name>BladeX Release Repository</name>
<url>https://center.javablade.com/api/packages/blade/maven</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>aliyun-plugin</id>
<url>https://maven.aliyun.com/repository/public/</url>
<name>Aliyun Public Plugin</name>
<url>https://maven.aliyun.com/repository/public</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>bladex</id>
<name>BladeX Release Repository</name>
<url>https://center.javablade.com/api/packages/blade/maven</url>
</repository>
<snapshotRepository>
<id>bladex</id>
<name>BladeX Snapshot Repository</name>
<url>https://center.javablade.com/api/packages/blade/maven</url>
</snapshotRepository>
</distributionManagement>
</project>

4
script/docker/app/.env

@ -1,2 +1,2 @@
REGISTER=192.168.0.157/blade
TAG=3.1.0.RELEASE
REGISTER=192.168.0.188/blade
TAG=3.2.0.RELEASE

6
script/docker/app/deploy.sh

@ -50,9 +50,9 @@ mount(){
cp nginx/web/nginx.conf /docker/nginx/web/nginx.conf
cp -r nginx/web/html /docker/nginx/web/html
fi
if test ! -f "/docker/nacos/init.d/custom.properties" ;then
mkdir -p /docker/nacos/init.d
cp nacos/init.d/custom.properties /docker/nacos/init.d/custom.properties
if test ! -f "/docker/nacos/conf/application.properties" ;then
mkdir -p /docker/nacos/conf
cp nacos/conf/application.properties /docker/nacos/conf/application.properties
fi
if test ! -f "/docker/prometheus/prometheus.yml" ;then
mkdir -p /docker/prometheus

2
script/docker/app/docker-compose.yml

@ -6,7 +6,7 @@ services:
####################################################################################################
nacos:
image: nacos/nacos-server:2.1.2
image: nacos/nacos-server:v2.1.2
hostname: "nacos-standalone"
environment:
- MODE=standalone

6
script/docker/app/nginx/web/nginx.conf

@ -41,9 +41,9 @@ http {
server_name web;
root /usr/share/nginx/html;
location / {
root html;
index index.html;
location /{
index index.html;
error_page 404 /index.html;
}
location ^~ /oauth/redirect {

Loading…
Cancel
Save