Fix typo & Code optimization

pull/507/head
DerekYRC 3 years ago
parent 3f672a8213
commit 83f4430b80

@ -92,7 +92,7 @@ public class PolarisDiscoveryHandler {
*
* @return service list
*/
public ServicesResponse GetServices() {
public ServicesResponse getServices() {
String namespace = polarisDiscoveryProperties.getNamespace();
GetServicesRequest request = new GetServicesRequest();
request.setNamespace(namespace);

@ -67,10 +67,10 @@ public class PolarisServiceDiscovery {
* @throws PolarisException polarisException
*/
public List<String> getServices() throws PolarisException {
if (CollectionUtils.isEmpty(polarisDiscoveryHandler.GetServices().getServices())) {
if (CollectionUtils.isEmpty(polarisDiscoveryHandler.getServices().getServices())) {
return Collections.emptyList();
}
return polarisDiscoveryHandler.GetServices().getServices().stream()
return polarisDiscoveryHandler.getServices().getServices().stream()
.map(ServiceInfo::getService).collect(Collectors.toList());
}
}

@ -20,9 +20,9 @@ package com.tencent.cloud.polaris.ratelimit.config;
import com.tencent.cloud.polaris.context.ConditionalOnPolarisEnabled;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
/**
* Properties auto configuration of rate limit.
@ -31,7 +31,7 @@ import org.springframework.context.annotation.Import;
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnPolarisEnabled
@Import({PolarisRateLimitProperties.class})
@EnableConfigurationProperties(PolarisRateLimitProperties.class)
public class PolarisRateLimitPropertiesAutoConfiguration {
@Bean

@ -35,7 +35,7 @@ public final class RateLimitConstant {
/**
* Info of rate limit.
*/
public static String QUOTA_LIMITED_INFO = "The request is deny by rate limit because the throttling threshold is reached";
public static String QUOTA_LIMITED_INFO = "The request is denied by rate limit because the throttling threshold is reached";
/**
* The build in label method.

Loading…
Cancel
Save