Commit 0c706928 by Nepxion

重构类结构

parent 5ddf333a
......@@ -10,10 +10,10 @@ package com.nepxion.discovery.plugin.strategy.extension.gateway.adapter;
*/
import com.nepxion.discovery.common.constant.DiscoveryConstant;
import com.nepxion.discovery.plugin.strategy.adapter.AbstractVersionDiscoveryEnabledAdapter;
import com.nepxion.discovery.plugin.strategy.adapter.AbstractDiscoveryEnabledAdapter;
import com.nepxion.discovery.plugin.strategy.extension.gateway.context.GatewayStrategyContext;
public class VersionDiscoveryEnabledAdapter extends AbstractVersionDiscoveryEnabledAdapter {
public class DefaultDiscoveryEnabledAdapter extends AbstractDiscoveryEnabledAdapter {
@Override
protected String getVersionJson() {
GatewayStrategyContext context = GatewayStrategyContext.getCurrentContext();
......
......@@ -16,7 +16,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.nepxion.discovery.plugin.strategy.constant.StrategyConstant;
import com.nepxion.discovery.plugin.strategy.extension.gateway.adapter.VersionDiscoveryEnabledAdapter;
import com.nepxion.discovery.plugin.strategy.extension.gateway.adapter.DefaultDiscoveryEnabledAdapter;
import com.nepxion.discovery.plugin.strategy.extension.gateway.filter.GatewayStrategyFilter;
@Configuration
......@@ -29,7 +29,7 @@ public class GatewayStrategyAutoConfiguration {
}
@Bean
public VersionDiscoveryEnabledAdapter discoveryEnabledAdapter() {
return new VersionDiscoveryEnabledAdapter();
public DefaultDiscoveryEnabledAdapter discoveryEnabledAdapter() {
return new DefaultDiscoveryEnabledAdapter();
}
}
\ No newline at end of file
......@@ -13,9 +13,9 @@ import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import com.nepxion.discovery.common.constant.DiscoveryConstant;
import com.nepxion.discovery.plugin.strategy.adapter.AbstractVersionDiscoveryEnabledAdapter;
import com.nepxion.discovery.plugin.strategy.adapter.AbstractDiscoveryEnabledAdapter;
public class VersionDiscoveryEnabledAdapter extends AbstractVersionDiscoveryEnabledAdapter {
public class DefaultDiscoveryEnabledAdapter extends AbstractDiscoveryEnabledAdapter {
@Override
protected String getVersionJson() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
......
......@@ -18,7 +18,7 @@ import org.springframework.context.annotation.Configuration;
import com.nepxion.discovery.common.exception.DiscoveryException;
import com.nepxion.discovery.plugin.strategy.constant.StrategyConstant;
import com.nepxion.discovery.plugin.strategy.extension.service.adapter.VersionDiscoveryEnabledAdapter;
import com.nepxion.discovery.plugin.strategy.extension.service.adapter.DefaultDiscoveryEnabledAdapter;
import com.nepxion.discovery.plugin.strategy.extension.service.aop.FeignStrategyInterceptor;
import com.nepxion.discovery.plugin.strategy.extension.service.aop.ServiceStrategyAutoScanProxy;
import com.nepxion.discovery.plugin.strategy.extension.service.aop.ServiceStrategyInterceptor;
......@@ -61,7 +61,7 @@ public class ServiceStrategyAutoConfiguration {
}
@Bean
public VersionDiscoveryEnabledAdapter discoveryEnabledAdapter() {
return new VersionDiscoveryEnabledAdapter();
public DefaultDiscoveryEnabledAdapter discoveryEnabledAdapter() {
return new DefaultDiscoveryEnabledAdapter();
}
}
\ No newline at end of file
......@@ -10,10 +10,10 @@ package com.nepxion.discovery.plugin.strategy.extension.zuul.adapter;
*/
import com.nepxion.discovery.common.constant.DiscoveryConstant;
import com.nepxion.discovery.plugin.strategy.adapter.AbstractVersionDiscoveryEnabledAdapter;
import com.nepxion.discovery.plugin.strategy.adapter.AbstractDiscoveryEnabledAdapter;
import com.netflix.zuul.context.RequestContext;
public class VersionDiscoveryEnabledAdapter extends AbstractVersionDiscoveryEnabledAdapter {
public class DefaultDiscoveryEnabledAdapter extends AbstractDiscoveryEnabledAdapter {
@Override
protected String getVersionJson() {
RequestContext context = RequestContext.getCurrentContext();
......
......@@ -16,14 +16,14 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.nepxion.discovery.plugin.strategy.constant.StrategyConstant;
import com.nepxion.discovery.plugin.strategy.extension.zuul.adapter.VersionDiscoveryEnabledAdapter;
import com.nepxion.discovery.plugin.strategy.extension.zuul.adapter.DefaultDiscoveryEnabledAdapter;
@Configuration
@AutoConfigureBefore(RibbonClientConfiguration.class)
@ConditionalOnProperty(value = StrategyConstant.SPRING_APPLICATION_STRATEGY_CONTROL_ENABLED, matchIfMissing = true)
public class ZuulStrategyAutoConfiguration {
@Bean
public VersionDiscoveryEnabledAdapter discoveryEnabledAdapter() {
return new VersionDiscoveryEnabledAdapter();
public DefaultDiscoveryEnabledAdapter discoveryEnabledAdapter() {
return new DefaultDiscoveryEnabledAdapter();
}
}
\ No newline at end of file
......@@ -18,7 +18,7 @@ import com.nepxion.discovery.common.constant.DiscoveryConstant;
import com.nepxion.discovery.common.util.JsonUtil;
import com.netflix.loadbalancer.Server;
public abstract class AbstractVersionDiscoveryEnabledAdapter implements DiscoveryEnabledAdapter {
public abstract class AbstractDiscoveryEnabledAdapter implements DiscoveryEnabledAdapter {
@Autowired(required = false)
private DiscoveryEnabledStrategy discoveryEnabledStrategy;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment