Skip to content

Commit

Permalink
新增torna排序
Browse files Browse the repository at this point in the history
  • Loading branch information
netdied committed May 29, 2021
1 parent c9441c6 commit 37bcd3f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
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 @@ -98,6 +98,7 @@ public static void buildTorna(List<ApiDoc> apiDocs, ApiConfig apiConfig, JavaPro
api.setItems(buildApis(a.getList(), TornaUtil.setDebugEnv(apiConfig, tornaApi)));
api.setIsFolder(TornaConstants.YES);
api.setAuthor(a.getAuthor());
api.setOrderIndex(a.getOrder());
apisList.add(api);
}
tornaApi.setCommonErrorCodes(buildErrorCode(apiConfig));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public static void buildTorna(List<RpcApiDoc> apiDocs, ApiConfig apiConfig,JavaP
.setVersion(a.getVersion())
.setDependency(TornaUtil.buildDependencies(apiConfig.getRpcApiDependencies()))
.setInterfaceName(a.getName()));
api.setOrderIndex(a.getOrder());
apisList.add(api);
}
tornaApi.setCommonErrorCodes(buildErrorCode(apiConfig));
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/power/doc/model/torna/Apis.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class Apis {
private String parentId;
private String isShow;
private String author;
private Integer orderIndex;
private DubboInfo dubboInfo;
private List<HttpParam> headerParams;
private List<HttpParam> pathParams;
Expand All @@ -46,6 +47,14 @@ public class Apis {
private String errorCodeParams;
private List<Apis> items;

public Integer getOrderIndex() {
return orderIndex;
}

public void setOrderIndex(Integer orderIndex) {
this.orderIndex = orderIndex;
}

public String getAuthor() {
return author;
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/power/doc/utils/TornaUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public static List<Apis> buildApis(List<ApiMethodDoc> apiMethodDocs, boolean has
methodApi.setDescription(apiMethodDoc.getDetail());
methodApi.setIsShow(TornaConstants.YES);
methodApi.setAuthor(apiMethodDoc.getAuthor());
methodApi.setOrderIndex(apiMethodDoc.getOrder());

methodApi.setHeaderParams(buildHerder(apiMethodDoc.getRequestHeaders()));
methodApi.setResponseParams(buildParams(apiMethodDoc.getResponseParams()));
Expand Down Expand Up @@ -132,6 +133,7 @@ public static List<Apis> buildDubboApis(List<JavaMethodDoc> apiMethodDocs) {
methodApi.setAuthor(apiMethodDoc.getAuthor());
methodApi.setUrl(apiMethodDoc.getMethodDefinition());
methodApi.setResponseParams(buildParams(apiMethodDoc.getResponseParams()));
methodApi.setOrderIndex(apiMethodDoc.getOrder());
//Json
if (CollectionUtil.isNotEmpty(apiMethodDoc.getRequestParams())) {
methodApi.setRequestParams(buildParams(apiMethodDoc.getRequestParams()));
Expand Down

0 comments on commit 37bcd3f

Please sign in to comment.