diff --git a/pom.xml b/pom.xml index afabe4a..1933e4b 100755 --- a/pom.xml +++ b/pom.xml @@ -115,7 +115,7 @@ com.github.xiaoymin swagger-bootstrap-ui - 1.9.4 + 1.9.3 diff --git a/src/main/java/com/gszc/Application.java b/src/main/java/com/gszc/Application.java index 6a419db..083d9ea 100755 --- a/src/main/java/com/gszc/Application.java +++ b/src/main/java/com/gszc/Application.java @@ -1,5 +1,6 @@ package com.gszc; +import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; @@ -10,6 +11,7 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import springfox.documentation.swagger2.annotations.EnableSwagger2; import tk.mybatis.spring.annotation.MapperScan; /** @@ -20,6 +22,8 @@ import tk.mybatis.spring.annotation.MapperScan; @EnableWebMvc @SpringBootApplication @EnableConfigurationProperties +@EnableSwaggerBootstrapUI +@EnableSwagger2 @MapperScan(basePackages = "com.gszc.mapper") public class Application extends WebMvcConfigurerAdapter implements WebMvcConfigurer { @@ -33,7 +37,7 @@ public class Application extends WebMvcConfigurerAdapter implements WebMvcConfig @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/"); + registry.addResourceHandler("/doc.html").addResourceLocations("classpath:/META-INF/resources/"); registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index e48e87f..c08c630 100755 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -1,6 +1,6 @@ #服务器端口号配置 server: - port: 8080 + port: 8087 #数据源配置 spring: # mvc: diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..40e0e90 --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,4 @@ + + + gszc + \ No newline at end of file