Browse Source

Swagger 版本升级

macro 4 years ago
parent
commit
5ac40a5036

+ 1 - 3
mall-admin/src/main/java/com/macro/mall/config/Swagger2Config.java

@@ -56,9 +56,7 @@ public class Swagger2Config {
     private List<SecurityContext> securityContexts() {
         //设置需要登录认证的路径
         List<SecurityContext> result = new ArrayList<>();
-        result.add(getContextByPath("/brand/.*"));
-        result.add(getContextByPath("/product/.*"));
-        result.add(getContextByPath("/productCategory/.*"));
+        result.add(getContextByPath("/*/.*"));
         return result;
     }
 

+ 1 - 4
mall-portal/src/main/java/com/macro/mall/portal/config/Swagger2Config.java

@@ -56,10 +56,7 @@ public class Swagger2Config {
     private List<SecurityContext> securityContexts() {
         //设置需要登录认证的路径
         List<SecurityContext> result = new ArrayList<>();
-        result.add(getContextByPath("/member/.*"));
-        result.add(getContextByPath("/cart/.*"));
-        result.add(getContextByPath("/order/.*"));
-        result.add(getContextByPath("/returnApply/.*"));
+        result.add(getContextByPath("/*/.*"));
         return result;
     }
 

+ 21 - 1
pom.xml

@@ -37,7 +37,9 @@
         <pagehelper.version>5.1.8</pagehelper.version>
         <druid.version>1.1.10</druid.version>
         <hutool.version>4.5.7</hutool.version>
-        <swagger2.version>2.7.0</swagger2.version>
+        <swagger2.version>2.9.2</swagger2.version>
+        <swagger-models.version>1.6.0</swagger-models.version>
+        <swagger-annotations.version>1.6.0</swagger-annotations.version>
         <mybatis-generator.version>1.3.7</mybatis-generator.version>
         <mybatis.version>3.4.6</mybatis.version>
         <mysql-connector.version>8.0.16</mysql-connector.version>
@@ -46,6 +48,7 @@
         <aliyun-oss.version>2.5.0</aliyun-oss.version>
         <logstash-logback.version>4.8</logstash-logback.version>
         <minio.version>3.0.10</minio.version>
+        <guava.version>20.0</guava.version>
         <mall-common.version>1.0-SNAPSHOT</mall-common.version>
         <mall-mbg.version>1.0-SNAPSHOT</mall-mbg.version>
         <mall-security.version>1.0-SNAPSHOT</mall-security.version>
@@ -134,6 +137,17 @@
                 <artifactId>springfox-swagger-ui</artifactId>
                 <version>${swagger2.version}</version>
             </dependency>
+            <!--解决Swagger 2.9.2版本NumberFormatException-->
+            <dependency>
+                <groupId>io.swagger</groupId>
+                <artifactId>swagger-models</artifactId>
+                <version>${swagger-models.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>io.swagger</groupId>
+                <artifactId>swagger-annotations</artifactId>
+                <version>${swagger-annotations.version}</version>
+            </dependency>
             <!-- MyBatis 生成器 -->
             <dependency>
                 <groupId>org.mybatis.generator</groupId>
@@ -182,6 +196,12 @@
                 <artifactId>minio</artifactId>
                 <version>${minio.version}</version>
             </dependency>
+            <!--统一Guava版本防止冲突-->
+            <dependency>
+                <groupId>com.google.guava</groupId>
+                <artifactId>guava</artifactId>
+                <version>${guava.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>