diff --git a/src/main/java/com/power/doc/filter/ReturnTypeProcessor.java b/src/main/java/com/power/doc/filter/ReturnTypeProcessor.java index 9f035b5d..279e4b71 100644 --- a/src/main/java/com/power/doc/filter/ReturnTypeProcessor.java +++ b/src/main/java/com/power/doc/filter/ReturnTypeProcessor.java @@ -56,6 +56,6 @@ public ApiReturn process() { return apiReturn; } } - return apiReturn; + return null; } } diff --git a/src/main/java/com/power/doc/helper/ParamsBuildHelper.java b/src/main/java/com/power/doc/helper/ParamsBuildHelper.java index 0980dff9..fbe02c07 100644 --- a/src/main/java/com/power/doc/helper/ParamsBuildHelper.java +++ b/src/main/java/com/power/doc/helper/ParamsBuildHelper.java @@ -391,10 +391,9 @@ public static List primitiveReturnRespComment(String typeName) { private static void commonHandleParam(List paramList, ApiParam param, String isRequired, String comment, String since, boolean strRequired) { if (StringUtil.isEmpty(isRequired)) { param.setDesc(comment).setVersion(since); - paramList.add(param); } else { param.setDesc(comment).setVersion(since).setRequired(strRequired); - paramList.add(param); } + paramList.add(param); } } diff --git a/src/main/java/com/power/doc/utils/DocClassUtil.java b/src/main/java/com/power/doc/utils/DocClassUtil.java index 37548487..7eeec962 100644 --- a/src/main/java/com/power/doc/utils/DocClassUtil.java +++ b/src/main/java/com/power/doc/utils/DocClassUtil.java @@ -167,59 +167,42 @@ public static String processTypeNameForParams(String javaTypeName) { } switch (javaTypeName) { case "java.lang.String": - return "string"; case "string": - return "string"; case "char": + case "java.util.Byte": + case "byte": + case "date": + case "localdatetime": + case "localdate": + case "localtime": + case "timestamp": return "string"; case "java.util.List": - return "array"; case "list": return "array"; case "java.lang.Integer": - return "int32"; case "integer": - return "int32"; case "int": return "int32"; case "short": - return "int16"; case "java.lang.Short": return "int16"; case "double": return "double"; case "java.lang.Long": - return "int64"; case "long": return "int64"; case "java.lang.Float": - return "float"; case "float": return "float"; case "bigdecimal": - return "number"; case "biginteger": return "number"; case "java.lang.Boolean": - return "boolean"; case "boolean": return "boolean"; - case "java.util.Byte": - return "string"; - case "byte": - return "string"; case "map": return "map"; - case "date": - return "string"; - case "localdatetime": - return "string"; - case "localdate": - return "string"; - case "localtime": - return "string"; - case "timestamp": - return "string"; case "multipartfile": return "file"; default: diff --git a/src/main/java/com/power/doc/utils/DocUtil.java b/src/main/java/com/power/doc/utils/DocUtil.java index 42e7cabc..7ef2bddd 100644 --- a/src/main/java/com/power/doc/utils/DocUtil.java +++ b/src/main/java/com/power/doc/utils/DocUtil.java @@ -280,8 +280,6 @@ public static String handleHttpMethod(String method) { switch (method) { case "RequestMethod.POST": return "POST"; - case "RequestMethod.GET": - return "GET"; case "RequestMethod.PUT": return "PUT"; case "RequestMethod.DELETE": diff --git a/src/main/java/com/power/doc/utils/JavaClassValidateUtil.java b/src/main/java/com/power/doc/utils/JavaClassValidateUtil.java index 41fe5edc..feb568e3 100644 --- a/src/main/java/com/power/doc/utils/JavaClassValidateUtil.java +++ b/src/main/java/com/power/doc/utils/JavaClassValidateUtil.java @@ -107,23 +107,14 @@ public static boolean isPrimitive(String type0) { public static boolean isCollection(String type) { switch (type) { case "java.util.List": - return true; case "java.util.LinkedList": - return true; case "java.util.ArrayList": - return true; case "java.util.Set": - return true; case "java.util.TreeSet": - return true; case "java.util.HashSet": - return true; case "java.util.SortedSet": - return true; case "java.util.Collection": - return true; case "java.util.ArrayDeque": - return true; case "java.util.PriorityQueue": return true; default: @@ -140,21 +131,13 @@ public static boolean isCollection(String type) { public static boolean isMap(String type) { switch (type) { case "java.util.Map": - return true; case "java.util.SortedMap": - return true; case "java.util.TreeMap": - return true; case "java.util.LinkedHashMap": - return true; case "java.util.HashMap": - return true; case "java.util.concurrent.ConcurrentHashMap": - return true; case "java.util.concurrent.ConcurrentMap": - return true; case "java.util.Properties": - return true; case "java.util.Hashtable": return true; default: @@ -253,7 +236,6 @@ public static boolean isMvcIgnoreParams(String paramType) { public static boolean isIgnoreFieldTypes(String typeName) { switch (typeName) { case "org.slf4j.Logger": - return true; case "org.apache.ibatis.logging.Log": return true; default: