This commit is contained in:
六如
2024-11-10 23:17:17 +08:00
parent 0498d0f7b5
commit 1ee4b2384c
36 changed files with 178 additions and 382 deletions

View File

@@ -17,10 +17,10 @@ import java.nio.charset.StandardCharsets;
public class SwaggerPlugin {
/**
* 推送文档,前提:把<code>doc-plugin.json</code>文件复制到resources下
* 推送文档,前提:把<code>doc.json</code>文件复制到resources下
*/
public static void pushDoc() {
pushDoc("doc-plugin.json");
pushDoc("doc.json");
}
/**

View File

@@ -58,7 +58,6 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import springfox.documentation.annotations.ApiIgnore;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
@@ -352,12 +351,12 @@ public class SwaggerPluginService {
if (apiOperation.hidden()) {
throw new HiddenException("Hidden API@ApiOperation.hidden=true" + apiOperation.value());
}
if (existsApiIgnore) {
ApiIgnore apiIgnore = method.getAnnotation(ApiIgnore.class);
if (apiIgnore != null) {
throw new IgnoreException("Ignore API@ApiIgnore" + apiOperation.value());
}
}
// if (existsApiIgnore) {
// ApiIgnore apiIgnore = method.getAnnotation(ApiIgnore.class);
// if (apiIgnore != null) {
// throw new IgnoreException("Ignore API@ApiIgnore" + apiOperation.value());
// }
// }
return doBuildDocItem(requestInfoBuilder);
}
@@ -918,12 +917,12 @@ public class SwaggerPluginService {
if (api != null && api.hidden()) {
throw new HiddenException("Hidden doc@Api.hidden=true" + api.value());
}
if (existsApiIgnore) {
ApiIgnore apiIgnore = AnnotationUtils.findAnnotation(controllerClass, ApiIgnore.class);
if (apiIgnore != null) {
throw new IgnoreException("Ignore doc@ApiIgnore" + controllerClass.getName());
}
}
// if (existsApiIgnore) {
// ApiIgnore apiIgnore = AnnotationUtils.findAnnotation(controllerClass, ApiIgnore.class);
// if (apiIgnore != null) {
// throw new IgnoreException("Ignore doc@ApiIgnore" + controllerClass.getName());
// }
// }
String name, description;
int position = 0;
if (api == null) {