Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
netdied committed Jul 29, 2020
2 parents 068904f + 4ab3276 commit 02da8be
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ public ApiReturn process() {
return apiReturn;
}
}
return apiReturn;
return null;
}
}
3 changes: 1 addition & 2 deletions src/main/java/com/power/doc/helper/ParamsBuildHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,9 @@ public static List<ApiParam> primitiveReturnRespComment(String typeName) {
private static void commonHandleParam(List<ApiParam> 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);
}
}
31 changes: 7 additions & 24 deletions src/main/java/com/power/doc/utils/DocClassUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/power/doc/utils/DocUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
18 changes: 0 additions & 18 deletions src/main/java/com/power/doc/utils/JavaClassValidateUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 02da8be

Please sign in to comment.