From 654676d15b4cbc6b387079747759c283442e2d56 Mon Sep 17 00:00:00 2001 From: EightMonth Date: Thu, 28 Dec 2023 10:42:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E5=8A=A8=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=8E=A5=E5=8F=A3=E6=96=87=E6=A1=A3=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit ff58a1dd265bb1b514f2a887f5a9ddce5d99e816) --- .../src/main/java/org/jeecg/config/Swagger3Config.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/config/Swagger3Config.java b/jeecg-boot-base-core/src/main/java/org/jeecg/config/Swagger3Config.java index 044e9d6f..eec425ee 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/config/Swagger3Config.java +++ b/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(); }