Commit f0a87ca4 by Nepxion

重构类结构

parent add097a3
...@@ -41,6 +41,10 @@ public class DiscoveryConstant { ...@@ -41,6 +41,10 @@ public class DiscoveryConstant {
public static final String ENCODING_UTF_8 = "UTF-8"; public static final String ENCODING_UTF_8 = "UTF-8";
public static final String SEPARATE = ";"; public static final String SEPARATE = ";";
public static final String ASYNC = "async";
public static final String SYNC = "sync";
public static final String GLOBAL = "global";
public static final String PARTIAL = "partial";
public static final String OK = "OK"; public static final String OK = "OK";
public static final String NO = "NO"; public static final String NO = "NO";
} }
\ No newline at end of file
...@@ -216,6 +216,6 @@ public class ServiceController { ...@@ -216,6 +216,6 @@ public class ServiceController {
} }
private static String getInvokeType(boolean async) { private static String getInvokeType(boolean async) {
return async ? "async" : "sync"; return async ? DiscoveryConstant.ASYNC : DiscoveryConstant.SYNC;
} }
} }
\ No newline at end of file
...@@ -81,7 +81,7 @@ public abstract class AbstractRestInvoker { ...@@ -81,7 +81,7 @@ public abstract class AbstractRestInvoker {
} }
protected String getInvokeType() { protected String getInvokeType() {
return async ? "async" : "sync"; return async ? DiscoveryConstant.ASYNC : DiscoveryConstant.SYNC;
} }
protected void checkDiscoveryControlPermission(ServiceInstance serviceInstance) { protected void checkDiscoveryControlPermission(ServiceInstance serviceInstance) {
......
...@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import com.ctrip.framework.apollo.ConfigChangeListener; import com.ctrip.framework.apollo.ConfigChangeListener;
import com.nepxion.discovery.common.apollo.operation.ApolloOperation; import com.nepxion.discovery.common.apollo.operation.ApolloOperation;
import com.nepxion.discovery.common.apollo.operation.ApolloSubscribeCallback; import com.nepxion.discovery.common.apollo.operation.ApolloSubscribeCallback;
import com.nepxion.discovery.common.constant.DiscoveryConstant;
import com.nepxion.discovery.common.entity.RuleEntity; import com.nepxion.discovery.common.entity.RuleEntity;
import com.nepxion.discovery.plugin.configcenter.adapter.ConfigAdapter; import com.nepxion.discovery.plugin.configcenter.adapter.ConfigAdapter;
import com.nepxion.discovery.plugin.framework.adapter.PluginAdapter; import com.nepxion.discovery.plugin.framework.adapter.PluginAdapter;
...@@ -135,6 +136,6 @@ public class ApolloConfigAdapter extends ConfigAdapter { ...@@ -135,6 +136,6 @@ public class ApolloConfigAdapter extends ConfigAdapter {
} }
private String getConfigType(boolean globalConfig) { private String getConfigType(boolean globalConfig) {
return globalConfig ? "global" : "partial"; return globalConfig ? DiscoveryConstant.GLOBAL : DiscoveryConstant.PARTIAL;
} }
} }
\ No newline at end of file
...@@ -22,6 +22,7 @@ import org.slf4j.LoggerFactory; ...@@ -22,6 +22,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import com.alibaba.nacos.api.config.listener.Listener; import com.alibaba.nacos.api.config.listener.Listener;
import com.nepxion.discovery.common.constant.DiscoveryConstant;
import com.nepxion.discovery.common.entity.RuleEntity; import com.nepxion.discovery.common.entity.RuleEntity;
import com.nepxion.discovery.common.nacos.operation.NacosOperation; import com.nepxion.discovery.common.nacos.operation.NacosOperation;
import com.nepxion.discovery.common.nacos.operation.NacosSubscribeCallback; import com.nepxion.discovery.common.nacos.operation.NacosSubscribeCallback;
...@@ -145,6 +146,6 @@ public class NacosConfigAdapter extends ConfigAdapter { ...@@ -145,6 +146,6 @@ public class NacosConfigAdapter extends ConfigAdapter {
} }
private String getConfigType(boolean globalConfig) { private String getConfigType(boolean globalConfig) {
return globalConfig ? "global" : "partial"; return globalConfig ? DiscoveryConstant.GLOBAL : DiscoveryConstant.PARTIAL;
} }
} }
\ No newline at end of file
...@@ -17,6 +17,7 @@ import org.springframework.data.redis.listener.PatternTopic; ...@@ -17,6 +17,7 @@ import org.springframework.data.redis.listener.PatternTopic;
import org.springframework.data.redis.listener.RedisMessageListenerContainer; import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; import org.springframework.data.redis.listener.adapter.MessageListenerAdapter;
import com.nepxion.discovery.common.constant.DiscoveryConstant;
import com.nepxion.discovery.common.entity.RuleEntity; import com.nepxion.discovery.common.entity.RuleEntity;
import com.nepxion.discovery.common.redis.operation.RedisOperation; import com.nepxion.discovery.common.redis.operation.RedisOperation;
import com.nepxion.discovery.common.redis.operation.RedisSubscribeCallback; import com.nepxion.discovery.common.redis.operation.RedisSubscribeCallback;
...@@ -135,6 +136,6 @@ public class RedisConfigAdapter extends ConfigAdapter { ...@@ -135,6 +136,6 @@ public class RedisConfigAdapter extends ConfigAdapter {
} }
private String getConfigType(boolean globalConfig) { private String getConfigType(boolean globalConfig) {
return globalConfig ? "global" : "partial"; return globalConfig ? DiscoveryConstant.GLOBAL : DiscoveryConstant.PARTIAL;
} }
} }
\ No newline at end of file
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