Browse Source

使用SpringDoc代替Swagger

RuoYi 1 year ago
parent
commit
3b499b1344
27 changed files with 322 additions and 774 deletions
  1. 2 2
      docker/copy.sh
  2. 5 11
      pom.xml
  3. 0 6
      ruoyi-common/ruoyi-common-core/pom.xml
  4. 3 4
      ruoyi-common/ruoyi-common-swagger/pom.xml
  5. 0 20
      ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/annotation/EnableCustomSwagger2.java
  6. 63 0
      ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SpringDocAutoConfiguration.java
  7. 0 123
      ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerAutoConfiguration.java
  8. 0 52
      ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerBeanPostProcessor.java
  9. 0 343
      ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerProperties.java
  10. 0 20
      ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerWebConfiguration.java
  11. 135 0
      ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/properties/SpringDocProperties.java
  12. 1 3
      ruoyi-common/ruoyi-common-swagger/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  13. 4 9
      ruoyi-gateway/pom.xml
  14. 93 0
      ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/SpringDocConfig.java
  15. 0 79
      ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/SwaggerProvider.java
  16. 1 1
      ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/AuthFilter.java
  17. 0 56
      ruoyi-gateway/src/main/java/com/ruoyi/gateway/handler/SwaggerHandler.java
  18. 6 6
      ruoyi-modules/ruoyi-file/pom.xml
  19. 0 2
      ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/RuoYiFileApplication.java
  20. 0 7
      ruoyi-modules/ruoyi-gen/pom.xml
  21. 0 2
      ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/RuoYiGenApplication.java
  22. 0 1
      ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/domain/GenTableColumn.java
  23. 1 8
      ruoyi-modules/ruoyi-job/pom.xml
  24. 0 2
      ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/RuoYiJobApplication.java
  25. 1 8
      ruoyi-modules/ruoyi-system/pom.xml
  26. 0 2
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/RuoYiSystemApplication.java
  27. 7 7
      sql/ry_config_20231204.sql

+ 2 - 2
docker/copy.sh

@@ -9,8 +9,8 @@ usage() {
9 9
 
10 10
 # copy sql
11 11
 echo "begin copy sql "
12
-cp ../sql/ry_20231130.sql ./mysql/db
13
-cp ../sql/ry_config_20231204.sql ./mysql/db
12
+cp ../sql/ry_20240629.sql ./mysql/db
13
+cp ../sql/ry_config_20240829.sql ./mysql/db
14 14
 
15 15
 # copy html
16 16
 echo "begin copy html "

+ 5 - 11
pom.xml

@@ -22,8 +22,6 @@
22 22
         <spring-cloud-alibaba.version>2021.0.5.0</spring-cloud-alibaba.version>
23 23
         <spring-framework.version>5.3.33</spring-framework.version>
24 24
         <spring-boot-admin.version>2.7.15</spring-boot-admin.version>
25
-        <swagger.fox.version>3.0.0</swagger.fox.version>
26
-        <swagger.core.version>1.6.2</swagger.core.version>
27 25
         <tobato.version>1.27.2</tobato.version>
28 26
         <kaptcha.version>2.3.3</kaptcha.version>
29 27
         <pagehelper.boot.version>2.0.0</pagehelper.boot.version>
@@ -35,6 +33,7 @@
35 33
         <jjwt.version>0.9.1</jjwt.version>
36 34
         <minio.version>8.2.2</minio.version>
37 35
         <poi.version>4.1.2</poi.version>
36
+        <springdoc.version>1.6.9</springdoc.version>
38 37
         <transmittable-thread-local.version>2.14.4</transmittable-thread-local.version>
39 38
     </properties>
40 39
 
@@ -85,16 +84,11 @@
85 84
                 <version>${tobato.version}</version>
86 85
             </dependency>
87 86
 
88
-            <!-- Swagger 依赖配置 -->
87
+            <!-- Springdoc webmvc 依赖配置 -->
89 88
             <dependency>
90
-                <groupId>io.swagger</groupId>
91
-                <artifactId>swagger-models</artifactId>
92
-                <version>${swagger.core.version}</version>
93
-            </dependency>
94
-            <dependency>
95
-                <groupId>io.swagger</groupId>
96
-                <artifactId>swagger-annotations</artifactId>
97
-                <version>${swagger.core.version}</version>
89
+                <groupId>org.springdoc</groupId>
90
+                <artifactId>springdoc-openapi-ui</artifactId>
91
+                <version>${springdoc.version}</version>
98 92
             </dependency>
99 93
 
100 94
             <!-- 验证码 -->

+ 0 - 6
ruoyi-common/ruoyi-common-core/pom.xml

@@ -107,12 +107,6 @@
107 107
             <artifactId>javax.servlet-api</artifactId>
108 108
         </dependency>
109 109
 
110
-        <!-- Swagger -->
111
-        <dependency>
112
-            <groupId>io.swagger</groupId>
113
-            <artifactId>swagger-annotations</artifactId>
114
-        </dependency>
115
-
116 110
     </dependencies>
117 111
 
118 112
 </project>

+ 3 - 4
ruoyi-common/ruoyi-common-swagger/pom.xml

@@ -23,11 +23,10 @@
23 23
             <artifactId>spring-boot-starter-web</artifactId>
24 24
         </dependency>
25 25
 
26
-        <!-- Swagger -->
26
+        <!-- SpringDoc webmvc -->
27 27
         <dependency>
28
-            <groupId>io.springfox</groupId>
29
-            <artifactId>springfox-swagger2</artifactId>
30
-            <version>${swagger.fox.version}</version>
28
+            <groupId>org.springdoc</groupId>
29
+            <artifactId>springdoc-openapi-ui</artifactId>
31 30
         </dependency>
32 31
 
33 32
 	</dependencies>

+ 0 - 20
ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/annotation/EnableCustomSwagger2.java

@@ -1,20 +0,0 @@
1
-package com.ruoyi.common.swagger.annotation;
2
-
3
-import java.lang.annotation.Documented;
4
-import java.lang.annotation.ElementType;
5
-import java.lang.annotation.Inherited;
6
-import java.lang.annotation.Retention;
7
-import java.lang.annotation.RetentionPolicy;
8
-import java.lang.annotation.Target;
9
-import org.springframework.context.annotation.Import;
10
-import com.ruoyi.common.swagger.config.SwaggerAutoConfiguration;
11
-
12
-@Target({ ElementType.TYPE })
13
-@Retention(RetentionPolicy.RUNTIME)
14
-@Documented
15
-@Inherited
16
-@Import({ SwaggerAutoConfiguration.class })
17
-public @interface EnableCustomSwagger2
18
-{
19
-
20
-}

+ 63 - 0
ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SpringDocAutoConfiguration.java

@@ -0,0 +1,63 @@
1
+package com.ruoyi.common.swagger.config;
2
+
3
+import java.util.ArrayList;
4
+import java.util.List;
5
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
6
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
7
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
8
+import org.springframework.context.annotation.Bean;
9
+import com.ruoyi.common.swagger.config.properties.SpringDocProperties;
10
+import io.swagger.v3.oas.models.Components;
11
+import io.swagger.v3.oas.models.OpenAPI;
12
+import io.swagger.v3.oas.models.info.Info;
13
+import io.swagger.v3.oas.models.security.SecurityRequirement;
14
+import io.swagger.v3.oas.models.security.SecurityScheme;
15
+import io.swagger.v3.oas.models.servers.Server;
16
+
17
+/**
18
+ * Swagger 文档配置
19
+ *
20
+ * @author ruoyi
21
+ */
22
+@EnableConfigurationProperties(SpringDocProperties.class)
23
+@ConditionalOnProperty(name = "springdoc.api-docs.enabled", havingValue = "true", matchIfMissing = true)
24
+public class SpringDocAutoConfiguration
25
+{
26
+    @Bean
27
+    @ConditionalOnMissingBean(OpenAPI.class)
28
+    public OpenAPI openApi(SpringDocProperties properties)
29
+    {
30
+        return new OpenAPI().components(new Components()
31
+            // 设置认证的请求头
32
+            .addSecuritySchemes("apikey", securityScheme()))
33
+            .addSecurityItem(new SecurityRequirement().addList("apikey"))
34
+            .info(convertInfo(properties.getInfo()))
35
+            .servers(servers(properties.getGatewayUrl()));
36
+    }
37
+
38
+    public SecurityScheme securityScheme()
39
+    {
40
+        return new SecurityScheme().type(SecurityScheme.Type.APIKEY)
41
+            .name("Authorization")
42
+            .in(SecurityScheme.In.HEADER)
43
+            .scheme("Bearer");
44
+    }
45
+
46
+    private Info convertInfo(SpringDocProperties.InfoProperties infoProperties)
47
+    {
48
+        Info info = new Info();
49
+        info.setTitle(infoProperties.getTitle());
50
+        info.setDescription(infoProperties.getDescription());
51
+        info.setContact(infoProperties.getContact());
52
+        info.setLicense(infoProperties.getLicense());
53
+        info.setVersion(infoProperties.getVersion());
54
+        return info;
55
+    }
56
+
57
+    public List<Server> servers(String gatewayUrl)
58
+    {
59
+        List<Server> serverList = new ArrayList<>();
60
+        serverList.add(new Server().url(gatewayUrl));
61
+        return serverList;
62
+    }
63
+}

+ 0 - 123
ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerAutoConfiguration.java

@@ -1,123 +0,0 @@
1
-package com.ruoyi.common.swagger.config;
2
-
3
-import java.util.ArrayList;
4
-import java.util.Arrays;
5
-import java.util.List;
6
-import java.util.function.Predicate;
7
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
8
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
9
-import org.springframework.context.annotation.Bean;
10
-import org.springframework.context.annotation.Configuration;
11
-import org.springframework.context.annotation.Import;
12
-import springfox.documentation.builders.ApiInfoBuilder;
13
-import springfox.documentation.builders.PathSelectors;
14
-import springfox.documentation.builders.RequestHandlerSelectors;
15
-import springfox.documentation.service.ApiInfo;
16
-import springfox.documentation.service.ApiKey;
17
-import springfox.documentation.service.AuthorizationScope;
18
-import springfox.documentation.service.Contact;
19
-import springfox.documentation.service.SecurityReference;
20
-import springfox.documentation.service.SecurityScheme;
21
-import springfox.documentation.spi.DocumentationType;
22
-import springfox.documentation.spi.service.contexts.SecurityContext;
23
-import springfox.documentation.spring.web.plugins.ApiSelectorBuilder;
24
-import springfox.documentation.spring.web.plugins.Docket;
25
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
26
-
27
-@Configuration
28
-@EnableSwagger2
29
-@EnableConfigurationProperties(SwaggerProperties.class)
30
-@ConditionalOnProperty(name = "swagger.enabled", matchIfMissing = true)
31
-@Import({SwaggerBeanPostProcessor.class, SwaggerWebConfiguration.class})
32
-public class SwaggerAutoConfiguration
33
-{
34
-    /**
35
-     * 默认的排除路径,排除Spring Boot默认的错误处理路径和端点
36
-     */
37
-    private static final List<String> DEFAULT_EXCLUDE_PATH = Arrays.asList("/error", "/actuator/**");
38
-
39
-    private static final String BASE_PATH = "/**";
40
-
41
-    @Bean
42
-    public Docket api(SwaggerProperties swaggerProperties)
43
-    {
44
-        // base-path处理
45
-        if (swaggerProperties.getBasePath().isEmpty())
46
-        {
47
-            swaggerProperties.getBasePath().add(BASE_PATH);
48
-        }
49
-        // noinspection unchecked
50
-        List<Predicate<String>> basePath = new ArrayList<Predicate<String>>();
51
-        swaggerProperties.getBasePath().forEach(path -> basePath.add(PathSelectors.ant(path)));
52
-
53
-        // exclude-path处理
54
-        if (swaggerProperties.getExcludePath().isEmpty())
55
-        {
56
-            swaggerProperties.getExcludePath().addAll(DEFAULT_EXCLUDE_PATH);
57
-        }
58
-
59
-        List<Predicate<String>> excludePath = new ArrayList<>();
60
-        swaggerProperties.getExcludePath().forEach(path -> excludePath.add(PathSelectors.ant(path)));
61
-
62
-        ApiSelectorBuilder builder = new Docket(DocumentationType.SWAGGER_2).host(swaggerProperties.getHost())
63
-                .apiInfo(apiInfo(swaggerProperties)).select()
64
-                .apis(RequestHandlerSelectors.basePackage(swaggerProperties.getBasePackage()));
65
-
66
-        swaggerProperties.getBasePath().forEach(p -> builder.paths(PathSelectors.ant(p)));
67
-        swaggerProperties.getExcludePath().forEach(p -> builder.paths(PathSelectors.ant(p).negate()));
68
-
69
-        return builder.build().securitySchemes(securitySchemes()).securityContexts(securityContexts()).pathMapping("/");
70
-    }
71
-
72
-    /**
73
-     * 安全模式,这里指定token通过Authorization头请求头传递
74
-     */
75
-    private List<SecurityScheme> securitySchemes()
76
-    {
77
-        List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
78
-        apiKeyList.add(new ApiKey("Authorization", "Authorization", "header"));
79
-        return apiKeyList;
80
-    }
81
-
82
-    /**
83
-     * 安全上下文
84
-     */
85
-    private List<SecurityContext> securityContexts()
86
-    {
87
-        List<SecurityContext> securityContexts = new ArrayList<>();
88
-        securityContexts.add(
89
-                SecurityContext.builder()
90
-                        .securityReferences(defaultAuth())
91
-                        .operationSelector(o -> o.requestMappingPattern().matches("/.*"))
92
-                        .build());
93
-        return securityContexts;
94
-    }
95
-
96
-    /**
97
-     * 默认的全局鉴权策略
98
-     *
99
-     * @return
100
-     */
101
-    private List<SecurityReference> defaultAuth()
102
-    {
103
-        AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
104
-        AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
105
-        authorizationScopes[0] = authorizationScope;
106
-        List<SecurityReference> securityReferences = new ArrayList<>();
107
-        securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
108
-        return securityReferences;
109
-    }
110
-
111
-    private ApiInfo apiInfo(SwaggerProperties swaggerProperties)
112
-    {
113
-         return new ApiInfoBuilder()
114
-             .title(swaggerProperties.getTitle())
115
-             .description(swaggerProperties.getDescription())
116
-             .license(swaggerProperties.getLicense())
117
-             .licenseUrl(swaggerProperties.getLicenseUrl())
118
-             .termsOfServiceUrl(swaggerProperties.getTermsOfServiceUrl())
119
-             .contact(new Contact(swaggerProperties.getContact().getName(), swaggerProperties.getContact().getUrl(), swaggerProperties.getContact().getEmail()))
120
-             .version(swaggerProperties.getVersion())
121
-             .build();
122
-    }
123
-}

+ 0 - 52
ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerBeanPostProcessor.java

@@ -1,52 +0,0 @@
1
-package com.ruoyi.common.swagger.config;
2
-
3
-import org.springframework.beans.BeansException;
4
-import org.springframework.beans.factory.config.BeanPostProcessor;
5
-import org.springframework.util.ReflectionUtils;
6
-import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping;
7
-import springfox.documentation.spring.web.plugins.WebFluxRequestHandlerProvider;
8
-import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider;
9
-import java.lang.reflect.Field;
10
-import java.util.List;
11
-import java.util.stream.Collectors;
12
-
13
-/**
14
- * swagger 在 springboot 2.6.x 不兼容问题的处理
15
- *
16
- * @author ruoyi
17
- */
18
-public class SwaggerBeanPostProcessor implements BeanPostProcessor
19
-{
20
-    @Override
21
-    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException
22
-    {
23
-        if (bean instanceof WebMvcRequestHandlerProvider || bean instanceof WebFluxRequestHandlerProvider)
24
-        {
25
-            customizeSpringfoxHandlerMappings(getHandlerMappings(bean));
26
-        }
27
-        return bean;
28
-    }
29
-
30
-    private <T extends RequestMappingInfoHandlerMapping> void customizeSpringfoxHandlerMappings(List<T> mappings)
31
-    {
32
-        List<T> copy = mappings.stream().filter(mapping -> mapping.getPatternParser() == null)
33
-                .collect(Collectors.toList());
34
-        mappings.clear();
35
-        mappings.addAll(copy);
36
-    }
37
-
38
-    @SuppressWarnings("unchecked")
39
-    private List<RequestMappingInfoHandlerMapping> getHandlerMappings(Object bean)
40
-    {
41
-        try
42
-        {
43
-            Field field = ReflectionUtils.findField(bean.getClass(), "handlerMappings");
44
-            field.setAccessible(true);
45
-            return (List<RequestMappingInfoHandlerMapping>) field.get(bean);
46
-        }
47
-        catch (IllegalArgumentException | IllegalAccessException e)
48
-        {
49
-            throw new IllegalStateException(e);
50
-        }
51
-    }
52
-}

+ 0 - 343
ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerProperties.java

@@ -1,343 +0,0 @@
1
-package com.ruoyi.common.swagger.config;
2
-
3
-import java.util.ArrayList;
4
-import java.util.List;
5
-import org.springframework.boot.context.properties.ConfigurationProperties;
6
-
7
-@ConfigurationProperties("swagger")
8
-public class SwaggerProperties
9
-{
10
-    /**
11
-     * 是否开启swagger
12
-     */
13
-    private Boolean enabled;
14
-
15
-    /**
16
-     * swagger会解析的包路径
17
-     **/
18
-    private String basePackage = "";
19
-
20
-    /**
21
-     * swagger会解析的url规则
22
-     **/
23
-    private List<String> basePath = new ArrayList<>();
24
-
25
-    /**
26
-     * 在basePath基础上需要排除的url规则
27
-     **/
28
-    private List<String> excludePath = new ArrayList<>();
29
-
30
-    /**
31
-     * 标题
32
-     **/
33
-    private String title = "";
34
-
35
-    /**
36
-     * 描述
37
-     **/
38
-    private String description = "";
39
-
40
-    /**
41
-     * 版本
42
-     **/
43
-    private String version = "";
44
-
45
-    /**
46
-     * 许可证
47
-     **/
48
-    private String license = "";
49
-
50
-    /**
51
-     * 许可证URL
52
-     **/
53
-    private String licenseUrl = "";
54
-
55
-    /**
56
-     * 服务条款URL
57
-     **/
58
-    private String termsOfServiceUrl = "";
59
-
60
-    /**
61
-     * host信息
62
-     **/
63
-    private String host = "";
64
-
65
-    /**
66
-     * 联系人信息
67
-     */
68
-    private Contact contact = new Contact();
69
-
70
-    /**
71
-     * 全局统一鉴权配置
72
-     **/
73
-    private Authorization authorization = new Authorization();
74
-
75
-    public Boolean getEnabled()
76
-    {
77
-        return enabled;
78
-    }
79
-
80
-    public void setEnabled(Boolean enabled)
81
-    {
82
-        this.enabled = enabled;
83
-    }
84
-
85
-    public String getBasePackage()
86
-    {
87
-        return basePackage;
88
-    }
89
-
90
-    public void setBasePackage(String basePackage)
91
-    {
92
-        this.basePackage = basePackage;
93
-    }
94
-
95
-    public List<String> getBasePath()
96
-    {
97
-        return basePath;
98
-    }
99
-
100
-    public void setBasePath(List<String> basePath)
101
-    {
102
-        this.basePath = basePath;
103
-    }
104
-
105
-    public List<String> getExcludePath()
106
-    {
107
-        return excludePath;
108
-    }
109
-
110
-    public void setExcludePath(List<String> excludePath)
111
-    {
112
-        this.excludePath = excludePath;
113
-    }
114
-
115
-    public String getTitle()
116
-    {
117
-        return title;
118
-    }
119
-
120
-    public void setTitle(String title)
121
-    {
122
-        this.title = title;
123
-    }
124
-
125
-    public String getDescription()
126
-    {
127
-        return description;
128
-    }
129
-
130
-    public void setDescription(String description)
131
-    {
132
-        this.description = description;
133
-    }
134
-
135
-    public String getVersion()
136
-    {
137
-        return version;
138
-    }
139
-
140
-    public void setVersion(String version)
141
-    {
142
-        this.version = version;
143
-    }
144
-
145
-    public String getLicense()
146
-    {
147
-        return license;
148
-    }
149
-
150
-    public void setLicense(String license)
151
-    {
152
-        this.license = license;
153
-    }
154
-
155
-    public String getLicenseUrl()
156
-    {
157
-        return licenseUrl;
158
-    }
159
-
160
-    public void setLicenseUrl(String licenseUrl)
161
-    {
162
-        this.licenseUrl = licenseUrl;
163
-    }
164
-
165
-    public String getTermsOfServiceUrl()
166
-    {
167
-        return termsOfServiceUrl;
168
-    }
169
-
170
-    public void setTermsOfServiceUrl(String termsOfServiceUrl)
171
-    {
172
-        this.termsOfServiceUrl = termsOfServiceUrl;
173
-    }
174
-
175
-    public String getHost()
176
-    {
177
-        return host;
178
-    }
179
-
180
-    public void setHost(String host)
181
-    {
182
-        this.host = host;
183
-    }
184
-
185
-    public Contact getContact()
186
-    {
187
-        return contact;
188
-    }
189
-
190
-    public void setContact(Contact contact)
191
-    {
192
-        this.contact = contact;
193
-    }
194
-
195
-    public Authorization getAuthorization()
196
-    {
197
-        return authorization;
198
-    }
199
-
200
-    public void setAuthorization(Authorization authorization)
201
-    {
202
-        this.authorization = authorization;
203
-    }
204
-
205
-    public static class Contact
206
-    {
207
-        /**
208
-         * 联系人
209
-         **/
210
-        private String name = "";
211
-        /**
212
-         * 联系人url
213
-         **/
214
-        private String url = "";
215
-        /**
216
-         * 联系人email
217
-         **/
218
-        private String email = "";
219
-
220
-        public String getName()
221
-        {
222
-            return name;
223
-        }
224
-
225
-        public void setName(String name)
226
-        {
227
-            this.name = name;
228
-        }
229
-
230
-        public String getUrl()
231
-        {
232
-            return url;
233
-        }
234
-
235
-        public void setUrl(String url)
236
-        {
237
-            this.url = url;
238
-        }
239
-
240
-        public String getEmail()
241
-        {
242
-            return email;
243
-        }
244
-
245
-        public void setEmail(String email)
246
-        {
247
-            this.email = email;
248
-        }
249
-    }
250
-
251
-    public static class Authorization
252
-    {
253
-        /**
254
-         * 鉴权策略ID,需要和SecurityReferences ID保持一致
255
-         */
256
-        private String name = "";
257
-
258
-        /**
259
-         * 需要开启鉴权URL的正则
260
-         */
261
-        private String authRegex = "^.*$";
262
-
263
-        /**
264
-         * 鉴权作用域列表
265
-         */
266
-        private List<AuthorizationScope> authorizationScopeList = new ArrayList<>();
267
-
268
-        private List<String> tokenUrlList = new ArrayList<>();
269
-
270
-        public String getName()
271
-        {
272
-            return name;
273
-        }
274
-
275
-        public void setName(String name)
276
-        {
277
-            this.name = name;
278
-        }
279
-
280
-        public String getAuthRegex()
281
-        {
282
-            return authRegex;
283
-        }
284
-
285
-        public void setAuthRegex(String authRegex)
286
-        {
287
-            this.authRegex = authRegex;
288
-        }
289
-
290
-        public List<AuthorizationScope> getAuthorizationScopeList()
291
-        {
292
-            return authorizationScopeList;
293
-        }
294
-
295
-        public void setAuthorizationScopeList(List<AuthorizationScope> authorizationScopeList)
296
-        {
297
-            this.authorizationScopeList = authorizationScopeList;
298
-        }
299
-
300
-        public List<String> getTokenUrlList()
301
-        {
302
-            return tokenUrlList;
303
-        }
304
-
305
-        public void setTokenUrlList(List<String> tokenUrlList)
306
-        {
307
-            this.tokenUrlList = tokenUrlList;
308
-        }
309
-    }
310
-
311
-    public static class AuthorizationScope
312
-    {
313
-        /**
314
-         * 作用域名称
315
-         */
316
-        private String scope = "";
317
-
318
-        /**
319
-         * 作用域描述
320
-         */
321
-        private String description = "";
322
-
323
-        public String getScope()
324
-        {
325
-            return scope;
326
-        }
327
-
328
-        public void setScope(String scope)
329
-        {
330
-            this.scope = scope;
331
-        }
332
-
333
-        public String getDescription()
334
-        {
335
-            return description;
336
-        }
337
-
338
-        public void setDescription(String description)
339
-        {
340
-            this.description = description;
341
-        }
342
-    }
343
-}

+ 0 - 20
ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerWebConfiguration.java

@@ -1,20 +0,0 @@
1
-package com.ruoyi.common.swagger.config;
2
-
3
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
4
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
5
-
6
-/**
7
- * swagger 资源映射路径
8
- * 
9
- * @author ruoyi
10
- */
11
-public class SwaggerWebConfiguration implements WebMvcConfigurer
12
-{
13
-    @Override
14
-    public void addResourceHandlers(ResourceHandlerRegistry registry)
15
-    {
16
-        /** swagger-ui 地址 */
17
-        registry.addResourceHandler("/swagger-ui/**")
18
-                .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/");
19
-    }
20
-}

+ 135 - 0
ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/properties/SpringDocProperties.java

@@ -0,0 +1,135 @@
1
+package com.ruoyi.common.swagger.config.properties;
2
+
3
+import org.springframework.boot.context.properties.ConfigurationProperties;
4
+import org.springframework.boot.context.properties.NestedConfigurationProperty;
5
+import io.swagger.v3.oas.models.info.Contact;
6
+import io.swagger.v3.oas.models.info.License;
7
+
8
+/**
9
+ * Swagger 配置属性
10
+ *
11
+ * @author ruoyi
12
+ */
13
+@ConfigurationProperties(prefix = "springdoc")
14
+public class SpringDocProperties
15
+{
16
+    /**
17
+     * 网关
18
+     */
19
+    private String gatewayUrl;
20
+
21
+    /**
22
+     * 文档基本信息
23
+     */
24
+    @NestedConfigurationProperty
25
+    private InfoProperties info = new InfoProperties();
26
+
27
+    /**
28
+     * <p>
29
+     * 文档的基础属性信息
30
+     * </p>
31
+     *
32
+     * @see io.swagger.v3.oas.models.info.Info
33
+     *
34
+     * 为了 springboot 自动生产配置提示信息,所以这里复制一个类出来
35
+     */
36
+    public static class InfoProperties
37
+    {
38
+        /**
39
+         * 标题
40
+         */
41
+        private String title = null;
42
+
43
+        /**
44
+         * 描述
45
+         */
46
+        private String description = null;
47
+
48
+        /**
49
+         * 联系人信息
50
+         */
51
+        @NestedConfigurationProperty
52
+        private Contact contact = null;
53
+
54
+        /**
55
+         * 许可证
56
+         */
57
+        @NestedConfigurationProperty
58
+        private License license = null;
59
+
60
+        /**
61
+         * 版本
62
+         */
63
+        private String version = null;
64
+
65
+        public String getTitle()
66
+        {
67
+            return title;
68
+        }
69
+
70
+        public void setTitle(String title)
71
+        {
72
+            this.title = title;
73
+        }
74
+
75
+        public String getDescription()
76
+        {
77
+            return description;
78
+        }
79
+
80
+        public void setDescription(String description)
81
+        {
82
+            this.description = description;
83
+        }
84
+
85
+        public Contact getContact()
86
+        {
87
+            return contact;
88
+        }
89
+
90
+        public void setContact(Contact contact)
91
+        {
92
+            this.contact = contact;
93
+        }
94
+
95
+        public License getLicense()
96
+        {
97
+            return license;
98
+        }
99
+
100
+        public void setLicense(License license)
101
+        {
102
+            this.license = license;
103
+        }
104
+
105
+        public String getVersion()
106
+        {
107
+            return version;
108
+        }
109
+
110
+        public void setVersion(String version)
111
+        {
112
+            this.version = version;
113
+        }
114
+    }
115
+
116
+    public String getGatewayUrl()
117
+    {
118
+        return gatewayUrl;
119
+    }
120
+
121
+    public void setGatewayUrl(String gatewayUrl)
122
+    {
123
+        this.gatewayUrl = gatewayUrl;
124
+    }
125
+
126
+    public InfoProperties getInfo()
127
+    {
128
+        return info;
129
+    }
130
+
131
+    public void setInfo(InfoProperties info)
132
+    {
133
+        this.info = info;
134
+    }
135
+}

+ 1 - 3
ruoyi-common/ruoyi-common-swagger/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -1,3 +1 @@
1
-# com.ruoyi.common.swagger.config.SwaggerAutoConfiguration
2
-# com.ruoyi.common.swagger.config.SwaggerWebConfiguration
3
-# com.ruoyi.common.swagger.config.SwaggerBeanPostProcessor
1
+com.ruoyi.common.swagger.config.SpringDocAutoConfiguration

+ 4 - 9
ruoyi-gateway/pom.xml

@@ -76,16 +76,11 @@
76 76
             <artifactId>ruoyi-common-redis</artifactId>
77 77
         </dependency>
78 78
 
79
-        <!-- Swagger -->
79
+        <!-- Springdoc -->
80 80
         <dependency>
81
-            <groupId>io.springfox</groupId>
82
-            <artifactId>springfox-swagger-ui</artifactId>
83
-            <version>${swagger.fox.version}</version>
84
-        </dependency>
85
-        <dependency>
86
-            <groupId>io.springfox</groupId>
87
-            <artifactId>springfox-swagger2</artifactId>
88
-            <version>${swagger.fox.version}</version>
81
+            <groupId>org.springdoc</groupId>
82
+            <artifactId>springdoc-openapi-webflux-ui</artifactId>
83
+            <version>${springdoc.version}</version>
89 84
         </dependency>
90 85
 
91 86
     </dependencies>

+ 93 - 0
ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/SpringDocConfig.java

@@ -0,0 +1,93 @@
1
+package com.ruoyi.gateway.config;
2
+
3
+import java.util.Set;
4
+import java.util.stream.Collectors;
5
+import org.springdoc.core.AbstractSwaggerUiConfigProperties;
6
+import org.springdoc.core.SwaggerUiConfigProperties;
7
+import org.springframework.beans.factory.InitializingBean;
8
+import org.springframework.beans.factory.annotation.Autowired;
9
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
10
+import org.springframework.cloud.client.discovery.DiscoveryClient;
11
+import org.springframework.context.annotation.Configuration;
12
+import com.alibaba.nacos.client.naming.event.InstancesChangeEvent;
13
+import com.alibaba.nacos.common.notify.Event;
14
+import com.alibaba.nacos.common.notify.NotifyCenter;
15
+import com.alibaba.nacos.common.notify.listener.Subscriber;
16
+import com.ruoyi.common.core.utils.StringUtils;
17
+
18
+/**
19
+ * SpringDoc配置类
20
+ *
21
+ * @author ruoyi
22
+ */
23
+@Configuration(proxyBeanMethods = false)
24
+@ConditionalOnProperty(value = "springdoc.api-docs.enabled", matchIfMissing = true)
25
+public class SpringDocConfig implements InitializingBean
26
+{
27
+    @Autowired
28
+    private SwaggerUiConfigProperties swaggerUiConfigProperties;
29
+
30
+    @Autowired
31
+    private DiscoveryClient discoveryClient;
32
+
33
+    /**
34
+     * 在初始化后调用的方法
35
+     */
36
+    @Override
37
+    public void afterPropertiesSet()
38
+    {
39
+        NotifyCenter.registerSubscriber(new SwaggerDocRegister(swaggerUiConfigProperties, discoveryClient));
40
+    }
41
+}
42
+
43
+/**
44
+ * Swagger文档注册器
45
+ */
46
+class SwaggerDocRegister extends Subscriber<InstancesChangeEvent>
47
+{
48
+    @Autowired
49
+    private SwaggerUiConfigProperties swaggerUiConfigProperties;
50
+
51
+    @Autowired
52
+    private DiscoveryClient discoveryClient;
53
+
54
+    private final static String[] EXCLUDE_ROUTES = new String[] { "ruoyi-gateway", "ruoyi-auth", "ruoyi-file", "ruoyi-monitor" };
55
+
56
+    public SwaggerDocRegister(SwaggerUiConfigProperties swaggerUiConfigProperties, DiscoveryClient discoveryClient)
57
+    {
58
+        this.swaggerUiConfigProperties = swaggerUiConfigProperties;
59
+        this.discoveryClient = discoveryClient;
60
+    }
61
+
62
+    /**
63
+     * 事件回调方法,处理InstancesChangeEvent事件
64
+     * @param event 事件对象
65
+     */
66
+    @Override
67
+    public void onEvent(InstancesChangeEvent event)
68
+    {
69
+        Set<AbstractSwaggerUiConfigProperties.SwaggerUrl> swaggerUrlSet = discoveryClient.getServices()
70
+            .stream()
71
+            .flatMap(serviceId -> discoveryClient.getInstances(serviceId).stream())
72
+            .filter(instance -> !StringUtils.equalsAnyIgnoreCase(instance.getServiceId(), EXCLUDE_ROUTES))
73
+            .map(instance -> {
74
+                AbstractSwaggerUiConfigProperties.SwaggerUrl swaggerUrl = new AbstractSwaggerUiConfigProperties.SwaggerUrl();
75
+                swaggerUrl.setName(instance.getServiceId());
76
+                swaggerUrl.setUrl(String.format("/%s/v3/api-docs", instance.getServiceId()));
77
+                return swaggerUrl;
78
+            })
79
+            .collect(Collectors.toSet());
80
+
81
+        swaggerUiConfigProperties.setUrls(swaggerUrlSet);
82
+    }
83
+
84
+    /**
85
+     * 订阅类型方法,返回订阅的事件类型
86
+     * @return 订阅的事件类型
87
+     */
88
+    @Override
89
+    public Class<? extends Event> subscribeType()
90
+    {
91
+        return InstancesChangeEvent.class;
92
+    }
93
+}

+ 0 - 79
ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/SwaggerProvider.java

@@ -1,79 +0,0 @@
1
-package com.ruoyi.gateway.config;
2
-
3
-import java.util.ArrayList;
4
-import java.util.List;
5
-import org.springframework.beans.factory.annotation.Autowired;
6
-import org.springframework.cloud.gateway.config.GatewayProperties;
7
-import org.springframework.cloud.gateway.route.RouteLocator;
8
-import org.springframework.cloud.gateway.support.NameUtils;
9
-import org.springframework.context.annotation.Lazy;
10
-import org.springframework.stereotype.Component;
11
-import org.springframework.web.reactive.config.ResourceHandlerRegistry;
12
-import org.springframework.web.reactive.config.WebFluxConfigurer;
13
-import springfox.documentation.swagger.web.SwaggerResource;
14
-import springfox.documentation.swagger.web.SwaggerResourcesProvider;
15
-
16
-/**
17
- * 聚合系统接口
18
- * 
19
- * @author ruoyi
20
- */
21
-@Component
22
-public class SwaggerProvider implements SwaggerResourcesProvider, WebFluxConfigurer
23
-{
24
-    /**
25
-     * Swagger2默认的url后缀
26
-     */
27
-    public static final String SWAGGER2URL = "/v2/api-docs";
28
-
29
-    /**
30
-     * 网关路由
31
-     */
32
-    @Lazy
33
-    @Autowired
34
-    private RouteLocator routeLocator;
35
-
36
-    @Autowired
37
-    private GatewayProperties gatewayProperties;
38
-
39
-    /**
40
-     * 聚合其他服务接口
41
-     * 
42
-     * @return
43
-     */
44
-    @Override
45
-    public List<SwaggerResource> get()
46
-    {
47
-        List<SwaggerResource> resourceList = new ArrayList<>();
48
-        List<String> routes = new ArrayList<>();
49
-        // 获取网关中配置的route
50
-        routeLocator.getRoutes().subscribe(route -> routes.add(route.getId()));
51
-        gatewayProperties.getRoutes().stream()
52
-                .filter(routeDefinition -> routes
53
-                        .contains(routeDefinition.getId()))
54
-                .forEach(routeDefinition -> routeDefinition.getPredicates().stream()
55
-                        .filter(predicateDefinition -> "Path".equalsIgnoreCase(predicateDefinition.getName()))
56
-                        .filter(predicateDefinition -> !"ruoyi-auth".equalsIgnoreCase(routeDefinition.getId()))
57
-                        .forEach(predicateDefinition -> resourceList
58
-                                .add(swaggerResource(routeDefinition.getId(), predicateDefinition.getArgs()
59
-                                        .get(NameUtils.GENERATED_NAME_PREFIX + "0").replace("/**", SWAGGER2URL)))));
60
-        return resourceList;
61
-    }
62
-
63
-    private SwaggerResource swaggerResource(String name, String location)
64
-    {
65
-        SwaggerResource swaggerResource = new SwaggerResource();
66
-        swaggerResource.setName(name);
67
-        swaggerResource.setLocation(location);
68
-        swaggerResource.setSwaggerVersion("2.0");
69
-        return swaggerResource;
70
-    }
71
-
72
-    @Override
73
-    public void addResourceHandlers(ResourceHandlerRegistry registry)
74
-    {
75
-        /** swagger-ui 地址 */
76
-        registry.addResourceHandler("/swagger-ui/**")
77
-                .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/");
78
-    }
79
-}

+ 1 - 1
ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/AuthFilter.java

@@ -101,7 +101,7 @@ public class AuthFilter implements GlobalFilter, Ordered
101 101
 
102 102
     private Mono<Void> unauthorizedResponse(ServerWebExchange exchange, String msg)
103 103
     {
104
-        log.error("[鉴权异常处理]请求路径:{}", exchange.getRequest().getPath());
104
+        log.error("[鉴权异常处理]请求路径:{},错误信息:{}", exchange.getRequest().getPath(), msg);
105 105
         return ServletUtils.webFluxResponseWriter(exchange.getResponse(), msg, HttpStatus.UNAUTHORIZED);
106 106
     }
107 107
 

+ 0 - 56
ruoyi-gateway/src/main/java/com/ruoyi/gateway/handler/SwaggerHandler.java

@@ -1,56 +0,0 @@
1
-package com.ruoyi.gateway.handler;
2
-
3
-import java.util.Optional;
4
-import org.springframework.beans.factory.annotation.Autowired;
5
-import org.springframework.http.HttpStatus;
6
-import org.springframework.http.ResponseEntity;
7
-import org.springframework.web.bind.annotation.GetMapping;
8
-import org.springframework.web.bind.annotation.RequestMapping;
9
-import org.springframework.web.bind.annotation.RestController;
10
-import reactor.core.publisher.Mono;
11
-import springfox.documentation.swagger.web.SecurityConfiguration;
12
-import springfox.documentation.swagger.web.SecurityConfigurationBuilder;
13
-import springfox.documentation.swagger.web.SwaggerResourcesProvider;
14
-import springfox.documentation.swagger.web.UiConfiguration;
15
-import springfox.documentation.swagger.web.UiConfigurationBuilder;
16
-
17
-@RestController
18
-@RequestMapping("/swagger-resources")
19
-public class SwaggerHandler
20
-{
21
-    @Autowired(required = false)
22
-    private SecurityConfiguration securityConfiguration;
23
-
24
-    @Autowired(required = false)
25
-    private UiConfiguration uiConfiguration;
26
-
27
-    private final SwaggerResourcesProvider swaggerResources;
28
-
29
-    @Autowired
30
-    public SwaggerHandler(SwaggerResourcesProvider swaggerResources)
31
-    {
32
-        this.swaggerResources = swaggerResources;
33
-    }
34
-
35
-    @GetMapping("/configuration/security")
36
-    public Mono<ResponseEntity<SecurityConfiguration>> securityConfiguration()
37
-    {
38
-        return Mono.just(new ResponseEntity<>(
39
-                Optional.ofNullable(securityConfiguration).orElse(SecurityConfigurationBuilder.builder().build()),
40
-                HttpStatus.OK));
41
-    }
42
-
43
-    @GetMapping("/configuration/ui")
44
-    public Mono<ResponseEntity<UiConfiguration>> uiConfiguration()
45
-    {
46
-        return Mono.just(new ResponseEntity<>(
47
-                Optional.ofNullable(uiConfiguration).orElse(UiConfigurationBuilder.builder().build()), HttpStatus.OK));
48
-    }
49
-
50
-    @SuppressWarnings("rawtypes")
51
-    @GetMapping("")
52
-    public Mono<ResponseEntity> swaggerResources()
53
-    {
54
-        return Mono.just((new ResponseEntity<>(swaggerResources.get(), HttpStatus.OK)));
55
-    }
56
-}

+ 6 - 6
ruoyi-modules/ruoyi-file/pom.xml

@@ -40,6 +40,12 @@
40 40
             <groupId>org.springframework.boot</groupId>
41 41
             <artifactId>spring-boot-starter-actuator</artifactId>
42 42
         </dependency>
43
+        
44
+        <!-- SpringBoot Web -->
45
+        <dependency>
46
+            <groupId>org.springframework.boot</groupId>
47
+            <artifactId>spring-boot-starter-web</artifactId>
48
+        </dependency>
43 49
 		
44 50
         <!-- FastDFS -->
45 51
         <dependency>
@@ -60,12 +66,6 @@
60 66
             <artifactId>ruoyi-api-system</artifactId>
61 67
         </dependency>
62 68
         
63
-        <!-- RuoYi Common Swagger -->
64
-        <dependency>
65
-            <groupId>com.ruoyi</groupId>
66
-            <artifactId>ruoyi-common-swagger</artifactId>
67
-        </dependency>
68
-        
69 69
     </dependencies>
70 70
 
71 71
     <build>

+ 0 - 2
ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/RuoYiFileApplication.java

@@ -3,14 +3,12 @@ package com.ruoyi.file;
3 3
 import org.springframework.boot.SpringApplication;
4 4
 import org.springframework.boot.autoconfigure.SpringBootApplication;
5 5
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
6
-import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
7 6
 
8 7
 /**
9 8
  * 文件服务
10 9
  * 
11 10
  * @author ruoyi
12 11
  */
13
-@EnableCustomSwagger2
14 12
 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
15 13
 public class RuoYiFileApplication
16 14
 {

+ 0 - 7
ruoyi-modules/ruoyi-gen/pom.xml

@@ -40,13 +40,6 @@
40 40
             <groupId>org.springframework.boot</groupId>
41 41
             <artifactId>spring-boot-starter-actuator</artifactId>
42 42
         </dependency>
43
-		
44
-        <!-- Swagger UI -->
45
-        <dependency>
46
-            <groupId>io.springfox</groupId>
47
-            <artifactId>springfox-swagger-ui</artifactId>
48
-            <version>${swagger.fox.version}</version>
49
-        </dependency>
50 43
         
51 44
         <!-- Apache Velocity -->
52 45
         <dependency>

+ 0 - 2
ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/RuoYiGenApplication.java

@@ -4,7 +4,6 @@ import org.springframework.boot.SpringApplication;
4 4
 import org.springframework.boot.autoconfigure.SpringBootApplication;
5 5
 import com.ruoyi.common.security.annotation.EnableCustomConfig;
6 6
 import com.ruoyi.common.security.annotation.EnableRyFeignClients;
7
-import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
8 7
 
9 8
 /**
10 9
  * 代码生成
@@ -12,7 +11,6 @@ import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
12 11
  * @author ruoyi
13 12
  */
14 13
 @EnableCustomConfig
15
-@EnableCustomSwagger2
16 14
 @EnableRyFeignClients
17 15
 @SpringBootApplication
18 16
 public class RuoYiGenApplication

+ 0 - 1
ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/domain/GenTableColumn.java

@@ -1,7 +1,6 @@
1 1
 package com.ruoyi.gen.domain;
2 2
 
3 3
 import javax.validation.constraints.NotBlank;
4
-
5 4
 import com.ruoyi.common.core.utils.StringUtils;
6 5
 import com.ruoyi.common.core.web.domain.BaseEntity;
7 6
 

+ 1 - 8
ruoyi-modules/ruoyi-job/pom.xml

@@ -40,14 +40,7 @@
40 40
             <groupId>org.springframework.boot</groupId>
41 41
             <artifactId>spring-boot-starter-actuator</artifactId>
42 42
         </dependency>
43
-		
44
-        <!-- Swagger UI -->
45
-        <dependency>
46
-            <groupId>io.springfox</groupId>
47
-            <artifactId>springfox-swagger-ui</artifactId>
48
-            <version>${swagger.fox.version}</version>
49
-        </dependency>
50
-		
43
+        
51 44
         <!-- Quartz -->
52 45
         <dependency>
53 46
             <groupId>org.quartz-scheduler</groupId>

+ 0 - 2
ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/RuoYiJobApplication.java

@@ -4,7 +4,6 @@ import org.springframework.boot.SpringApplication;
4 4
 import org.springframework.boot.autoconfigure.SpringBootApplication;
5 5
 import com.ruoyi.common.security.annotation.EnableCustomConfig;
6 6
 import com.ruoyi.common.security.annotation.EnableRyFeignClients;
7
-import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
8 7
 
9 8
 /**
10 9
  * 定时任务
@@ -12,7 +11,6 @@ import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
12 11
  * @author ruoyi
13 12
  */
14 13
 @EnableCustomConfig
15
-@EnableCustomSwagger2
16 14
 @EnableRyFeignClients   
17 15
 @SpringBootApplication
18 16
 public class RuoYiJobApplication

+ 1 - 8
ruoyi-modules/ruoyi-system/pom.xml

@@ -40,14 +40,7 @@
40 40
             <groupId>org.springframework.boot</groupId>
41 41
             <artifactId>spring-boot-starter-actuator</artifactId>
42 42
         </dependency>
43
-		
44
-        <!-- Swagger UI -->
45
-        <dependency>
46
-            <groupId>io.springfox</groupId>
47
-            <artifactId>springfox-swagger-ui</artifactId>
48
-            <version>${swagger.fox.version}</version>
49
-        </dependency>
50
-		
43
+        
51 44
         <!-- Mysql Connector -->
52 45
         <dependency>
53 46
             <groupId>com.mysql</groupId>

+ 0 - 2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/RuoYiSystemApplication.java

@@ -4,7 +4,6 @@ import org.springframework.boot.SpringApplication;
4 4
 import org.springframework.boot.autoconfigure.SpringBootApplication;
5 5
 import com.ruoyi.common.security.annotation.EnableCustomConfig;
6 6
 import com.ruoyi.common.security.annotation.EnableRyFeignClients;
7
-import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
8 7
 
9 8
 /**
10 9
  * 系统模块
@@ -12,7 +11,6 @@ import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
12 11
  * @author ruoyi
13 12
  */
14 13
 @EnableCustomConfig
15
-@EnableCustomSwagger2
16 14
 @EnableRyFeignClients
17 15
 @SpringBootApplication
18 16
 public class RuoYiSystemApplication

File diff suppressed because it is too large
+ 7 - 7
sql/ry_config_20231204.sql