Code style

This commit is contained in:
hongqiaowei
2021-06-09 17:02:23 +08:00
parent 4fc75dfe40
commit 57ffa9d351
2 changed files with 10 additions and 8 deletions

View File

@@ -14,6 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
package we.config; package we.config;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -38,6 +39,7 @@ import java.util.stream.Stream;
/** /**
* @author hongqiaowei * @author hongqiaowei
*/ */
@RefreshScope @RefreshScope
@Component @Component
public class SystemConfig { public class SystemConfig {
@@ -62,7 +64,7 @@ public class SystemConfig {
private boolean aggregateTestAuth = false; private boolean aggregateTestAuth = false;
@Value ( "${route-timeout:0}") @Value("${route-timeout:0}")
private long routeTimeout = 0; private long routeTimeout = 0;
public long getRouteTimeout() { public long getRouteTimeout() {
@@ -84,7 +86,7 @@ public class SystemConfig {
return proxySetHeaders; return proxySetHeaders;
} }
@Value( "${gateway.prefix:/proxy}" ) @Value("${gateway.prefix:/proxy}")
public void setGatewayPrefix(String gp) { public void setGatewayPrefix(String gp) {
gatewayPrefix = gp; gatewayPrefix = gp;
WebUtils.setGatewayPrefix(gatewayPrefix); WebUtils.setGatewayPrefix(gatewayPrefix);
@@ -95,7 +97,7 @@ public class SystemConfig {
return gatewayPrefix; return gatewayPrefix;
} }
@Value( "${custom.header.appid:}" ) @Value("${custom.header.appid:}")
public void setCustomAppHeaders(String hdrs) { public void setCustomAppHeaders(String hdrs) {
if (StringUtils.isNotBlank(hdrs)) { if (StringUtils.isNotBlank(hdrs)) {
appHeaders.clear(); appHeaders.clear();
@@ -112,7 +114,7 @@ public class SystemConfig {
return appHeaders; return appHeaders;
} }
@Value( "${custom.header.sign:}" ) @Value("${custom.header.sign:}")
public void setCustomSignHeaders(String hdrs) { public void setCustomSignHeaders(String hdrs) {
if (StringUtils.isNotBlank(hdrs)) { if (StringUtils.isNotBlank(hdrs)) {
signHeaders.clear(); signHeaders.clear();
@@ -128,7 +130,7 @@ public class SystemConfig {
return signHeaders; return signHeaders;
} }
@Value( "${custom.header.ts:}" ) @Value("${custom.header.ts:}")
public void setCustomTimestampHeaders(String hdrs) { public void setCustomTimestampHeaders(String hdrs) {
if (StringUtils.isNotBlank(hdrs)) { if (StringUtils.isNotBlank(hdrs)) {
timestampHeaders.clear(); timestampHeaders.clear();
@@ -144,7 +146,7 @@ public class SystemConfig {
return timestampHeaders; return timestampHeaders;
} }
@Value( "${aggregate-test-auth:false}" ) @Value("${aggregate-test-auth:false}")
public void setAggregateTestAuth(boolean b) { public void setAggregateTestAuth(boolean b) {
aggregateTestAuth = b; aggregateTestAuth = b;
log.info("aggregate test auth: " + aggregateTestAuth); log.info("aggregate test auth: " + aggregateTestAuth);

View File

@@ -134,6 +134,7 @@ public class WebFluxConfig {
@Configuration @Configuration
@EnableWebFlux @EnableWebFlux
public static class FizzWebFluxConfigurer implements WebFluxConfigurer { public static class FizzWebFluxConfigurer implements WebFluxConfigurer {
@Resource @Resource
private WebFluxConfigProperties webFluxConfigProperties; private WebFluxConfigProperties webFluxConfigProperties;
@@ -146,8 +147,7 @@ public class WebFluxConfig {
MultipartHttpMessageReader multipartReader = new MultipartHttpMessageReader(partReader); MultipartHttpMessageReader multipartReader = new MultipartHttpMessageReader(partReader);
configurer.defaultCodecs().multipartReader(multipartReader); configurer.defaultCodecs().multipartReader(multipartReader);
} }
@Override @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/*.*") registry.addResourceHandler("/*.*")