Skip to content

Commit 96cd0fd

Browse files
committed
删除无用转换
1 parent ae76699 commit 96cd0fd

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

apidoc-core/src/main/java/com/ztianzeng/apidoc/ModelConverters.java

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.ztianzeng.apidoc;
22

3-
import com.fasterxml.jackson.databind.type.TypeFactory;
43
import com.thoughtworks.qdox.model.JavaClass;
54
import com.ztianzeng.apidoc.converter.AnnotatedType;
65
import com.ztianzeng.apidoc.converter.ModelConverter;
@@ -83,8 +82,9 @@ public Schema resolve(Type type) {
8382
public Schema resolve(JavaClass type) {
8483
return resolve(new AnnotatedType().javaClass(type));
8584
}
85+
8686
public Schema resolve(AnnotatedType type) {
87-
if (shouldProcess(type.getType())) {
87+
if (shouldProcess(type.getJavaClass())) {
8888
ModelConverterContextImpl context = new ModelConverterContextImpl(converters);
8989

9090
log.debug("ModelConverters readAll from " + type);
@@ -93,20 +93,6 @@ public Schema resolve(AnnotatedType type) {
9393
return null;
9494
}
9595

96-
@Deprecated
97-
private boolean shouldProcess(Type type) {
98-
final Class<?> cls = TypeFactory.defaultInstance().constructType(type).getRawClass();
99-
if (cls.isPrimitive()) {
100-
return false;
101-
}
102-
String className = cls.getName();
103-
for (String packageName : skippedPackages) {
104-
if (className.startsWith(packageName)) {
105-
return false;
106-
}
107-
}
108-
return !skippedClasses.contains(className);
109-
}
11096

11197
private boolean shouldProcess(JavaClass javaClass) {
11298
if (javaClass.isPrimitive()) {
@@ -123,7 +109,7 @@ private boolean shouldProcess(JavaClass javaClass) {
123109

124110

125111
public ResolvedSchema readAllAsResolvedSchema(AnnotatedType type) {
126-
if (shouldProcess(type.getType())) {
112+
if (shouldProcess(type.getJavaClass())) {
127113
ModelConverterContextImpl context = new ModelConverterContextImpl(
128114
converters);
129115

0 commit comments

Comments
 (0)