forked from chillzhuang/blade-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎉 3.0.0.RELEASE 架构升级适配 SpringCloud 2020
- Loading branch information
smallchill
committed
Jan 6, 2021
1 parent
231fbd6
commit 17d8fce
Showing
79 changed files
with
797 additions
and
786 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
blade-core-cloud/src/main/java/org/springblade/core/cloud/client/BladeCloudApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 ([email protected]). | ||
* <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.core.cloud.client; | ||
|
||
import org.springblade.core.launch.constant.AppConstant; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; | ||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; | ||
import org.springframework.cloud.netflix.ribbon.RibbonAutoConfiguration; | ||
import org.springframework.cloud.openfeign.EnableFeignClients; | ||
|
||
import java.lang.annotation.*; | ||
|
||
/** | ||
* Cloud启动注解配置 | ||
* | ||
* @author Chill | ||
*/ | ||
@Target(ElementType.TYPE) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
@Inherited | ||
@EnableDiscoveryClient | ||
@EnableCircuitBreaker | ||
@EnableFeignClients(AppConstant.BASE_PACKAGES) | ||
@SpringBootApplication(exclude = RibbonAutoConfiguration.class) | ||
public @interface BladeCloudApplication { | ||
|
||
} |
54 changes: 54 additions & 0 deletions
54
...re-cloud/src/main/java/org/springblade/core/cloud/config/BladeCloudAutoConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 ([email protected]). | ||
* <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.core.cloud.config; | ||
|
||
import com.alibaba.cloud.sentinel.feign.SentinelFeignAutoConfiguration; | ||
import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.BlockExceptionHandler; | ||
import feign.Feign; | ||
import org.springblade.core.cloud.feign.BladeFeignSentinel; | ||
import org.springblade.core.cloud.sentinel.BladeBlockExceptionHandler; | ||
import org.springframework.boot.autoconfigure.AutoConfigureBefore; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Scope; | ||
|
||
|
||
/** | ||
* blade cloud 增强配置 | ||
* | ||
* @author Chill | ||
*/ | ||
@Configuration(proxyBeanMethods = false) | ||
@AutoConfigureBefore(SentinelFeignAutoConfiguration.class) | ||
public class BladeCloudAutoConfiguration { | ||
|
||
@Bean | ||
@Scope("prototype") | ||
@ConditionalOnMissingBean | ||
@ConditionalOnProperty(name = "feign.sentinel.enabled") | ||
public Feign.Builder feignSentinelBuilder() { | ||
return BladeFeignSentinel.builder(); | ||
} | ||
|
||
@Bean | ||
@ConditionalOnMissingBean | ||
public BlockExceptionHandler blockExceptionHandler() { | ||
return new BladeBlockExceptionHandler(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 0 additions & 96 deletions
96
...ore-cloud/src/main/java/org/springblade/core/cloud/feign/BladeFeignAutoConfiguration.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.