Skip to content

Commit

Permalink
fix gitee #I3T6UV .
Browse files Browse the repository at this point in the history
  • Loading branch information
shalousun committed May 29, 2021
1 parent 05f1432 commit c9441c6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
- 更新内容:
1. 修复inlineEnum为false时枚举展示在参数中的问题。
2. 返回Spring文件下载对象支持自动识别为文件下载,减少手动标记@download tag。
3. smart-doc使用的css cdn更换,默认使用国内cdn,提升国内的加载速度,切换英文环境使用google的cdn.
4. 多层泛型嵌套的解析支持。gitee #I3T6UV .
#### 版本号:2.1.8

- 更新日期: 2020-05-22
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/power/doc/helper/JsonBuildHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,14 @@ public static String buildJson(String typeName, String genericCanonicalName,
Object value = JavaClassUtil.getEnumValue(javaClass, Boolean.FALSE);
data0.append(value).append(",");
} else {
String[] gNameArr = DocClassUtil.getSimpleGicName(fieldGicName);
if (gNameArr.length > 0) {
String gName = gNameArr[0];
if (gName.length() == 1) {
String gicName = genericMap.get(gName) != null ? genericMap.get(gName) : globGicName[0];
fieldGicName = fieldGicName.replace(gName,gicName);
}
}
data0.append(buildJson(subTypeName, fieldGicName, isResp, nextLevel, registryClasses, builder)).append(",");
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/power/doc/helper/ParamsBuildHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,14 @@ public static List<ApiParam> buildParams(String className, String pre, int level
} else {
commonHandleParam(paramList, param, isRequired, NO_COMMENTS_FOUND + appendComment, since, strRequired);
}
String[] gNameArr = DocClassUtil.getSimpleGicName(fieldGicName);
if (gNameArr.length > 0) {
String gName = gNameArr[0];
if (gName.length() == 1) {
String gicName = genericMap.get(gName) != null ? genericMap.get(gName) : globGicName[0];
fieldGicName = fieldGicName.replace(gName,gicName);
}
}
fieldPid = paramList.size() + pid;
paramList.addAll(buildParams(fieldGicName, preBuilder.toString(), nextLevel, isRequired,
isResp, registryClasses, projectBuilder, groupClasses, fieldPid, jsonRequest));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public static boolean isIgnoreTag(String tagName) {
/**
* Download
* @param typeName return type name
* @return
* @return boolean
*/
public static boolean isFileDownloadResource(String typeName){
switch (typeName) {
Expand Down

0 comments on commit c9441c6

Please sign in to comment.