From 37bcd3ff7c105f7afcdc5ca322082931e0649c2f Mon Sep 17 00:00:00 2001 From: Forget <1771761586@qq.com> Date: Sat, 29 May 2021 14:31:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Etorna=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/power/doc/builder/TornaBuilder.java | 1 + .../java/com/power/doc/builder/rpc/RpcTornaBuilder.java | 1 + src/main/java/com/power/doc/model/torna/Apis.java | 9 +++++++++ src/main/java/com/power/doc/utils/TornaUtil.java | 2 ++ 4 files changed, 13 insertions(+) diff --git a/src/main/java/com/power/doc/builder/TornaBuilder.java b/src/main/java/com/power/doc/builder/TornaBuilder.java index 8191573c..463ba163 100644 --- a/src/main/java/com/power/doc/builder/TornaBuilder.java +++ b/src/main/java/com/power/doc/builder/TornaBuilder.java @@ -98,6 +98,7 @@ public static void buildTorna(List 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)); diff --git a/src/main/java/com/power/doc/builder/rpc/RpcTornaBuilder.java b/src/main/java/com/power/doc/builder/rpc/RpcTornaBuilder.java index db931b48..b9a2f767 100644 --- a/src/main/java/com/power/doc/builder/rpc/RpcTornaBuilder.java +++ b/src/main/java/com/power/doc/builder/rpc/RpcTornaBuilder.java @@ -100,6 +100,7 @@ public static void buildTorna(List 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)); diff --git a/src/main/java/com/power/doc/model/torna/Apis.java b/src/main/java/com/power/doc/model/torna/Apis.java index b99abdcc..c1483672 100644 --- a/src/main/java/com/power/doc/model/torna/Apis.java +++ b/src/main/java/com/power/doc/model/torna/Apis.java @@ -37,6 +37,7 @@ public class Apis { private String parentId; private String isShow; private String author; + private Integer orderIndex; private DubboInfo dubboInfo; private List headerParams; private List pathParams; @@ -46,6 +47,14 @@ public class Apis { private String errorCodeParams; private List items; + public Integer getOrderIndex() { + return orderIndex; + } + + public void setOrderIndex(Integer orderIndex) { + this.orderIndex = orderIndex; + } + public String getAuthor() { return author; } diff --git a/src/main/java/com/power/doc/utils/TornaUtil.java b/src/main/java/com/power/doc/utils/TornaUtil.java index ae0b511d..dadf5764 100644 --- a/src/main/java/com/power/doc/utils/TornaUtil.java +++ b/src/main/java/com/power/doc/utils/TornaUtil.java @@ -92,6 +92,7 @@ public static List buildApis(List 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())); @@ -132,6 +133,7 @@ public static List buildDubboApis(List 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()));