Skip to content

Commit

Permalink
fix gitee #I43JQR #I43555 add isReplace property
Browse files Browse the repository at this point in the history
  • Loading branch information
xzli15 committed Aug 7, 2021
1 parent bfb9fe0 commit 31fbc38
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
2. 新增jsr303 @size@length支持。
3. 修改html的模板样式错误。
4. 修复postman错误#I41G2E 。
5. 新增isReplace配置 。
6. 修复当存在多个jsr注解时,部分注解失效问题。
#### 版本号:2.2.3

- 更新日期: 2021-07-18
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ When you need to use smart-doc to generate more API document information, you ca
"appKey": "xxx",// torna appKey, @since 2.0.9
"appToken": "xxx", //torna appToken,@since 2.0.9
"secret": "xx",//torna secret,@since 2.0.9
"isReplace":true, torna replace doc @since 2.2.4
"openUrl": "torna server/api/",//torna server url,@since 2.0.9
"tornaDebug":false,"// show log while set true
"ignoreRequestParams":[ //The request parameter object will be discarded when generating the document.@since 1.9.2
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/power/doc/builder/TornaBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public static void buildTorna(List<ApiDoc> apiDocs, ApiConfig apiConfig, JavaPro
}
tornaApi.setCommonErrorCodes(buildErrorCode(apiConfig));
tornaApi.setApis(apisList);
tornaApi.setIsReplace(apiConfig.isReplace() ? 1 : 0);
//推送文档信息
Map<String, String> requestJson = TornaConstants.buildParams(PUSH, new Gson().toJson(tornaApi), apiConfig);
//推送字典信息
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/power/doc/helper/ParamsBuildHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static List<ApiParam> buildParams(String className, String pre, int level
registryClasses, projectBuilder, groupClasses, pid, jsonRequest));
}
} else if (DocGlobalConstants.JAVA_OBJECT_FULLY.equals(className)) {
ApiParam param = ApiParam.of().setField(pre + "any object").setType("object").setPid(pid);
ApiParam param = ApiParam.of().setId(pid + 1).setField(pre + "any object").setType("object").setPid(pid);
if (StringUtil.isEmpty(isRequired)) {
param.setDesc(DocGlobalConstants.ANY_OBJECT_MSG).setVersion(DocGlobalConstants.DEFAULT_VERSION);
} else {
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/com/power/doc/model/torna/TornaApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ public class TornaApi {
List<Apis> apis;
String author;
List<CommonErrorCode> commonErrorCodes;
/**
* 是否替换文档,1:替换,0:不替换(追加)。缺省:1
*/
Integer isReplace;

public Integer getIsReplace() {
return isReplace;
}

public void setIsReplace(Integer isReplace) {
this.isReplace = isReplace;
}

public String getAuthor() {
return author;
Expand Down

0 comments on commit 31fbc38

Please sign in to comment.