mirror of
https://gitee.com/dcren/initializr.git
synced 2026-09-27 14:57:39 +08:00
Polish
This commit is contained in:
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -143,8 +143,8 @@ public class InitializrAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
ProjectGenerationController projectGenerationController(InitializrMetadataProvider metadataProvider,
|
||||
ApplicationContext applicationContext) {
|
||||
ProjectGenerationController<ProjectRequest> projectGenerationController(
|
||||
InitializrMetadataProvider metadataProvider, ApplicationContext applicationContext) {
|
||||
ProjectGenerationInvoker<ProjectRequest> projectGenerationInvoker = new ProjectGenerationInvoker<>(
|
||||
applicationContext, new DefaultProjectRequestToDescriptionConverter());
|
||||
return new DefaultProjectGenerationController(metadataProvider, projectGenerationInvoker);
|
||||
|
||||
+2
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,7 +27,6 @@ import io.spring.initializr.web.support.Agent.AgentId;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.HttpMediaTypeNotAcceptableException;
|
||||
import org.springframework.web.accept.ContentNegotiationStrategy;
|
||||
import org.springframework.web.context.request.NativeWebRequest;
|
||||
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
|
||||
@@ -61,7 +60,7 @@ public class InitializrWebConfig implements WebMvcConfigurer {
|
||||
private final UrlPathHelper urlPathHelper = new UrlPathHelper();
|
||||
|
||||
@Override
|
||||
public List<MediaType> resolveMediaTypes(NativeWebRequest request) throws HttpMediaTypeNotAcceptableException {
|
||||
public List<MediaType> resolveMediaTypes(NativeWebRequest request) {
|
||||
String path = this.urlPathHelper
|
||||
.getPathWithinApplication(request.getNativeRequest(HttpServletRequest.class));
|
||||
if (!StringUtils.hasText(path) || !path.equals("/")) { // Only care about "/"
|
||||
|
||||
+2
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -283,8 +283,7 @@ public class CommandLineHelpGenerator {
|
||||
|
||||
private static List<String[]> computeRow(String[][] content, int rowIndex, int maxWidth) {
|
||||
String[] line = content[rowIndex];
|
||||
List<String[]> row = HelpFormatter.format(line, maxWidth);
|
||||
return row;
|
||||
return HelpFormatter.format(line, maxWidth);
|
||||
}
|
||||
|
||||
private static void appendEmptyRow(StringBuilder sb, int[] columnsLength) {
|
||||
|
||||
Reference in New Issue
Block a user