修改自动秣接口文档范围

pull/5730/head
EightMonth 2023-12-28 10:43:58 +08:00
parent 33c0104a02
commit 9e4792941e
1 changed files with 5 additions and 0 deletions

View File

@ -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;
@ -35,6 +36,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();
}