mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-12 07:02:14 +08:00
1.15.1
This commit is contained in:
@@ -17,6 +17,7 @@ import org.springframework.core.env.Environment;
|
|||||||
import org.springframework.http.converter.HttpMessageConverter;
|
import org.springframework.http.converter.HttpMessageConverter;
|
||||||
import org.springframework.http.converter.StringHttpMessageConverter;
|
import org.springframework.http.converter.StringHttpMessageConverter;
|
||||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
||||||
|
|
||||||
@@ -40,6 +41,15 @@ public class BaseServiceConfiguration extends WebMvcConfigurationSupport
|
|||||||
|
|
||||||
private ApiMappingHandlerMapping apiMappingHandlerMapping = new ApiMappingHandlerMapping();
|
private ApiMappingHandlerMapping apiMappingHandlerMapping = new ApiMappingHandlerMapping();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
|
super.addResourceHandlers(registry);
|
||||||
|
// 支持swagger-bootstrap-ui首页
|
||||||
|
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
|
||||||
|
// 支持默认swagger
|
||||||
|
registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
|
||||||
|
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addInterceptors(InterceptorRegistry registry) {
|
protected void addInterceptors(InterceptorRegistry registry) {
|
||||||
|
@@ -4,7 +4,6 @@ import com.gitee.sop.servercommon.bean.ServiceConfig;
|
|||||||
import com.gitee.sop.servercommon.configuration.AlipayServiceConfiguration;
|
import com.gitee.sop.servercommon.configuration.AlipayServiceConfiguration;
|
||||||
import com.gitee.sop.servercommon.swagger.SwaggerSupport;
|
import com.gitee.sop.servercommon.swagger.SwaggerSupport;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
|
||||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -14,21 +13,10 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
|||||||
@Configuration
|
@Configuration
|
||||||
public class OpenServiceConfig extends AlipayServiceConfiguration {
|
public class OpenServiceConfig extends AlipayServiceConfiguration {
|
||||||
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
ServiceConfig.getInstance().getI18nModules().add("i18n/isp/goods_error");
|
ServiceConfig.getInstance().getI18nModules().add("i18n/isp/goods_error");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void addResourceHandlers(ResourceHandlerRegistry registry) {
|
|
||||||
super.addResourceHandlers(registry);
|
|
||||||
// 支持swagger-bootstrap-ui首页
|
|
||||||
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
|
|
||||||
// 支持默认swagger
|
|
||||||
registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
|
|
||||||
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开启文档,本地微服务文档地址:http://localhost:2222/doc.html
|
* 开启文档,本地微服务文档地址:http://localhost:2222/doc.html
|
||||||
|
@@ -15,8 +15,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<java.version>1.8</java.version>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@@ -58,48 +57,39 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
|
<!-- 打包时跳过测试 -->
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-clean-plugin</artifactId>
|
|
||||||
<version>3.1.0</version>
|
|
||||||
</plugin>
|
|
||||||
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
|
||||||
<version>3.0.2</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>3.8.0</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>2.22.1</version>
|
<version>2.12.4</version>
|
||||||
|
<configuration>
|
||||||
|
<skipTests>true</skipTests>
|
||||||
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<version>3.0.2</version>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>${java.version}</source>
|
||||||
|
<target>${java.version}</target>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-install-plugin</artifactId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<version>2.5.2</version>
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
</plugin>
|
<version>2.2.1</version>
|
||||||
<plugin>
|
<executions>
|
||||||
<artifactId>maven-deploy-plugin</artifactId>
|
<execution>
|
||||||
<version>2.8.2</version>
|
<id>attach-sources</id>
|
||||||
</plugin>
|
<goals>
|
||||||
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
|
<goal>jar-no-fork</goal>
|
||||||
<plugin>
|
</goals>
|
||||||
<artifactId>maven-site-plugin</artifactId>
|
</execution>
|
||||||
<version>3.7.1</version>
|
</executions>
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
|
||||||
<version>3.0.0</version>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</pluginManagement>
|
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
Reference in New Issue
Block a user