增加自定义配置启动参数模块,更新blade-tool-RC3

This commit is contained in:
smallchill 2019-01-03 16:40:27 +08:00
parent 0f83818d88
commit c851685ad8
16 changed files with 97 additions and 35 deletions

View File

@ -176,7 +176,7 @@ recommend that a file or class name and description of purpose be included on
the same "printed page" as the copyright notice for easier identification within
third-party archives.
Copyright 2017 smallchill
Copyright 2019 smallchill
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -188,4 +188,4 @@ third-party archives.
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.

View File

@ -93,7 +93,11 @@ Apache Licence也是对商业应用友好的许可。使用者也可以在需要
# 界面一览
<table>
<tr>
<td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-k8s.png"/></td>
<td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-k8s1.png"/></td>
<td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-k8s2.png"/></td>
</tr>
<tr>
<td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-grafana.png"/></td>
<td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-harbor.png"/></td>
</tr>
<tr>

View File

@ -18,6 +18,11 @@
<dependencies>
<!--Blade-->
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-common</artifactId>
<version>${blade.project.version}</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-secure</artifactId>

View File

@ -14,6 +14,14 @@
<version>${blade.project.version}</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-launch</artifactId>
<version>${blade.tool.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>

View File

@ -17,8 +17,6 @@ package org.springblade.common.config;
import lombok.AllArgsConstructor;
import org.springblade.common.tool.DictUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
@ -30,9 +28,4 @@ import org.springframework.context.annotation.Configuration;
@AllArgsConstructor
public class BladeCommonConfiguration {
@Bean
public DictUtil dictUtil() {
return new DictUtil();
}
}

View File

@ -7,6 +7,21 @@ package org.springblade.common.constant;
*/
public interface CommonConstant {
/**
* consul dev 地址
*/
String CONSUL_DEV_HOST = "http://localhost";
/**
* consul prod 地址
*/
String CONSUL_PROD_HOST = "http://192.168.186.129";
/**
* consul端口
*/
String CONSUL_PORT = "8500";
/**
* 顶级父节点id
*/

View File

@ -0,0 +1,39 @@
/**
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springblade.common.launch;
import org.springblade.common.constant.CommonConstant;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.launch.service.LauncherService;
import org.springframework.boot.builder.SpringApplicationBuilder;
import java.util.Properties;
/**
* 启动参数拓展
*
* @author smallchil
*/
public class LauncherServiceImpl implements LauncherService {
@Override
public void launcher(SpringApplicationBuilder builder, String appName, String profile) {
Properties props = System.getProperties();
props.setProperty("spring.cloud.consul.host", profile.equals(AppConstant.DEV_CDOE) ? CommonConstant.CONSUL_DEV_HOST : CommonConstant.CONSUL_PROD_HOST);
props.setProperty("spring.cloud.consul.port", CommonConstant.CONSUL_PORT);
}
}

View File

@ -1,24 +0,0 @@
/**
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springblade.common.tool;
/**
* 字典工具类
*
* @author Chill
*/
public class DictUtil {
}

View File

@ -0,0 +1 @@
org.springblade.common.launch.LauncherServiceImpl

View File

@ -31,6 +31,17 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-common</artifactId>
<version>${blade.project.version}</version>
<exclusions>
<exclusion>
<groupId>org.springblade</groupId>
<artifactId>blade-core-launch</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--Spring-->
<dependency>
<groupId>org.springframework.cloud</groupId>

View File

@ -16,6 +16,11 @@
<dependencies>
<!--Blade-->
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-common</artifactId>
<version>${blade.project.version}</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-launch</artifactId>

View File

@ -16,6 +16,11 @@
<dependencies>
<!--Blade-->
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-common</artifactId>
<version>${blade.project.version}</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-launch</artifactId>

BIN
pic/springblade-grafana.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

BIN
pic/springblade-k8s2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 KiB

View File

@ -9,7 +9,7 @@
<packaging>pom</packaging>
<properties>
<blade.tool.version>1.0.0-RC2</blade.tool.version>
<blade.tool.version>1.0.0-RC3</blade.tool.version>
<blade.project.version>2.0.0-RC1</blade.project.version>
<java.version>1.8</java.version>