Browse Source

修改自动生成接口文档范围

(cherry picked from commit ff58a1dd26)
pull/5734/head
EightMonth 11 months ago
parent
commit
654676d15b
  1. 5
      jeecg-boot-base-core/src/main/java/org/jeecg/config/Swagger3Config.java

5
jeecg-boot-base-core/src/main/java/org/jeecg/config/Swagger3Config.java

@ -1,5 +1,6 @@
package org.jeecg.config;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Paths;
@ -38,6 +39,10 @@ public class Swagger3Config implements WebMvcConfigurer {
return GroupedOpenApi.builder()
.group("default")
.packagesToScan("org.jeecg")
// 剔除以下几个包路径的接口生成文档
.packagesToExclude("org.jeecg.modules.drag", "org.jeecg.modules.online", "org.jeecg.modules.jmreport")
// 加了Operation注解的方法,才生成接口文档
.addOpenApiMethodFilter(method -> method.isAnnotationPresent(Operation.class))
.build();
}

Loading…
Cancel
Save