1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

Fix the code style issues

This commit is contained in:
mercyblitz
2020-09-03 10:06:57 +08:00
parent a61f523d78
commit 5cd6c0f1e7
35 changed files with 263 additions and 267 deletions

View File

@@ -1,12 +1,11 @@
/*
* 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
* Copyright 2013-2018 the original author or authors.
*
* http://www.apache.org/licenses/LICENSE-2.0
* Licensed 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
*
* https://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,
@@ -14,21 +13,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.cloud.dubbo.gateway;
import com.alibaba.cloud.dubbo.util.DubboCloudConstants;
/**
* The constants of Dubbo Cloud Gateway
* The constants of Dubbo Cloud Gateway.
*
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
*/
public interface DubboCloudGatewayConstants {
public abstract class DubboCloudGatewayConstants {
/**
* The property prefix of Configuration
* The property prefix of Configuration.
*/
String CONFIG_PROPERTY_PREFIX = DubboCloudConstants.CONFIG_PROPERTY_PREFIX
public static final String CONFIG_PROPERTY_PREFIX = DubboCloudConstants.CONFIG_PROPERTY_PREFIX
+ ".gateway";
}

View File

@@ -1,12 +1,11 @@
/*
* 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
* Copyright 2013-2018 the original author or authors.
*
* http://www.apache.org/licenses/LICENSE-2.0
* Licensed 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
*
* https://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,
@@ -14,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.cloud.dubbo.gateway;
import java.net.URI;
@@ -30,7 +30,6 @@ import com.alibaba.cloud.dubbo.service.DubboGenericServiceExecutionContextFactor
import com.alibaba.cloud.dubbo.service.DubboGenericServiceFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.dubbo.rpc.service.GenericException;
import org.apache.dubbo.rpc.service.GenericService;
@@ -46,10 +45,10 @@ import static org.apache.dubbo.common.constants.CommonConstants.PATH_SEPARATOR;
/**
* The executor of Dubbo Cloud Gateway that handles the HTTP request and responses the
* result of execution of the generic invocation to the Dubbo service providers
* result of execution of the generic invocation to the Dubbo service providers.
*
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
*
*
*/
public class DubboCloudGatewayExecutor {
@@ -145,8 +144,7 @@ public class DubboCloudGatewayExecutor {
}
/**
* TODO : Get the Request Body from HttpRequest
*
* TODO : Get the Request Body from HttpRequest.
* @param request {@link HttpRequest}
* @return
*/

View File

@@ -1,12 +1,11 @@
/*
* 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
* Copyright 2013-2018 the original author or authors.
*
* http://www.apache.org/licenses/LICENSE-2.0
* Licensed 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
*
* https://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,
@@ -14,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.cloud.dubbo.gateway;
import org.springframework.boot.context.properties.ConfigurationProperties;
@@ -21,7 +21,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
import static com.alibaba.cloud.dubbo.gateway.DubboCloudGatewayConstants.CONFIG_PROPERTY_PREFIX;
/**
* The Configuration Properties for Dubbo Cloud Gateway
* The Configuration Properties for Dubbo Cloud Gateway.
*
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
*/
@@ -29,12 +29,12 @@ import static com.alibaba.cloud.dubbo.gateway.DubboCloudGatewayConstants.CONFIG_
public class DubboCloudGatewayProperties {
/**
* Enabled or not
* Enabled or not.
*/
private boolean enabled = true;
/**
* The context path for the gateway request mapping
* The context path for the gateway request mapping.
*/
private String contextPath = "";
@@ -53,4 +53,5 @@ public class DubboCloudGatewayProperties {
public void setContextPath(String contextPath) {
this.contextPath = contextPath;
}
}

View File

@@ -1,12 +1,11 @@
/*
* 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
* Copyright 2013-2018 the original author or authors.
*
* http://www.apache.org/licenses/LICENSE-2.0
* Licensed 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
*
* https://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,
@@ -14,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.cloud.dubbo.gateway.autoconfigure;
import com.alibaba.cloud.dubbo.autoconfigure.DubboMetadataAutoConfiguration;
@@ -34,7 +34,8 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.ConversionService;
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(prefix = "dubbo.cloud.gateway", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "dubbo.cloud.gateway", name = "enabled",
havingValue = "true", matchIfMissing = true)
@AutoConfigureAfter({ DubboServiceAutoConfiguration.class,
DubboMetadataAutoConfiguration.class })
@EnableConfigurationProperties(DubboCloudGatewayProperties.class)
@@ -51,4 +52,5 @@ public class DubboCloudGatewayAutoConfiguration {
return new DubboCloudGatewayExecutor(repository, serviceFactory, contextFactory,
dubboCloudGatewayProperties, conversionServices);
}
}

View File

@@ -1,12 +1,11 @@
/*
* 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
* Copyright 2013-2018 the original author or authors.
*
* http://www.apache.org/licenses/LICENSE-2.0
* Licensed 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
*
* https://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,
@@ -14,13 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.cloud.dubbo.gateway.autoconfigure;
import com.alibaba.cloud.dubbo.autoconfigure.DubboMetadataAutoConfiguration;
import com.alibaba.cloud.dubbo.autoconfigure.DubboServiceAutoConfiguration;
import com.alibaba.cloud.dubbo.gateway.DubboCloudGatewayExecutor;
import com.alibaba.cloud.dubbo.gateway.DubboCloudGatewayProperties;
import com.alibaba.cloud.dubbo.gateway.standard.DubboSpringCloudGatewayFilter;
import com.alibaba.cloud.dubbo.gateway.bootstrap.DubboSpringCloudGatewayFilter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -38,13 +38,14 @@ import org.springframework.http.codec.ServerCodecConfigurer;
import org.springframework.http.codec.support.DefaultServerCodecConfigurer;
/**
* The Auto-{@link Configuration} of Dubbo Spring Cloud Gateway
* The Auto-{@link Configuration} of Dubbo Spring Cloud Gateway.
*
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(GlobalFilter.class)
@ConditionalOnProperty(prefix = "dubbo.cloud.gateway", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "dubbo.cloud.gateway", name = "enabled",
havingValue = "true", matchIfMissing = true)
@AutoConfigureAfter({ DubboServiceAutoConfiguration.class,
DubboMetadataAutoConfiguration.class, DubboCloudGatewayAutoConfiguration.class })
@EnableConfigurationProperties(DubboCloudGatewayProperties.class)

View File

@@ -1,12 +1,11 @@
/*
* 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
* Copyright 2013-2018 the original author or authors.
*
* http://www.apache.org/licenses/LICENSE-2.0
* Licensed 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
*
* https://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,
@@ -14,7 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.cloud.dubbo.gateway.standard;
package com.alibaba.cloud.dubbo.gateway.bootstrap;
import com.alibaba.cloud.dubbo.gateway.DubboCloudGatewayExecutor;
import org.apache.commons.logging.Log;
@@ -29,7 +29,7 @@ import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.web.server.ServerWebExchange;
/**
* The Spring Cloud {@link GatewayFilter Gateway Filter} for Dubbo
* The Spring Cloud {@link GatewayFilter Gateway Filter} for Dubbo.
*
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
*/

View File

@@ -1,12 +1,11 @@
/*
* 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
* Copyright 2013-2018 the original author or authors.
*
* http://www.apache.org/licenses/LICENSE-2.0
* Licensed 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
*
* https://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,
@@ -14,20 +13,24 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.cloud.dubbo.gateway.standard;
import org.springframework.boot.autoconfigure.SpringBootApplication;
package com.alibaba.cloud.dubbo.gateway.bootstrap;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
/**
* The bootstrap class of Dubbo Spring Cloud Gateway
* The bootstrap class of Dubbo Spring Cloud Gateway.
*
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
*/
@SpringBootApplication
@EnableAutoConfiguration
@EnableDiscoveryClient
public class DubboSpringCloudGatewayBootstrap {
public final class DubboSpringCloudGatewayBootstrap {
private DubboSpringCloudGatewayBootstrap() {
}
public static void main(String[] args) {
new SpringApplicationBuilder(DubboSpringCloudGatewayBootstrap.class)