mirror of https://github.com/longtai-cn/hippo4j
commit
d4a64d17e6
@ -1,3 +1,3 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
custom: ['https://hippo4j.cn/docs/community/sponsor']
|
||||
custom: ['https://hippo4j.cn/community/sponsor']
|
||||
|
@ -0,0 +1,102 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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 cn.hippo4j.common.web.base;
|
||||
|
||||
import cn.hippo4j.common.toolkit.Assert;
|
||||
import cn.hippo4j.common.web.exception.AbstractException;
|
||||
import cn.hippo4j.common.web.exception.ErrorCode;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static cn.hippo4j.common.web.exception.ErrorCodeEnum.SERVICE_ERROR;
|
||||
|
||||
public class ResultsTest {
|
||||
|
||||
@Test
|
||||
public void success() {
|
||||
Assert.isTrue(Result.SUCCESS_CODE.equals(Results.success().getCode()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess() {
|
||||
Object o = new Object();
|
||||
Assert.isTrue(o.equals(Results.success(o).getData()));
|
||||
Assert.isTrue(Result.SUCCESS_CODE.equals(Results.success().getCode()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void failure() {
|
||||
Assert.isTrue(SERVICE_ERROR.getCode().equals(Results.failure().getCode()));
|
||||
Assert.isTrue(SERVICE_ERROR.getMessage().equals(Results.failure().getMessage()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure() {
|
||||
String code = "500";
|
||||
String msg = "message";
|
||||
AbstractException abstractException = new AbstractException(msg, new Throwable(), new ErrorCode() {
|
||||
|
||||
@Override
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "errorMsg";
|
||||
}
|
||||
});
|
||||
Assert.isTrue(code.equals(Results.failure(abstractException).getCode()));
|
||||
Assert.isTrue(msg.equals(Results.failure(abstractException).getMessage()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure1() {
|
||||
String msg = "throwableMsg";
|
||||
Throwable throwable = new Throwable(msg);
|
||||
Assert.isTrue(SERVICE_ERROR.getCode().equals(Results.failure(throwable).getCode()));
|
||||
Assert.isTrue(msg.equals(Results.failure(throwable).getMessage()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure2() {
|
||||
String code = "500";
|
||||
String msg = "message";
|
||||
ErrorCode errorCode = new ErrorCode() {
|
||||
|
||||
@Override
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return msg;
|
||||
}
|
||||
};
|
||||
Assert.isTrue(code.equals(Results.failure(errorCode).getCode()));
|
||||
Assert.isTrue(msg.equals(Results.failure(errorCode).getMessage()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure3() {
|
||||
String code = "500";
|
||||
String msg = "message";
|
||||
Assert.isTrue(code.equals(Results.failure(code, msg).getCode()));
|
||||
Assert.isTrue(msg.equals(Results.failure(code, msg).getMessage()));
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.hippo4j</groupId>
|
||||
<artifactId>hippo4j-example</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<artifactId>hippo4j-config-consul-spring-boot-starter-example</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.deploy.skip>true</maven.deploy.skip>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hippo4j</groupId>
|
||||
<artifactId>hippo4j-example-core</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hippo4j</groupId>
|
||||
<artifactId>hippo4j-config-spring-boot-starter</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-consul-config</artifactId>
|
||||
<version>${consul.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-registry-prometheus</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,18 @@
|
||||
server:
|
||||
port: 8091
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: hippo4j-config-consul-spring-boot-starter-example
|
||||
profiles:
|
||||
active: dev
|
||||
cloud:
|
||||
consul:
|
||||
host: 127.0.0.1
|
||||
port: 8500
|
||||
config:
|
||||
enabled: true
|
||||
format: yaml
|
||||
data-key: hippo4j-consul
|
||||
default-context: application
|
||||
prefix: config
|
@ -0,0 +1,52 @@
|
||||
# 以下内容复制到 consul 配置文件中
|
||||
# Copy the following to the consul configuration file
|
||||
|
||||
spring.dynamic.thread-pool.tomcat.core-pool-size=64
|
||||
spring.dynamic.thread-pool.tomcat.maximum-pool-size=128
|
||||
spring.dynamic.thread-pool.tomcat.keep-alive-time=1000
|
||||
spring.dynamic.thread-pool.tomcat.enable=true
|
||||
spring.dynamic.thread-pool.default-executor.core-pool-size=1
|
||||
spring.dynamic.thread-pool.default-executor.maximum-pool-size=2
|
||||
spring.dynamic.thread-pool.default-executor.blocking-queue=ResizableCapacityLinkedBlockingQueue
|
||||
spring.dynamic.thread-pool.default-executor.execute-time-out=100
|
||||
spring.dynamic.thread-pool.default-executor.keep-alive-time=6691
|
||||
spring.dynamic.thread-pool.default-executor.queue-capacity=1
|
||||
spring.dynamic.thread-pool.default-executor.rejected-handler=AbortPolicy
|
||||
spring.dynamic.thread-pool.default-executor.active-alarm=90
|
||||
spring.dynamic.thread-pool.default-executor.capacity-alarm=85
|
||||
spring.dynamic.thread-pool.default-executor.alarm=true
|
||||
spring.dynamic.thread-pool.default-executor.allow-core-thread-time-out=true
|
||||
spring.dynamic.thread-pool.default-executor.notify.interval=5
|
||||
spring.dynamic.thread-pool.default-executor.notify.receives=chen.ma
|
||||
spring.dynamic.thread-pool.notify-platforms[0].platform=WECHAT
|
||||
spring.dynamic.thread-pool.notify-platforms[0].secret-key=ec3be378-6c99-45d2-a147-b400c7e94a08
|
||||
spring.dynamic.thread-pool.executors[0].thread-pool-id=message-consume
|
||||
spring.dynamic.thread-pool.executors[0].thread-name-prefix=message-consume
|
||||
spring.dynamic.thread-pool.executors[0].core-pool-size=2
|
||||
spring.dynamic.thread-pool.executors[0].maximum-pool-size=4
|
||||
spring.dynamic.thread-pool.executors[0].queue-capacity=1024
|
||||
spring.dynamic.thread-pool.executors[0].blocking-queue=ResizableCapacityLinkedBlockingQueue
|
||||
spring.dynamic.thread-pool.executors[0].execute-time-out=800
|
||||
spring.dynamic.thread-pool.executors[0].rejected-handler=AbortPolicy
|
||||
spring.dynamic.thread-pool.executors[0].keep-alive-time=6691
|
||||
spring.dynamic.thread-pool.executors[0].allow-core-thread-time-out=true
|
||||
spring.dynamic.thread-pool.executors[0].alarm=true
|
||||
spring.dynamic.thread-pool.executors[0].active-alarm=80
|
||||
spring.dynamic.thread-pool.executors[0].capacity-alarm=80
|
||||
spring.dynamic.thread-pool.executors[0].notify.interval=8
|
||||
spring.dynamic.thread-pool.executors[0].notify.receives=chen.ma
|
||||
spring.dynamic.thread-pool.executors[1].thread-pool-id=message-produce
|
||||
spring.dynamic.thread-pool.executors[1].thread-name-prefix=message-produce
|
||||
spring.dynamic.thread-pool.executors[1].core-pool-size=2
|
||||
spring.dynamic.thread-pool.executors[1].maximum-pool-size=4
|
||||
spring.dynamic.thread-pool.executors[1].queue-capacity=1024
|
||||
spring.dynamic.thread-pool.executors[1].blocking-queue=ResizableCapacityLinkedBlockingQueue
|
||||
spring.dynamic.thread-pool.executors[1].execute-time-out=800
|
||||
spring.dynamic.thread-pool.executors[1].rejected-handler=AbortPolicy
|
||||
spring.dynamic.thread-pool.executors[1].keep-alive-time=6691
|
||||
spring.dynamic.thread-pool.executors[1].allow-core-thread-time-out=true
|
||||
spring.dynamic.thread-pool.executors[1].alarm=true
|
||||
spring.dynamic.thread-pool.executors[1].active-alarm=80
|
||||
spring.dynamic.thread-pool.executors[1].capacity-alarm=80
|
||||
spring.dynamic.thread-pool.executors[1].notify.interval=8
|
||||
spring.dynamic.thread-pool.executors[1].notify.receives=chen.ma
|
@ -0,0 +1,66 @@
|
||||
#debug=true
|
||||
server.port=8089
|
||||
server.servlet.context-path=/example
|
||||
|
||||
management.security.enabled=false
|
||||
management.context-path=/actuator
|
||||
|
||||
spring.profiles.active=dev
|
||||
spring.application.name=hippo4j-config-nacos-spring-boot-1x-starter-example
|
||||
|
||||
## nacos spring-boot
|
||||
nacos.config.server-addr=127.0.0.1:8848
|
||||
nacos.config.ext-config[0].data-id=hippo4j-nacos.yaml
|
||||
nacos.config.ext-config[0].group=DEFAULT_GROUP
|
||||
nacos.config.ext-config[0].auto-refresh=true
|
||||
|
||||
spring.dynamic.thread-pool.enable=true
|
||||
spring.dynamic.thread-pool.banner=true
|
||||
spring.dynamic.thread-pool.check-state-interval=5
|
||||
spring.dynamic.thread-pool.monitor.enable=true
|
||||
spring.dynamic.thread-pool.monitor.collect-types=micrometer
|
||||
spring.dynamic.thread-pool.monitor.thread-pool-types=dynamic,web
|
||||
spring.dynamic.thread-pool.monitor.initial-delay=10000
|
||||
spring.dynamic.thread-pool.monitor.collect-interval=5000
|
||||
|
||||
spring.dynamic.thread-pool.notify-platforms[0].platform=WECHAT
|
||||
spring.dynamic.thread-pool.notify-platforms[0].token=ac0426a5-c712-474c-9bff-72b8b8f5caff
|
||||
spring.dynamic.thread-pool.notify-platforms[1].platform=DING
|
||||
spring.dynamic.thread-pool.notify-platforms[1].token=56417ebba6a27ca352f0de77a2ae9da66d01f39610b5ee8a6033c60ef9071c55
|
||||
spring.dynamic.thread-pool.notify-platforms[2].platform=LARK
|
||||
spring.dynamic.thread-pool.notify-platforms[2].token=2cbf2808-3839-4c26-a04d-fd201dd51f9e
|
||||
|
||||
spring.dynamic.thread-pool.nacos.data-id=hippo4j-nacos.yaml
|
||||
spring.dynamic.thread-pool.nacos.group=DEFAULT_GROUP
|
||||
spring.dynamic.thread-pool.config-file-type=yaml
|
||||
|
||||
spring.dynamic.thread-pool.executors[0].thread-pool-id=message-consume
|
||||
spring.dynamic.thread-pool.executors[0].thread-name-prefix=message-consume
|
||||
spring.dynamic.thread-pool.executors[0].core-pool-size=2
|
||||
spring.dynamic.thread-pool.executors[0].maximum-pool-size=4
|
||||
spring.dynamic.thread-pool.executors[0].queue-capacity=1024
|
||||
spring.dynamic.thread-pool.executors[0].blocking-queue=ResizableCapacityLinkedBlockingQueue
|
||||
spring.dynamic.thread-pool.executors[0].execute-time-out=800
|
||||
spring.dynamic.thread-pool.executors[0].rejected-handler=AbortPolicy
|
||||
spring.dynamic.thread-pool.executors[0].keep-alive-time=6691
|
||||
spring.dynamic.thread-pool.executors[0].allow-core-thread-time-out=true
|
||||
spring.dynamic.thread-pool.executors[0].alarm=true
|
||||
spring.dynamic.thread-pool.executors[0].active-alarm=80
|
||||
spring.dynamic.thread-pool.executors[0].capacity-alarm=80
|
||||
spring.dynamic.thread-pool.executors[0].notify.interval=8
|
||||
spring.dynamic.thread-pool.executors[0].notify.receives=chen.ma
|
||||
spring.dynamic.thread-pool.executors[1].thread-pool-id=message-produce
|
||||
spring.dynamic.thread-pool.executors[1].thread-name-prefix=message-produce
|
||||
spring.dynamic.thread-pool.executors[1].core-pool-size=2
|
||||
spring.dynamic.thread-pool.executors[1].maximum-pool-size=4
|
||||
spring.dynamic.thread-pool.executors[1].queue-capacity=1024
|
||||
spring.dynamic.thread-pool.executors[1].blocking-queue=ResizableCapacityLinkedBlockingQueue
|
||||
spring.dynamic.thread-pool.executors[1].execute-time-out=800
|
||||
spring.dynamic.thread-pool.executors[1].rejected-handler=AbortPolicy
|
||||
spring.dynamic.thread-pool.executors[1].keep-alive-time=6691
|
||||
spring.dynamic.thread-pool.executors[1].allow-core-thread-time-out=true
|
||||
spring.dynamic.thread-pool.executors[1].alarm=true
|
||||
spring.dynamic.thread-pool.executors[1].active-alarm=80
|
||||
spring.dynamic.thread-pool.executors[1].capacity-alarm=80
|
||||
spring.dynamic.thread-pool.executors[1].notify.interval=8
|
||||
spring.dynamic.thread-pool.executors[1].notify.receives=chen.ma
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
.social-signup-container[data-v-7309fbbb]{margin:20px 0}.social-signup-container .sign-btn[data-v-7309fbbb]{display:inline-block;cursor:pointer}.social-signup-container .icon[data-v-7309fbbb]{color:#fff;font-size:24px;margin-top:8px}.social-signup-container .qq-svg-container[data-v-7309fbbb],.social-signup-container .wx-svg-container[data-v-7309fbbb]{display:inline-block;width:40px;height:40px;line-height:40px;text-align:center;padding-top:1px;border-radius:4px;margin-bottom:20px;margin-right:5px}.social-signup-container .wx-svg-container[data-v-7309fbbb]{background-color:#24da70}.social-signup-container .qq-svg-container[data-v-7309fbbb]{background-color:#6ba2d6;margin-left:50px}@supports(-webkit-mask:none) and (not (cater-color:#fff)){.login-container .el-input input{color:#fff}}.login-container .el-input{display:inline-block;height:47px;width:85%}.login-container .el-input input{background:transparent;border:0;-webkit-appearance:none;border-radius:0;padding:12px 5px 12px 15px;color:#fff;height:47px;caret-color:#fff}.login-container .el-input input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #283443 inset!important;box-shadow:inset 0 0 0 1000px #283443!important;-webkit-text-fill-color:#fff!important}.login-container .el-form-item{border:1px solid hsla(0,0%,100%,.1);background:rgba(0,0,0,.1);border-radius:5px;color:#454545}.login-container[data-v-13dcd441]{min-height:100%;width:100%;background-color:#2d3a4b;overflow:hidden}.login-container .login-form[data-v-13dcd441]{position:relative;width:520px;max-width:100%;padding:160px 35px 0;margin:0 auto;overflow:hidden}.login-container .tips[data-v-13dcd441]{font-size:14px;color:#fff;margin-bottom:10px}.login-container .tips span[data-v-13dcd441]:first-of-type{margin-right:16px}.login-container .svg-container[data-v-13dcd441]{padding:6px 5px 6px 15px;color:#889aa4;vertical-align:middle;width:30px;display:inline-block}.login-container .title-container[data-v-13dcd441]{position:relative}.login-container .title-container .title[data-v-13dcd441]{font-size:26px;color:#eee;margin:0 auto 40px auto;text-align:center;font-weight:700}.login-container .show-pwd[data-v-13dcd441]{position:absolute;right:10px;top:7px;font-size:16px;color:#889aa4;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.login-container .thirdparty-button[data-v-13dcd441]{position:absolute;right:0;bottom:6px}@media only screen and (max-width:470px){.login-container .thirdparty-button[data-v-13dcd441]{display:none}}
|
||||
.social-signup-container[data-v-7309fbbb]{margin:20px 0}.social-signup-container .sign-btn[data-v-7309fbbb]{display:inline-block;cursor:pointer}.social-signup-container .icon[data-v-7309fbbb]{color:#fff;font-size:24px;margin-top:8px}.social-signup-container .qq-svg-container[data-v-7309fbbb],.social-signup-container .wx-svg-container[data-v-7309fbbb]{display:inline-block;width:40px;height:40px;line-height:40px;text-align:center;padding-top:1px;border-radius:4px;margin-bottom:20px;margin-right:5px}.social-signup-container .wx-svg-container[data-v-7309fbbb]{background-color:#24da70}.social-signup-container .qq-svg-container[data-v-7309fbbb]{background-color:#6ba2d6;margin-left:50px}@supports(-webkit-mask:none) and (not (cater-color:#fff)){.login-container .el-input input{color:#fff}}.login-container .el-input{display:inline-block;height:47px;width:85%}.login-container .el-input input{background:transparent;border:0;-webkit-appearance:none;border-radius:0;padding:12px 5px 12px 15px;color:#fff;height:47px;caret-color:#fff}.login-container .el-input input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #283443 inset!important;box-shadow:inset 0 0 0 1000px #283443!important;-webkit-text-fill-color:#fff!important}.login-container .el-form-item{border:1px solid hsla(0,0%,100%,.1);background:rgba(0,0,0,.1);border-radius:5px;color:#454545}.login-container[data-v-7cb824ba]{min-height:100%;width:100%;background-color:#2d3a4b;overflow:hidden}.login-container .login-form[data-v-7cb824ba]{position:relative;width:520px;max-width:100%;padding:160px 35px 0;margin:0 auto;overflow:hidden}.login-container .tips[data-v-7cb824ba]{font-size:14px;color:#fff;margin-bottom:10px}.login-container .tips span[data-v-7cb824ba]:first-of-type{margin-right:16px}.login-container .svg-container[data-v-7cb824ba]{padding:6px 5px 6px 15px;color:#889aa4;vertical-align:middle;width:30px;display:inline-block}.login-container .title-container[data-v-7cb824ba]{position:relative}.login-container .title-container .title[data-v-7cb824ba]{font-size:26px;color:#eee;margin:0 auto 40px auto;text-align:center;font-weight:700}.login-container .show-pwd[data-v-7cb824ba]{position:absolute;right:10px;top:7px;font-size:16px;color:#889aa4;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.login-container .thirdparty-button[data-v-7cb824ba]{position:absolute;right:0;bottom:6px}@media only screen and (max-width:470px){.login-container .thirdparty-button[data-v-7cb824ba]{display:none}}
|
@ -1 +0,0 @@
|
||||
.github-corner:hover .octo-arm[data-v-fedac698]{-webkit-animation:octocat-wave-data-v-fedac698 .56s ease-in-out;animation:octocat-wave-data-v-fedac698 .56s ease-in-out}@-webkit-keyframes octocat-wave-data-v-fedac698{0%,to{-webkit-transform:rotate(0);transform:rotate(0)}20%,60%{-webkit-transform:rotate(-25deg);transform:rotate(-25deg)}40%,80%{-webkit-transform:rotate(10deg);transform:rotate(10deg)}}@keyframes octocat-wave-data-v-fedac698{0%,to{-webkit-transform:rotate(0);transform:rotate(0)}20%,60%{-webkit-transform:rotate(-25deg);transform:rotate(-25deg)}40%,80%{-webkit-transform:rotate(10deg);transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm[data-v-fedac698]{-webkit-animation:none;animation:none}.github-corner .octo-arm[data-v-fedac698]{-webkit-animation:octocat-wave-data-v-fedac698 .56s ease-in-out;animation:octocat-wave-data-v-fedac698 .56s ease-in-out}}.panel-group[data-v-787f9ab2]{margin-top:18px}.panel-group .card-panel-col[data-v-787f9ab2]{margin-bottom:32px}.panel-group .card-panel[data-v-787f9ab2]{height:108px;cursor:pointer;font-size:12px;position:relative;overflow:hidden;color:#666;background:#fff;-webkit-box-shadow:4px 4px 40px rgba(0,0,0,.05);box-shadow:4px 4px 40px rgba(0,0,0,.05);border-color:rgba(0,0,0,.05)}.panel-group .card-panel:hover .card-panel-icon-wrapper[data-v-787f9ab2]{color:#fff}.panel-group .card-panel:hover .icon-people[data-v-787f9ab2]{background:#dae8d6}.panel-group .card-panel:hover .icon-message[data-v-787f9ab2]{background:#36a3f7}.panel-group .card-panel:hover .icon-money[data-v-787f9ab2]{background:#a0a6f4}.panel-group .card-panel:hover .icon-shopping[data-v-787f9ab2]{background:#dae8d6}.panel-group .card-panel .icon-people[data-v-787f9ab2]{color:#40c9c6}.panel-group .card-panel .icon-message[data-v-787f9ab2]{color:#36a3f7}.panel-group .card-panel .icon-money[data-v-787f9ab2]{color:#a0a6f4}.panel-group .card-panel .icon-shopping[data-v-787f9ab2]{color:#34bfa3}.panel-group .card-panel .card-panel-icon-wrapper[data-v-787f9ab2]{float:left;margin:14px 0 0 14px;padding:16px;-webkit-transition:all .38s ease-out;transition:all .38s ease-out;border-radius:6px}.panel-group .card-panel .card-panel-icon[data-v-787f9ab2]{float:left;font-size:48px}.panel-group .card-panel .card-panel-description[data-v-787f9ab2]{float:right;font-weight:700;margin:26px;margin-left:0}.panel-group .card-panel .card-panel-description .card-panel-text[data-v-787f9ab2]{line-height:18px;color:rgba(0,0,0,.45);font-size:16px;margin-bottom:12px}.panel-group .card-panel .card-panel-description .card-panel-num[data-v-787f9ab2]{font-size:20px}@media(max-width:550px){.card-panel-description[data-v-787f9ab2]{display:none}.card-panel-icon-wrapper[data-v-787f9ab2]{float:none!important;width:100%;height:100%;margin:0!important}.card-panel-icon-wrapper .svg-icon[data-v-787f9ab2]{display:block;margin:14px auto!important;float:none!important}}.dashboard-editor-container[data-v-73ee0239]{padding:32px;background-color:#f0f2f5;position:relative}.dashboard-editor-container .github-corner[data-v-73ee0239]{position:absolute;top:0;border:0;right:0}.dashboard-editor-container .el-form-item[data-v-73ee0239]{margin-bottom:5px!important;padding-bottom:20px}.dashboard-editor-container .chart-wrapper[data-v-73ee0239]{background:#fff;padding:16px 16px 0;margin-bottom:32px}@media(max-width:1024px){.chart-wrapper[data-v-73ee0239]{padding:8px}}
|
@ -0,0 +1 @@
|
||||
.github-corner:hover .octo-arm[data-v-fedac698]{-webkit-animation:octocat-wave-data-v-fedac698 .56s ease-in-out;animation:octocat-wave-data-v-fedac698 .56s ease-in-out}@-webkit-keyframes octocat-wave-data-v-fedac698{0%,to{-webkit-transform:rotate(0);transform:rotate(0)}20%,60%{-webkit-transform:rotate(-25deg);transform:rotate(-25deg)}40%,80%{-webkit-transform:rotate(10deg);transform:rotate(10deg)}}@keyframes octocat-wave-data-v-fedac698{0%,to{-webkit-transform:rotate(0);transform:rotate(0)}20%,60%{-webkit-transform:rotate(-25deg);transform:rotate(-25deg)}40%,80%{-webkit-transform:rotate(10deg);transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm[data-v-fedac698]{-webkit-animation:none;animation:none}.github-corner .octo-arm[data-v-fedac698]{-webkit-animation:octocat-wave-data-v-fedac698 .56s ease-in-out;animation:octocat-wave-data-v-fedac698 .56s ease-in-out}}.panel-group[data-v-78d00531]{margin-top:18px}.panel-group .card-panel-col[data-v-78d00531]{margin-bottom:32px}.panel-group .card-panel[data-v-78d00531]{height:108px;cursor:pointer;font-size:12px;position:relative;overflow:hidden;color:#666;background:#fff;-webkit-box-shadow:4px 4px 40px rgba(0,0,0,.05);box-shadow:4px 4px 40px rgba(0,0,0,.05);border-color:rgba(0,0,0,.05)}.panel-group .card-panel:hover .card-panel-icon-wrapper[data-v-78d00531]{color:#fff}.panel-group .card-panel:hover .icon-people[data-v-78d00531]{background:#dae8d6}.panel-group .card-panel:hover .icon-message[data-v-78d00531]{background:#36a3f7}.panel-group .card-panel:hover .icon-money[data-v-78d00531]{background:#a0a6f4}.panel-group .card-panel:hover .icon-shopping[data-v-78d00531]{background:#dae8d6}.panel-group .card-panel .icon-people[data-v-78d00531]{color:#40c9c6}.panel-group .card-panel .icon-message[data-v-78d00531]{color:#36a3f7}.panel-group .card-panel .icon-money[data-v-78d00531]{color:#a0a6f4}.panel-group .card-panel .icon-shopping[data-v-78d00531]{color:#34bfa3}.panel-group .card-panel .card-panel-icon-wrapper[data-v-78d00531]{float:left;margin:14px 0 0 14px;padding:16px;-webkit-transition:all .38s ease-out;transition:all .38s ease-out;border-radius:6px}.panel-group .card-panel .card-panel-icon[data-v-78d00531]{float:left;font-size:48px}.panel-group .card-panel .card-panel-description[data-v-78d00531]{float:right;font-weight:700;margin:26px;margin-left:0}.panel-group .card-panel .card-panel-description .card-panel-text[data-v-78d00531]{line-height:18px;color:rgba(0,0,0,.45);font-size:16px;margin-bottom:12px}.panel-group .card-panel .card-panel-description .card-panel-num[data-v-78d00531]{font-size:20px}@media(max-width:550px){.card-panel-description[data-v-78d00531]{display:none}.card-panel-icon-wrapper[data-v-78d00531]{float:none!important;width:100%;height:100%;margin:0!important}.card-panel-icon-wrapper .svg-icon[data-v-78d00531]{display:block;margin:14px auto!important;float:none!important}}.dashboard-editor-container[data-v-6e862226]{padding:32px;background-color:#f0f2f5;position:relative}.dashboard-editor-container .github-corner[data-v-6e862226]{position:absolute;top:0;border:0;right:0}.dashboard-editor-container .el-form-item[data-v-6e862226]{margin-bottom:5px!important;padding-bottom:20px}.dashboard-editor-container .chart-wrapper[data-v-6e862226]{background:#fff;padding:16px 16px 0;margin-bottom:32px}@media(max-width:1024px){.chart-wrapper[data-v-6e862226]{padding:8px}}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-04a4268a"],{"386d":function(n,t,e){"use strict";var r=e("cb7c"),a=e("83a1"),i=e("5f1b");e("214f")("search",1,(function(n,t,e,o){return[function(e){var r=n(this),a=void 0==e?void 0:e[t];return void 0!==a?a.call(e,r):new RegExp(e)[t](String(r))},function(n){var t=o(e,n,this);if(t.done)return t.value;var c=r(n),u=String(this),d=c.lastIndex;a(d,0)||(c.lastIndex=0);var l=i(c,u);return a(c.lastIndex,d)||(c.lastIndex=d),null===l?-1:l.index}]}))},"83a1":function(n,t){n.exports=Object.is||function(n,t){return n===t?0!==n||1/n===1/t:n!=n&&t!=t}},b829:function(n,t,e){"use strict";e.r(t);e("386d");var r,a,i={name:"AuthRedirect",created:function(){var n=window.location.search.slice(1);window.localStorage&&(window.localStorage.setItem("x-admin-oauth-code",n),window.close())},render:function(n){return n()}},o=i,c=e("2877"),u=Object(c["a"])(o,r,a,!1,null,null,null);t["default"]=u.exports}}]);
|
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
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 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d230a36"],{ecac:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[e.user?a("div",[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6,xs:24}},[a("user-card",{attrs:{user:e.user}})],1),e._v(" "),a("el-col",{attrs:{span:18,xs:24}},[a("el-card",[a("el-tabs",{model:{value:e.activeTab,callback:function(t){e.activeTab=t},expression:"activeTab"}},[a("el-tab-pane",{attrs:{label:"Account",name:"account"}},[a("account",{attrs:{user:e.user}})],1)],1)],1)],1)],1)],1):e._e()])},n=[],r=(a("7f7f"),a("db72")),l=a("2f62"),c=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-form",[a("el-form-item",{attrs:{label:"Name"}},[a("el-input",{model:{value:e.user.name,callback:function(t){e.$set(e.user,"name","string"===typeof t?t.trim():t)},expression:"user.name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"Email"}},[a("el-input",{model:{value:e.user.email,callback:function(t){e.$set(e.user,"email","string"===typeof t?t.trim():t)},expression:"user.email"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.submit}},[e._v("Update")])],1)],1)},i=[],u={props:{user:{type:Object,default:function(){return{name:"",email:""}}}},methods:{submit:function(){this.$message({message:"User information has been updated successfully",type:"success",duration:5e3})}}},o=u,m=a("2877"),p=Object(m["a"])(o,c,i,!1,null,null,null),f=p.exports,b={name:"Profile",components:{Account:f},data:function(){return{user:{},activeTab:"activity"}},computed:Object(r["a"])({},Object(l["b"])(["name","avatar","roles"])),created:function(){this.getUser()},methods:{getUser:function(){this.user={name:this.name,role:this.roles.join(" | "),email:"admin@test.com",avatar:this.avatar}}}},d=b,v=Object(m["a"])(d,s,n,!1,null,null,null);t["default"]=v.exports}}]);
|
@ -0,0 +1 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d230a36"],{ecac:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[e.user?a("div",[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6,xs:24}},[a("user-card",{attrs:{user:e.user}})],1),e._v(" "),a("el-col",{attrs:{span:18,xs:24}},[a("el-card",[a("el-tabs",{model:{value:e.activeTab,callback:function(t){e.activeTab=t},expression:"activeTab"}},[a("el-tab-pane",{attrs:{label:"Account",name:"account"}},[a("account",{attrs:{user:e.user}})],1)],1)],1)],1)],1)],1):e._e()])},n=[],r=a("5530"),l=(a("b0c0"),a("a15b"),a("2f62")),c=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-form",[a("el-form-item",{attrs:{label:"Name"}},[a("el-input",{model:{value:e.user.name,callback:function(t){e.$set(e.user,"name","string"===typeof t?t.trim():t)},expression:"user.name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"Email"}},[a("el-input",{model:{value:e.user.email,callback:function(t){e.$set(e.user,"email","string"===typeof t?t.trim():t)},expression:"user.email"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.submit}},[e._v("Update")])],1)],1)},i=[],u={props:{user:{type:Object,default:function(){return{name:"",email:""}}}},methods:{submit:function(){this.$message({message:"User information has been updated successfully",type:"success",duration:5e3})}}},o=u,m=a("2877"),p=Object(m["a"])(o,c,i,!1,null,null,null),b=p.exports,f={name:"Profile",components:{Account:b},data:function(){return{user:{},activeTab:"activity"}},computed:Object(r["a"])({},Object(l["b"])(["name","avatar","roles"])),created:function(){this.getUser()},methods:{getUser:function(){this.user={name:this.name,role:this.roles.join(" | "),email:"admin@test.com",avatar:this.avatar}}}},d=f,v=Object(m["a"])(d,s,n,!1,null,null,null);t["default"]=v.exports}}]);
|
@ -1 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d230fe7"],{ef3c:function(e,r,n){"use strict";n.r(r);n("a481");var t,u,a={created:function(){var e=this.$route,r=e.params,n=e.query,t=r.path;this.$router.replace({path:"/"+t,query:n})},render:function(e){return e()}},c=a,o=n("2877"),p=Object(o["a"])(c,t,u,!1,null,null,null);r["default"]=p.exports}}]);
|
@ -0,0 +1 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d230fe7"],{ef3c:function(e,r,n){"use strict";n.r(r);n("ac1f"),n("5319");var t,u,a={created:function(){var e=this.$route,r=e.params,n=e.query,t=r.path;this.$router.replace({path:"/"+t,query:n})},render:function(e){return e()}},c=a,o=n("2877"),p=Object(o["a"])(c,t,u,!1,null,null,null);r["default"]=p.exports}}]);
|
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
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
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
@ -0,0 +1 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-9472305a"],{"129f":function(n,e){n.exports=Object.is||function(n,e){return n===e?0!==n||1/n===1/e:n!=n&&e!=e}},"841c":function(n,e,t){"use strict";var a=t("c65b"),c=t("d784"),r=t("825a"),o=t("7234"),i=t("1d80"),u=t("129f"),d=t("577e"),l=t("dc4a"),s=t("14c3");c("search",(function(n,e,t){return[function(e){var t=i(this),c=o(e)?void 0:l(e,n);return c?a(c,e,t):new RegExp(e)[n](d(t))},function(n){var a=r(this),c=d(n),o=t(e,a,c);if(o.done)return o.value;var i=a.lastIndex;u(i,0)||(a.lastIndex=0);var l=s(a,c);return u(a.lastIndex,i)||(a.lastIndex=i),null===l?-1:l.index}]}))},b829:function(n,e,t){"use strict";t.r(e);t("fb6a"),t("ac1f"),t("841c");var a,c,r={name:"AuthRedirect",created:function(){var n=window.location.search.slice(1);window.localStorage&&(window.localStorage.setItem("x-admin-oauth-code",n),window.close())},render:function(n){return n()}},o=r,i=t("2877"),u=Object(i["a"])(o,a,c,!1,null,null,null);e["default"]=u.exports}}]);
|
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 +1 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ef888edc"],{"24e2":function(t,a,i){"use strict";i.r(a);var e=function(){var t=this,a=t.$createElement,i=t._self._c||a;return i("div",{staticClass:"errPage-container"},[i("el-button",{staticClass:"pan-back-btn",attrs:{icon:"arrow-left"},on:{click:t.back}},[t._v("\n 返回\n ")]),t._v(" "),i("el-row",[i("el-col",{attrs:{span:12}},[i("h1",{staticClass:"text-jumbo text-ginormous"},[t._v("\n Oops!\n ")]),t._v("\n gif来源"),i("a",{attrs:{href:"https://zh.airbnb.com/",target:"_blank"}},[t._v("airbnb")]),t._v(" 页面\n "),i("h2",[t._v("你没有权限去该页面")]),t._v(" "),i("h6",[t._v("如有不满请联系你领导")]),t._v(" "),i("ul",{staticClass:"list-unstyled"},[i("li",[t._v("或者你可以去:")]),t._v(" "),i("li",{staticClass:"link-type"},[i("router-link",{attrs:{to:"/dashboard"}},[t._v("\n 回首页\n ")])],1),t._v(" "),i("li",{staticClass:"link-type"},[i("a",{attrs:{href:"https://www.taobao.com/"}},[t._v("随便看看")])]),t._v(" "),i("li",[i("a",{attrs:{href:"#"},on:{click:function(a){a.preventDefault(),t.dialogVisible=!0}}},[t._v("点我看图")])])])]),t._v(" "),i("el-col",{attrs:{span:12}},[i("img",{attrs:{src:t.errGif,width:"313",height:"428",alt:"Girl has dropped her ice cream."}})])],1),t._v(" "),i("el-dialog",{attrs:{visible:t.dialogVisible,title:"随便看"},on:{"update:visible":function(a){t.dialogVisible=a}}},[i("img",{staticClass:"pan-img",attrs:{src:t.ewizardClap}})])],1)},s=[],n=i("cc6c"),r=i.n(n),l={name:"Page401",data:function(){return{errGif:r.a+"?"+ +new Date,ewizardClap:"https://wpimg.wallstcn.com/007ef517-bafd-4066-aae4-6883632d9646",dialogVisible:!1}},methods:{back:function(){this.$route.query.noGoBack?this.$router.push({path:"/dashboard"}):this.$router.go(-1)}}},c=l,o=(i("6f5a"),i("2877")),u=Object(o["a"])(c,e,s,!1,null,"6fb1594e",null);a["default"]=u.exports},"6f5a":function(t,a,i){"use strict";i("a68a")},a68a:function(t,a,i){},cc6c:function(t,a,i){t.exports=i.p+"static/img/401.089007e7.gif"}}]);
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ef888edc"],{"24e2":function(t,a,i){"use strict";i.r(a);var e=function(){var t=this,a=t.$createElement,i=t._self._c||a;return i("div",{staticClass:"errPage-container"},[i("el-button",{staticClass:"pan-back-btn",attrs:{icon:"arrow-left"},on:{click:t.back}},[t._v("\n 返回\n ")]),t._v(" "),i("el-row",[i("el-col",{attrs:{span:12}},[i("h1",{staticClass:"text-jumbo text-ginormous"},[t._v("\n Oops!\n ")]),t._v("\n gif来源"),i("a",{attrs:{href:"https://zh.airbnb.com/",target:"_blank"}},[t._v("airbnb")]),t._v(" 页面\n "),i("h2",[t._v("你没有权限去该页面")]),t._v(" "),i("h6",[t._v("如有不满请联系你领导")]),t._v(" "),i("ul",{staticClass:"list-unstyled"},[i("li",[t._v("或者你可以去:")]),t._v(" "),i("li",{staticClass:"link-type"},[i("router-link",{attrs:{to:"/dashboard"}},[t._v("\n 回首页\n ")])],1),t._v(" "),i("li",{staticClass:"link-type"},[i("a",{attrs:{href:"https://www.taobao.com/"}},[t._v("随便看看")])]),t._v(" "),i("li",[i("a",{attrs:{href:"#"},on:{click:function(a){a.preventDefault(),t.dialogVisible=!0}}},[t._v("点我看图")])])])]),t._v(" "),i("el-col",{attrs:{span:12}},[i("img",{attrs:{src:t.errGif,width:"313",height:"428",alt:"Girl has dropped her ice cream."}})])],1),t._v(" "),i("el-dialog",{attrs:{visible:t.dialogVisible,title:"随便看"},on:{"update:visible":function(a){t.dialogVisible=a}}},[i("img",{staticClass:"pan-img",attrs:{src:t.ewizardClap}})])],1)},s=[],n=(i("14d9"),i("cc6c")),r=i.n(n),l={name:"Page401",data:function(){return{errGif:r.a+"?"+ +new Date,ewizardClap:"https://wpimg.wallstcn.com/007ef517-bafd-4066-aae4-6883632d9646",dialogVisible:!1}},methods:{back:function(){this.$route.query.noGoBack?this.$router.push({path:"/dashboard"}):this.$router.go(-1)}}},c=l,o=(i("6f5a"),i("2877")),u=Object(o["a"])(c,e,s,!1,null,"6fb1594e",null);a["default"]=u.exports},"6f5a":function(t,a,i){"use strict";i("a68a")},a68a:function(t,a,i){},cc6c:function(t,a,i){t.exports=i.p+"static/img/401.089007e7.gif"}}]);
|
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
@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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 cn.hippo4j.config.springboot.starter.refresher;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.boot.env.OriginTrackedMapPropertySource;
|
||||
import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext;
|
||||
import org.springframework.cloud.bootstrap.config.BootstrapPropertySource;
|
||||
import org.springframework.cloud.consul.config.ConsulPropertySource;
|
||||
import org.springframework.cloud.context.environment.EnvironmentChangeEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.core.env.AbstractEnvironment;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Consul refresher handler.
|
||||
*/
|
||||
@Slf4j
|
||||
public class ConsulRefresherHandler extends AbstractConfigThreadPoolDynamicRefresh {
|
||||
|
||||
@EventListener(EnvironmentChangeEvent.class)
|
||||
public void refreshed(EnvironmentChangeEvent event) {
|
||||
Map<String, Object> configInfo = extractLatestConfigInfo(event);
|
||||
dynamicRefresh(StringUtils.EMPTY, configInfo);
|
||||
}
|
||||
|
||||
private Map<String, Object> extractLatestConfigInfo(EnvironmentChangeEvent event) {
|
||||
AbstractEnvironment environment = (AbstractEnvironment) ((AnnotationConfigServletWebServerApplicationContext) event.getSource()).getEnvironment();
|
||||
String activeProfile = Optional.ofNullable(environment.getActiveProfiles().length > 0 ? environment.getActiveProfiles()[0] : null)
|
||||
.orElseGet(() -> String.valueOf(getApplicationConfigDefaultContext(environment)));
|
||||
List<BootstrapPropertySource<?>> bootstrapPropertySourceList = environment.getPropertySources().stream()
|
||||
.filter(propertySource -> propertySource instanceof BootstrapPropertySource)
|
||||
.map(propertySource -> (BootstrapPropertySource<?>) propertySource).collect(Collectors.toList());
|
||||
Optional<BootstrapPropertySource<?>> bootstrapPropertySource = bootstrapPropertySourceList.stream()
|
||||
.filter(source -> source.getName().contains(activeProfile) && source.getPropertyNames().length != 0).findFirst();
|
||||
Map<String, Object> configInfo = new HashMap<>(64);
|
||||
if (bootstrapPropertySource.isPresent()) {
|
||||
ConsulPropertySource consulPropertySource = (ConsulPropertySource) bootstrapPropertySource.get().getDelegate();
|
||||
String[] propertyNames = consulPropertySource.getPropertyNames();
|
||||
for (String propertyName : propertyNames) {
|
||||
configInfo.put(propertyName, consulPropertySource.getProperty(propertyName));
|
||||
}
|
||||
}
|
||||
return configInfo;
|
||||
}
|
||||
|
||||
private CharSequence getApplicationConfigDefaultContext(AbstractEnvironment environment) {
|
||||
return environment.getPropertySources().stream()
|
||||
.filter(propertySource -> propertySource instanceof OriginTrackedMapPropertySource)
|
||||
.map(propertySource -> ((Map<String, CharSequence>) propertySource.getSource()).get("spring.cloud.consul.config.default-context"))
|
||||
.findFirst().orElse(StringUtils.EMPTY);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initRegisterListener() {
|
||||
// The listener has been registered by annotation.
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue