Merge remote-tracking branch 'origin/dev'
This commit is contained in:
commit
52811aa500
|
@ -1,5 +1,10 @@
|
||||||
## smart-doc版本
|
## smart-doc版本
|
||||||
版本小于1.0都属于试用,正式1.0起始发布将会等到文中提到的问题解决后才发布。
|
版本小于1.0都属于试用,正式1.0起始发布将会等到文中提到的问题解决后才发布。
|
||||||
|
#### 版本号:2.1.5
|
||||||
|
- 更新日期: 2020-05-05
|
||||||
|
- 更新内容:
|
||||||
|
1. 修复requestBodyAdvice请求样例丢之。
|
||||||
|
2. 添加dubbo文档到torna的推送。
|
||||||
#### 版本号:2.1.4
|
#### 版本号:2.1.4
|
||||||
- 更新日期: 2020-04-24
|
- 更新日期: 2020-04-24
|
||||||
- 更新内容:
|
- 更新内容:
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -5,7 +5,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>smart-doc</artifactId>
|
<artifactId>smart-doc</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>2.1.4</version>
|
<version>2.1.5</version>
|
||||||
|
|
||||||
<name>smart-doc</name>
|
<name>smart-doc</name>
|
||||||
<url>https://github.com/smart-doc-group/smart-doc.git</url>
|
<url>https://github.com/smart-doc-group/smart-doc.git</url>
|
||||||
|
|
|
@ -34,6 +34,7 @@ import com.power.doc.constants.TornaConstants;
|
||||||
import com.power.doc.model.*;
|
import com.power.doc.model.*;
|
||||||
import com.power.doc.model.torna.*;
|
import com.power.doc.model.torna.*;
|
||||||
import com.power.doc.template.SpringBootDocBuildTemplate;
|
import com.power.doc.template.SpringBootDocBuildTemplate;
|
||||||
|
import com.power.doc.utils.TornaUtil;
|
||||||
import com.thoughtworks.qdox.JavaProjectBuilder;
|
import com.thoughtworks.qdox.JavaProjectBuilder;
|
||||||
import okhttp3.*;
|
import okhttp3.*;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
@ -47,6 +48,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import static com.power.doc.constants.TornaConstants.CATEGORY_CREATE;
|
import static com.power.doc.constants.TornaConstants.CATEGORY_CREATE;
|
||||||
import static com.power.doc.constants.TornaConstants.PUSH;
|
import static com.power.doc.constants.TornaConstants.PUSH;
|
||||||
|
import static com.power.doc.utils.TornaUtil.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -87,212 +89,24 @@ public class TornaBuilder {
|
||||||
* @param apiConfig ApiConfig
|
* @param apiConfig ApiConfig
|
||||||
*/
|
*/
|
||||||
public static void buildTorna(List<ApiDoc> apiDocs, ApiConfig apiConfig) {
|
public static void buildTorna(List<ApiDoc> apiDocs, ApiConfig apiConfig) {
|
||||||
|
|
||||||
//是否设置测试环境
|
|
||||||
boolean hasDebugEnv = StringUtils.isNotBlank(apiConfig.getDebugEnvName())
|
|
||||||
&&
|
|
||||||
StringUtils.isNotBlank(apiConfig.getDebugEnvUrl());
|
|
||||||
|
|
||||||
if (apiConfig.isTornaDebug()) {
|
|
||||||
String sb = "配置信息列表: \n" +
|
|
||||||
"OpenUrl: " +
|
|
||||||
apiConfig.getOpenUrl() +
|
|
||||||
"\n" +
|
|
||||||
"appToken: " +
|
|
||||||
apiConfig.getAppToken() +
|
|
||||||
"\n" +
|
|
||||||
"appKey: " +
|
|
||||||
apiConfig.getAppKey() +
|
|
||||||
"\n" +
|
|
||||||
"Secret: " +
|
|
||||||
apiConfig.getSecret() +
|
|
||||||
"\n";
|
|
||||||
System.out.println(sb);
|
|
||||||
}
|
|
||||||
TornaApi tornaApi = new TornaApi();
|
TornaApi tornaApi = new TornaApi();
|
||||||
//设置测试环境
|
|
||||||
List<DebugEnv> debugEnvs = new ArrayList<>();
|
|
||||||
if (hasDebugEnv) {
|
|
||||||
DebugEnv debugEnv = new DebugEnv();
|
|
||||||
debugEnv.setName(apiConfig.getDebugEnvName());
|
|
||||||
debugEnv.setUrl(apiConfig.getDebugEnvUrl());
|
|
||||||
debugEnvs.add(debugEnv);
|
|
||||||
|
|
||||||
}
|
|
||||||
//
|
|
||||||
Apis api;
|
Apis api;
|
||||||
List<Apis> apisList = new ArrayList<>();
|
List<Apis> apisList = new ArrayList<>();
|
||||||
//添加接口数据
|
//添加接口数据
|
||||||
for (ApiDoc a : apiDocs) {
|
for (ApiDoc a : apiDocs) {
|
||||||
api = new Apis();
|
api = new Apis();
|
||||||
api.setName(StringUtils.isBlank(a.getDesc()) ? a.getName() : a.getDesc());
|
api.setName(StringUtils.isBlank(a.getDesc()) ? a.getName() : a.getDesc());
|
||||||
api.setItems(buildApis(a, hasDebugEnv));
|
api.setItems(buildApis(a.getList(), TornaUtil.setDebugEnv(apiConfig,tornaApi)));
|
||||||
api.setIsFolder(TornaConstants.YES);
|
api.setIsFolder(TornaConstants.YES);
|
||||||
apisList.add(api);
|
apisList.add(api);
|
||||||
}
|
}
|
||||||
tornaApi.setDebugEnvs(debugEnvs);
|
|
||||||
tornaApi.setApis(apisList);
|
tornaApi.setApis(apisList);
|
||||||
//推送文档信息
|
//推送文档信息
|
||||||
Map<String, String> requestJson =
|
Map<String, String> requestJson = TornaConstants.buildParams(PUSH, new Gson().toJson(tornaApi), apiConfig);
|
||||||
TornaConstants.buildParams(PUSH, new Gson().toJson(tornaApi), apiConfig);
|
|
||||||
//获取返回结果
|
//获取返回结果
|
||||||
String responseMsg = OkHttp3Util.syncPostJson(apiConfig.getOpenUrl(), new Gson().toJson(requestJson));
|
String responseMsg = OkHttp3Util.syncPostJson(apiConfig.getOpenUrl(), new Gson().toJson(requestJson));
|
||||||
//开启调试时打印请求信息
|
//开启调试时打印请求信息
|
||||||
if (apiConfig.isTornaDebug()) {
|
TornaUtil.printDebugInfo(apiConfig,responseMsg,requestJson);
|
||||||
JsonElement element = JsonParser.parseString(responseMsg);
|
|
||||||
TornaRequestInfo info = new TornaRequestInfo()
|
|
||||||
.of()
|
|
||||||
.setCategory(PUSH)
|
|
||||||
.setCode(element.getAsJsonObject().get(TornaConstants.CODE).getAsString())
|
|
||||||
.setMessage(element.getAsJsonObject().get(TornaConstants.MESSAGE).getAsString())
|
|
||||||
.setRequestInfo(requestJson)
|
|
||||||
.setResponseInfo(responseMsg);
|
|
||||||
System.out.println(info.buildInfo());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* build apis
|
|
||||||
* @param a api
|
|
||||||
* @param hasDebugEnv has debug environment
|
|
||||||
* @return List of Api
|
|
||||||
*/
|
|
||||||
public static List<Apis> buildApis(ApiDoc a, boolean hasDebugEnv) {
|
|
||||||
List<ApiMethodDoc> apiMethodDocs = a.getList();
|
|
||||||
//参数列表
|
|
||||||
List<Apis> apis = new ArrayList<>();
|
|
||||||
Apis methodApi;
|
|
||||||
//遍历分类接口
|
|
||||||
for (ApiMethodDoc apiMethodDoc : apiMethodDocs) {
|
|
||||||
/**
|
|
||||||
* "name": "获取商品信息",
|
|
||||||
* "description": "获取商品信息",
|
|
||||||
* "url": "/goods/get",
|
|
||||||
* "httpMethod": "GET",
|
|
||||||
* "contentType": "application/json",
|
|
||||||
* "isFolder": "1",
|
|
||||||
* "parentId": "",
|
|
||||||
* "isShow": "1",
|
|
||||||
*/
|
|
||||||
methodApi = new Apis();
|
|
||||||
methodApi.setIsFolder(TornaConstants.NO);
|
|
||||||
methodApi.setName(apiMethodDoc.getDesc());
|
|
||||||
methodApi.setUrl(hasDebugEnv ? apiMethodDoc.getPath() : apiMethodDoc.getUrl());
|
|
||||||
methodApi.setHttpMethod(apiMethodDoc.getType());
|
|
||||||
methodApi.setContentType(apiMethodDoc.getContentType());
|
|
||||||
methodApi.setDescription(apiMethodDoc.getDetail());
|
|
||||||
methodApi.setIsShow(TornaConstants.YES);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {
|
|
||||||
* "name": "goodsName",
|
|
||||||
* "type": "string",
|
|
||||||
* "required": "1",
|
|
||||||
* "maxLength": "128",
|
|
||||||
* "example": "iphone12",
|
|
||||||
* "description": "商品名称描述",
|
|
||||||
* "parentId": "",
|
|
||||||
* "enumInfo": {
|
|
||||||
* "name": "支付枚举",
|
|
||||||
* "description": "支付状态",
|
|
||||||
* "items": [
|
|
||||||
* {
|
|
||||||
* "name": "WAIT_PAY",
|
|
||||||
* "type": "string",
|
|
||||||
* "value": "0",
|
|
||||||
* "description": "未支付"
|
|
||||||
* }
|
|
||||||
* ]
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
methodApi.setHeaderParams(buildHerder(apiMethodDoc.getRequestHeaders()));
|
|
||||||
methodApi.setResponseParams(buildParams(apiMethodDoc.getResponseParams()));
|
|
||||||
//Path
|
|
||||||
if (CollectionUtil.isNotEmpty(apiMethodDoc.getPathParams())) {
|
|
||||||
methodApi.setPathParams(buildParams(apiMethodDoc.getPathParams()));
|
|
||||||
}
|
|
||||||
//formData
|
|
||||||
if (CollectionUtil.isNotEmpty(apiMethodDoc.getQueryParams())) {
|
|
||||||
methodApi.setRequestParams(buildParams(apiMethodDoc.getQueryParams()));
|
|
||||||
}
|
|
||||||
//Json
|
|
||||||
if (CollectionUtil.isNotEmpty(apiMethodDoc.getRequestParams())) {
|
|
||||||
methodApi.setRequestParams(buildParams(apiMethodDoc.getRequestParams()));
|
|
||||||
}
|
|
||||||
apis.add(methodApi);
|
|
||||||
}
|
|
||||||
return apis;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* build request header
|
|
||||||
*
|
|
||||||
* @param apiReqHeaders 请求头参数列表
|
|
||||||
* @return List of HttpParam
|
|
||||||
*/
|
|
||||||
public static List<HttpParam> buildHerder(List<ApiReqHeader> apiReqHeaders) {
|
|
||||||
/**
|
|
||||||
* name": "token",
|
|
||||||
* "required": "1",
|
|
||||||
* "example": "iphone12",
|
|
||||||
* "description": "商品名称描述"
|
|
||||||
*/
|
|
||||||
HttpParam httpParam;
|
|
||||||
List<HttpParam> headers = new ArrayList<>();
|
|
||||||
for (ApiReqHeader header : apiReqHeaders) {
|
|
||||||
httpParam = new HttpParam();
|
|
||||||
httpParam.setName(header.getName());
|
|
||||||
httpParam.setRequired(header.isRequired() ? TornaConstants.YES : TornaConstants.NO);
|
|
||||||
httpParam.setExample(StringUtil.removeQuotes(header.getValue()));
|
|
||||||
httpParam.setDescription(header.getDesc());
|
|
||||||
headers.add(httpParam);
|
|
||||||
}
|
|
||||||
return headers;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* build request response params
|
|
||||||
*
|
|
||||||
* @param apiParams 参数列表
|
|
||||||
* @return List of HttpParam
|
|
||||||
*/
|
|
||||||
public static List<HttpParam> buildParams(List<ApiParam> apiParams) {
|
|
||||||
HttpParam httpParam;
|
|
||||||
List<HttpParam> bodies = new ArrayList<>();
|
|
||||||
/**
|
|
||||||
* "name": "goodsName",
|
|
||||||
* "type": "string",
|
|
||||||
* "required": "1",
|
|
||||||
* "maxLength": "128",
|
|
||||||
* "example": "iphone12",
|
|
||||||
* "description": "商品名称描述",
|
|
||||||
* "parentId": "",
|
|
||||||
* "enumInfo": {
|
|
||||||
* "name": "支付枚举",
|
|
||||||
* "description": "支付状态",
|
|
||||||
* "items": [
|
|
||||||
* {
|
|
||||||
* "name": "WAIT_PAY",
|
|
||||||
* "type": "string",
|
|
||||||
* "value": "0",
|
|
||||||
* "description": "未支付"
|
|
||||||
*/
|
|
||||||
for (ApiParam apiParam : apiParams) {
|
|
||||||
httpParam = new HttpParam();
|
|
||||||
httpParam.setName(apiParam.getField());
|
|
||||||
httpParam.setMaxLength(apiParam.getMaxLength());
|
|
||||||
httpParam.setType(apiParam.getType());
|
|
||||||
httpParam.setRequired(apiParam.isRequired() ? TornaConstants.YES : TornaConstants.NO);
|
|
||||||
httpParam.setExample(StringUtil.removeQuotes(apiParam.getValue()));
|
|
||||||
httpParam.setDescription(apiParam.getDesc());
|
|
||||||
if (apiParam.getChildren() != null) {
|
|
||||||
httpParam.setChildren(buildParams(apiParam.getChildren()));
|
|
||||||
}
|
|
||||||
bodies.add(httpParam);
|
|
||||||
}
|
|
||||||
return bodies;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
package com.power.doc.builder.rpc;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.power.common.util.OkHttp3Util;
|
||||||
|
import com.power.doc.builder.ProjectDocConfigBuilder;
|
||||||
|
import com.power.doc.constants.TornaConstants;
|
||||||
|
import com.power.doc.model.ApiConfig;
|
||||||
|
import com.power.doc.model.rpc.RpcApiDoc;
|
||||||
|
import com.power.doc.model.torna.Apis;
|
||||||
|
import com.power.doc.model.torna.DubboInfo;
|
||||||
|
import com.power.doc.model.torna.TornaApi;
|
||||||
|
import com.power.doc.template.RpcDocBuildTemplate;
|
||||||
|
import com.power.doc.utils.TornaUtil;
|
||||||
|
import com.thoughtworks.qdox.JavaProjectBuilder;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static com.power.doc.constants.TornaConstants.PUSH;
|
||||||
|
import static com.power.doc.utils.TornaUtil.buildDubboApis;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xingzi 2021/4/28 16:14
|
||||||
|
**/
|
||||||
|
public class RpcTornaBuilder {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* build controller api
|
||||||
|
*
|
||||||
|
* @param config config
|
||||||
|
*/
|
||||||
|
public static void buildApiDoc(ApiConfig config) {
|
||||||
|
JavaProjectBuilder javaProjectBuilder = new JavaProjectBuilder();
|
||||||
|
buildApiDoc(config, javaProjectBuilder);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Only for smart-doc maven plugin and gradle plugin.
|
||||||
|
*
|
||||||
|
* @param config ApiConfig
|
||||||
|
* @param javaProjectBuilder ProjectDocConfigBuilder
|
||||||
|
*/
|
||||||
|
public static void buildApiDoc(ApiConfig config, JavaProjectBuilder javaProjectBuilder) {
|
||||||
|
config.setParamsDataToTree(true);
|
||||||
|
RpcDocBuilderTemplate builderTemplate = new RpcDocBuilderTemplate();
|
||||||
|
builderTemplate.checkAndInit(config);
|
||||||
|
ProjectDocConfigBuilder configBuilder = new ProjectDocConfigBuilder(config, javaProjectBuilder);
|
||||||
|
RpcDocBuildTemplate docBuildTemplate = new RpcDocBuildTemplate();
|
||||||
|
List<RpcApiDoc> apiDocList = docBuildTemplate.getApiData(configBuilder);
|
||||||
|
buildTorna(apiDocList, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void buildTorna(List<RpcApiDoc> apiDocs, ApiConfig apiConfig) {
|
||||||
|
TornaApi tornaApi = new TornaApi();
|
||||||
|
Apis api;
|
||||||
|
List<Apis> apisList = new ArrayList<>();
|
||||||
|
//添加接口数据
|
||||||
|
for (RpcApiDoc a : apiDocs) {
|
||||||
|
api = new Apis();
|
||||||
|
api.setName(StringUtils.isBlank(a.getDesc()) ? a.getName() : a.getDesc());
|
||||||
|
TornaUtil.setDebugEnv(apiConfig,tornaApi);
|
||||||
|
api.setItems(buildDubboApis(a.getList()));
|
||||||
|
api.setIsFolder(TornaConstants.YES);
|
||||||
|
api.setDubboInfo(new DubboInfo().builder()
|
||||||
|
.setAuthor(a.getAuthor())
|
||||||
|
.setProtocol(a.getProtocol())
|
||||||
|
.setVersion(a.getVersion())
|
||||||
|
.setDependency(TornaUtil.buildDependencies(apiConfig.getRpcApiDependencies()))
|
||||||
|
.setInterfaceName(a.getName()));
|
||||||
|
apisList.add(api);
|
||||||
|
}
|
||||||
|
tornaApi.setApis(apisList);
|
||||||
|
//推送文档信息
|
||||||
|
Map<String, String> requestJson = TornaConstants.buildParams(PUSH, new Gson().toJson(tornaApi), apiConfig);
|
||||||
|
//获取返回结果
|
||||||
|
String responseMsg = OkHttp3Util.syncPostJson(apiConfig.getOpenUrl(), new Gson().toJson(requestJson));
|
||||||
|
//开启调试时打印请求信息
|
||||||
|
TornaUtil.printDebugInfo(apiConfig,responseMsg,requestJson);
|
||||||
|
}
|
||||||
|
}
|
|
@ -321,7 +321,7 @@ public class ApiConfig {
|
||||||
/**
|
/**
|
||||||
* torna调试开关
|
* torna调试开关
|
||||||
*/
|
*/
|
||||||
private boolean tornaDebug;
|
private boolean tornaDebug = true;
|
||||||
/**
|
/**
|
||||||
* 是否为dubbo
|
* 是否为dubbo
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -63,4 +63,13 @@ public class RpcApiDependency {
|
||||||
this.version = version;
|
this.version = version;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "<dependency>"+"\r"+
|
||||||
|
"\t"+"<groupId>" + groupId + "</groupId>" +"\n"+
|
||||||
|
"\t"+"<artifactId>" + artifactId + "</artifactId>" +"\n"+
|
||||||
|
"\t"+ "<version>" + version + "</version>" +""+
|
||||||
|
"\r"+"</dependency>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ public class Apis {
|
||||||
private String isFolder;
|
private String isFolder;
|
||||||
private String parentId;
|
private String parentId;
|
||||||
private String isShow;
|
private String isShow;
|
||||||
|
private DubboInfo dubboInfo;
|
||||||
private List<HttpParam> headerParams;
|
private List<HttpParam> headerParams;
|
||||||
private List<HttpParam> pathParams;
|
private List<HttpParam> pathParams;
|
||||||
private List<HttpParam> requestParams;
|
private List<HttpParam> requestParams;
|
||||||
|
@ -153,6 +154,14 @@ public class Apis {
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DubboInfo getDubboInfo() {
|
||||||
|
return dubboInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDubboInfo(DubboInfo dubboInfo) {
|
||||||
|
this.dubboInfo = dubboInfo;
|
||||||
|
}
|
||||||
|
|
||||||
public void setItems(List<Apis> items) {
|
public void setItems(List<Apis> items) {
|
||||||
this.items = items;
|
this.items = items;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
package com.power.doc.model.torna;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xingzi 2021/4/28 12:54
|
||||||
|
**/
|
||||||
|
public class DubboInfo {
|
||||||
|
private String interfaceName;
|
||||||
|
private String author;
|
||||||
|
private String version;
|
||||||
|
private String protocol;
|
||||||
|
private String dependency;
|
||||||
|
|
||||||
|
public DubboInfo builder(){
|
||||||
|
return new DubboInfo();
|
||||||
|
}
|
||||||
|
public String getInterfaceName() {
|
||||||
|
return interfaceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DubboInfo setInterfaceName(String interfaceName) {
|
||||||
|
this.interfaceName = interfaceName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuthor() {
|
||||||
|
return author;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DubboInfo setAuthor(String author) {
|
||||||
|
this.author = author;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersion() {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DubboInfo setVersion(String version) {
|
||||||
|
this.version = version;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProtocol() {
|
||||||
|
return protocol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DubboInfo setProtocol(String protocol) {
|
||||||
|
this.protocol = protocol;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDependency() {
|
||||||
|
return dependency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DubboInfo setDependency(String dependency) {
|
||||||
|
this.dependency = dependency;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "DubboInfo{" +
|
||||||
|
"interfaceName='" + interfaceName + '\'' +
|
||||||
|
", author='" + author + '\'' +
|
||||||
|
", version='" + version + '\'' +
|
||||||
|
", protocol='" + protocol + '\'' +
|
||||||
|
", dependency='" + dependency + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
|
@ -368,14 +368,9 @@ public class SpringBootDocBuildTemplate implements IDocBuildTemplate<ApiDoc> {
|
||||||
if (Objects.nonNull(configBuilder.getApiConfig().getRequestBodyAdvice())
|
if (Objects.nonNull(configBuilder.getApiConfig().getRequestBodyAdvice())
|
||||||
&& Objects.isNull(method.getTagByName(IGNORE_REQUEST_BODY_ADVICE))) {
|
&& Objects.isNull(method.getTagByName(IGNORE_REQUEST_BODY_ADVICE))) {
|
||||||
String requestBodyAdvice = configBuilder.getApiConfig().getRequestBodyAdvice().getClassName();
|
String requestBodyAdvice = configBuilder.getApiConfig().getRequestBodyAdvice().getClassName();
|
||||||
gicTypeName = new StringBuffer()
|
typeName = configBuilder.getApiConfig().getRequestBodyAdvice().getClassName();
|
||||||
.append(requestBodyAdvice)
|
gicTypeName = requestBodyAdvice + "<" + gicTypeName + ">";
|
||||||
.append("<")
|
|
||||||
.append(gicTypeName).append(">").toString();
|
|
||||||
typeName = new StringBuffer()
|
|
||||||
.append(requestBodyAdvice)
|
|
||||||
.append("<")
|
|
||||||
.append(typeName).append(">").toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (JavaClassValidateUtil.isPrimitive(simpleTypeName)) {
|
if (JavaClassValidateUtil.isPrimitive(simpleTypeName)) {
|
||||||
|
@ -663,6 +658,12 @@ public class SpringBootDocBuildTemplate implements IDocBuildTemplate<ApiDoc> {
|
||||||
throw new RuntimeException("You have use @RequestBody Passing multiple variables for method "
|
throw new RuntimeException("You have use @RequestBody Passing multiple variables for method "
|
||||||
+ javaMethod.getName() + " in " + className + ",@RequestBody annotation could only bind one variables.");
|
+ javaMethod.getName() + " in " + className + ",@RequestBody annotation could only bind one variables.");
|
||||||
}
|
}
|
||||||
|
if (Objects.nonNull(builder.getApiConfig().getRequestBodyAdvice())
|
||||||
|
&& Objects.isNull(javaMethod.getTagByName(IGNORE_REQUEST_BODY_ADVICE))) {
|
||||||
|
String requestBodyAdvice = builder.getApiConfig().getRequestBodyAdvice().getClassName();
|
||||||
|
fullTypeName = typeName = requestBodyAdvice + "<" + typeName + ">";
|
||||||
|
|
||||||
|
}
|
||||||
requestBodyCounter++;
|
requestBodyCounter++;
|
||||||
isRequestBody = true;
|
isRequestBody = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -508,7 +508,8 @@ public class JavaClassUtil {
|
||||||
c = c.getSuperclass();
|
c = c.getSuperclass();
|
||||||
}
|
}
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
e.printStackTrace();
|
e.getMessage();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -235,6 +235,7 @@ public class JavaClassValidateUtil {
|
||||||
case "javax.servlet.http.HttpServletResponse":
|
case "javax.servlet.http.HttpServletResponse":
|
||||||
case "org.springframework.web.reactive.function.server.ServerRequest":
|
case "org.springframework.web.reactive.function.server.ServerRequest":
|
||||||
case "org.springframework.web.multipart.MultipartHttpServletRequest":
|
case "org.springframework.web.multipart.MultipartHttpServletRequest":
|
||||||
|
case "org.springframework.http.HttpHeaders":
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -0,0 +1,284 @@
|
||||||
|
package com.power.doc.utils;
|
||||||
|
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
import com.power.common.util.CollectionUtil;
|
||||||
|
import com.power.common.util.StringUtil;
|
||||||
|
import com.power.doc.constants.TornaConstants;
|
||||||
|
import com.power.doc.model.*;
|
||||||
|
import com.power.doc.model.rpc.RpcApiDependency;
|
||||||
|
import com.power.doc.model.torna.*;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static com.power.doc.constants.TornaConstants.PUSH;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xingzi 2021/4/28 16:15
|
||||||
|
**/
|
||||||
|
public class TornaUtil {
|
||||||
|
|
||||||
|
public static boolean setDebugEnv(ApiConfig apiConfig, TornaApi tornaApi) {
|
||||||
|
//是否设置测试环境
|
||||||
|
boolean hasDebugEnv = StringUtils.isNotBlank(apiConfig.getDebugEnvName())
|
||||||
|
&&
|
||||||
|
StringUtils.isNotBlank(apiConfig.getDebugEnvUrl());
|
||||||
|
//设置测试环境
|
||||||
|
List<DebugEnv> debugEnvs = new ArrayList<>();
|
||||||
|
if (hasDebugEnv) {
|
||||||
|
DebugEnv debugEnv = new DebugEnv();
|
||||||
|
debugEnv.setName(apiConfig.getDebugEnvName());
|
||||||
|
debugEnv.setUrl(apiConfig.getDebugEnvUrl());
|
||||||
|
debugEnvs.add(debugEnv);
|
||||||
|
}
|
||||||
|
tornaApi.setDebugEnvs(debugEnvs);
|
||||||
|
return hasDebugEnv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void printDebugInfo(ApiConfig apiConfig, String responseMsg, Map<String, String> requestJson) {
|
||||||
|
if (apiConfig.isTornaDebug()) {
|
||||||
|
String sb = "配置信息列表: \n" +
|
||||||
|
"OpenUrl: " +
|
||||||
|
apiConfig.getOpenUrl() +
|
||||||
|
"\n" +
|
||||||
|
"appToken: " +
|
||||||
|
apiConfig.getAppToken() +
|
||||||
|
"\n" +
|
||||||
|
"appKey: " +
|
||||||
|
apiConfig.getAppKey() +
|
||||||
|
"\n" +
|
||||||
|
"Secret: " +
|
||||||
|
apiConfig.getSecret() +
|
||||||
|
"\n";
|
||||||
|
System.out.println(sb);
|
||||||
|
JsonElement element = JsonParser.parseString(responseMsg);
|
||||||
|
TornaRequestInfo info = new TornaRequestInfo()
|
||||||
|
.of()
|
||||||
|
.setCategory(PUSH)
|
||||||
|
.setCode(element.getAsJsonObject().get(TornaConstants.CODE).getAsString())
|
||||||
|
.setMessage(element.getAsJsonObject().get(TornaConstants.MESSAGE).getAsString())
|
||||||
|
.setRequestInfo(requestJson)
|
||||||
|
.setResponseInfo(responseMsg);
|
||||||
|
System.out.println(info.buildInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* build apis
|
||||||
|
*
|
||||||
|
* @param apiMethodDocs apiMethodDocs
|
||||||
|
* @param hasDebugEnv has debug environment
|
||||||
|
* @return List of Api
|
||||||
|
*/
|
||||||
|
public static List<Apis> buildApis(List<ApiMethodDoc> apiMethodDocs, boolean hasDebugEnv) {
|
||||||
|
//参数列表
|
||||||
|
List<Apis> apis = new ArrayList<>();
|
||||||
|
Apis methodApi;
|
||||||
|
//遍历分类接口
|
||||||
|
for (ApiMethodDoc apiMethodDoc : apiMethodDocs) {
|
||||||
|
/**
|
||||||
|
* "name": "获取商品信息",
|
||||||
|
* "description": "获取商品信息",
|
||||||
|
* "url": "/goods/get",
|
||||||
|
* "httpMethod": "GET",
|
||||||
|
* "contentType": "application/json",
|
||||||
|
* "isFolder": "1",
|
||||||
|
* "parentId": "",
|
||||||
|
* "isShow": "1",
|
||||||
|
*/
|
||||||
|
methodApi = new Apis();
|
||||||
|
methodApi.setIsFolder(TornaConstants.NO);
|
||||||
|
methodApi.setName(apiMethodDoc.getDesc());
|
||||||
|
methodApi.setUrl(hasDebugEnv ? apiMethodDoc.getPath() : apiMethodDoc.getUrl());
|
||||||
|
methodApi.setHttpMethod(apiMethodDoc.getType());
|
||||||
|
methodApi.setContentType(apiMethodDoc.getContentType());
|
||||||
|
methodApi.setDescription(apiMethodDoc.getDetail());
|
||||||
|
methodApi.setIsShow(TornaConstants.YES);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {
|
||||||
|
* "name": "goodsName",
|
||||||
|
* "type": "string",
|
||||||
|
* "required": "1",
|
||||||
|
* "maxLength": "128",
|
||||||
|
* "example": "iphone12",
|
||||||
|
* "description": "商品名称描述",
|
||||||
|
* "parentId": "",
|
||||||
|
* "enumInfo": {
|
||||||
|
* "name": "支付枚举",
|
||||||
|
* "description": "支付状态",
|
||||||
|
* "items": [
|
||||||
|
* {
|
||||||
|
* "name": "WAIT_PAY",
|
||||||
|
* "type": "string",
|
||||||
|
* "value": "0",
|
||||||
|
* "description": "未支付"
|
||||||
|
* }
|
||||||
|
* ]
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
methodApi.setHeaderParams(buildHerder(apiMethodDoc.getRequestHeaders()));
|
||||||
|
methodApi.setResponseParams(buildParams(apiMethodDoc.getResponseParams()));
|
||||||
|
//Path
|
||||||
|
if (CollectionUtil.isNotEmpty(apiMethodDoc.getPathParams())) {
|
||||||
|
methodApi.setPathParams(buildParams(apiMethodDoc.getPathParams()));
|
||||||
|
}
|
||||||
|
//formData
|
||||||
|
if (CollectionUtil.isNotEmpty(apiMethodDoc.getQueryParams())) {
|
||||||
|
methodApi.setRequestParams(buildParams(apiMethodDoc.getQueryParams()));
|
||||||
|
}
|
||||||
|
//Json
|
||||||
|
if (CollectionUtil.isNotEmpty(apiMethodDoc.getRequestParams())) {
|
||||||
|
methodApi.setRequestParams(buildParams(apiMethodDoc.getRequestParams()));
|
||||||
|
}
|
||||||
|
apis.add(methodApi);
|
||||||
|
}
|
||||||
|
return apis;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* build apis
|
||||||
|
*
|
||||||
|
* @param apiMethodDocs apiMethodDocs
|
||||||
|
* @return List of Api
|
||||||
|
*/
|
||||||
|
public static List<Apis> buildDubboApis(List<JavaMethodDoc> apiMethodDocs) {
|
||||||
|
//参数列表
|
||||||
|
List<Apis> apis = new ArrayList<>();
|
||||||
|
Apis methodApi;
|
||||||
|
//遍历分类接口
|
||||||
|
for (JavaMethodDoc apiMethodDoc : apiMethodDocs) {
|
||||||
|
/**
|
||||||
|
* "name": "获取商品信息",
|
||||||
|
* "description": "获取商品信息",
|
||||||
|
* "url": "/goods/get",
|
||||||
|
* "httpMethod": "GET",
|
||||||
|
* "contentType": "application/json",
|
||||||
|
* "isFolder": "1",
|
||||||
|
* "parentId": "",
|
||||||
|
* "isShow": "1",
|
||||||
|
*/
|
||||||
|
methodApi = new Apis();
|
||||||
|
methodApi.setIsFolder(TornaConstants.NO);
|
||||||
|
methodApi.setName(apiMethodDoc.getDesc());
|
||||||
|
methodApi.setDescription(apiMethodDoc.getDetail());
|
||||||
|
methodApi.setIsShow(TornaConstants.YES);
|
||||||
|
methodApi.setUrl(apiMethodDoc.getMethodDefinition());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {
|
||||||
|
* "name": "goodsName",
|
||||||
|
* "type": "string",
|
||||||
|
* "required": "1",
|
||||||
|
* "maxLength": "128",
|
||||||
|
* "example": "iphone12",
|
||||||
|
* "description": "商品名称描述",
|
||||||
|
* "parentId": "",
|
||||||
|
* "enumInfo": {
|
||||||
|
* "name": "支付枚举",
|
||||||
|
* "description": "支付状态",
|
||||||
|
* "items": [
|
||||||
|
* {
|
||||||
|
* "name": "WAIT_PAY",
|
||||||
|
* "type": "string",
|
||||||
|
* "value": "0",
|
||||||
|
* "description": "未支付"
|
||||||
|
* }
|
||||||
|
* ]
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
methodApi.setResponseParams(buildParams(apiMethodDoc.getResponseParams()));
|
||||||
|
//Json
|
||||||
|
if (CollectionUtil.isNotEmpty(apiMethodDoc.getRequestParams())) {
|
||||||
|
methodApi.setRequestParams(buildParams(apiMethodDoc.getRequestParams()));
|
||||||
|
}
|
||||||
|
apis.add(methodApi);
|
||||||
|
}
|
||||||
|
return apis;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* build request header
|
||||||
|
*
|
||||||
|
* @param apiReqHeaders 请求头参数列表
|
||||||
|
* @return List of HttpParam
|
||||||
|
*/
|
||||||
|
public static List<HttpParam> buildHerder(List<ApiReqHeader> apiReqHeaders) {
|
||||||
|
/**
|
||||||
|
* name": "token",
|
||||||
|
* "required": "1",
|
||||||
|
* "example": "iphone12",
|
||||||
|
* "description": "商品名称描述"
|
||||||
|
*/
|
||||||
|
HttpParam httpParam;
|
||||||
|
List<HttpParam> headers = new ArrayList<>();
|
||||||
|
for (ApiReqHeader header : apiReqHeaders) {
|
||||||
|
httpParam = new HttpParam();
|
||||||
|
httpParam.setName(header.getName());
|
||||||
|
httpParam.setRequired(header.isRequired() ? TornaConstants.YES : TornaConstants.NO);
|
||||||
|
httpParam.setExample(StringUtil.removeQuotes(header.getValue()));
|
||||||
|
httpParam.setDescription(header.getDesc());
|
||||||
|
headers.add(httpParam);
|
||||||
|
}
|
||||||
|
return headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* build request response params
|
||||||
|
*
|
||||||
|
* @param apiParams 参数列表
|
||||||
|
* @return List of HttpParam
|
||||||
|
*/
|
||||||
|
public static List<HttpParam> buildParams(List<ApiParam> apiParams) {
|
||||||
|
HttpParam httpParam;
|
||||||
|
List<HttpParam> bodies = new ArrayList<>();
|
||||||
|
/**
|
||||||
|
* "name": "goodsName",
|
||||||
|
* "type": "string",
|
||||||
|
* "required": "1",
|
||||||
|
* "maxLength": "128",
|
||||||
|
* "example": "iphone12",
|
||||||
|
* "description": "商品名称描述",
|
||||||
|
* "parentId": "",
|
||||||
|
* "enumInfo": {
|
||||||
|
* "name": "支付枚举",
|
||||||
|
* "description": "支付状态",
|
||||||
|
* "items": [
|
||||||
|
* {
|
||||||
|
* "name": "WAIT_PAY",
|
||||||
|
* "type": "string",
|
||||||
|
* "value": "0",
|
||||||
|
* "description": "未支付"
|
||||||
|
*/
|
||||||
|
for (ApiParam apiParam : apiParams) {
|
||||||
|
httpParam = new HttpParam();
|
||||||
|
httpParam.setName(apiParam.getField());
|
||||||
|
httpParam.setMaxLength(apiParam.getMaxLength());
|
||||||
|
httpParam.setType(apiParam.getType());
|
||||||
|
httpParam.setRequired(apiParam.isRequired() ? TornaConstants.YES : TornaConstants.NO);
|
||||||
|
httpParam.setExample(StringUtil.removeQuotes(apiParam.getValue()));
|
||||||
|
httpParam.setDescription(apiParam.getDesc());
|
||||||
|
if (apiParam.getChildren() != null) {
|
||||||
|
httpParam.setChildren(buildParams(apiParam.getChildren()));
|
||||||
|
}
|
||||||
|
bodies.add(httpParam);
|
||||||
|
}
|
||||||
|
return bodies;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String buildDependencies(List<RpcApiDependency> dependencies) {
|
||||||
|
StringBuilder s = new StringBuilder();
|
||||||
|
if (CollectionUtil.isNotEmpty(dependencies)) {
|
||||||
|
for (RpcApiDependency r : dependencies) {
|
||||||
|
s.append(r.toString())
|
||||||
|
.append("\n\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return s.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,8 +5,11 @@ import com.power.doc.builder.HtmlApiDocBuilder;
|
||||||
import com.power.doc.builder.OpenApiBuilder;
|
import com.power.doc.builder.OpenApiBuilder;
|
||||||
import com.power.doc.builder.PostmanJsonBuilder;
|
import com.power.doc.builder.PostmanJsonBuilder;
|
||||||
import com.power.doc.builder.TornaBuilder;
|
import com.power.doc.builder.TornaBuilder;
|
||||||
|
import com.power.doc.builder.rpc.RpcHtmlBuilder;
|
||||||
|
import com.power.doc.builder.rpc.RpcTornaBuilder;
|
||||||
import com.power.doc.enums.OrderEnum;
|
import com.power.doc.enums.OrderEnum;
|
||||||
import com.power.doc.model.*;
|
import com.power.doc.model.*;
|
||||||
|
import com.power.doc.model.rpc.RpcApiDependency;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
@ -30,15 +33,15 @@ public class ApiDocTest {
|
||||||
list.add("aa");
|
list.add("aa");
|
||||||
list.contains("aa");
|
list.contains("aa");
|
||||||
ApiConfig config = new ApiConfig();
|
ApiConfig config = new ApiConfig();
|
||||||
config.setServerUrl("http://localhost:8080");
|
config.setServerUrl("http://127.0.0.1:8899");
|
||||||
//config.setStrict(true);
|
//config.setStrict(true);
|
||||||
config.setOpenUrl("http://torna.opensphere.cn/api/");
|
config.setOpenUrl("http://127.0.0.1:8899/api");
|
||||||
config.setAppKey("20201216788835306945118208");
|
config.setAppKey("20201216788835306945118208");
|
||||||
config.setAppToken("2f9a7d3858a147b7845ebb48785d4dc7");
|
config.setAppToken("c16931fa6590483fb7a4e85340fcbfef");
|
||||||
config.setSecret("W.ZyGMOB9Q0UqujVxnfi@.I#V&tUUYZR");
|
config.setSecret("W.ZyGMOB9Q0UqujVxnfi@.I#V&tUUYZR");
|
||||||
config.setDebugEnvName("测试环境");
|
config.setDebugEnvName("测试环境");
|
||||||
config.setDebugEnvUrl("http://127.0.0.1");
|
config.setDebugEnvUrl("http://127.0.0.1");
|
||||||
config.setTornaDebug(true);
|
//config.setTornaDebug(true);
|
||||||
|
|
||||||
config.setAllInOne(true);
|
config.setAllInOne(true);
|
||||||
config.setOutPath("d:\\md3");
|
config.setOutPath("d:\\md3");
|
||||||
|
@ -51,7 +54,7 @@ public class ApiDocTest {
|
||||||
//SourcePath.path().setPath("F:\\Personal\\project\\smart\\src\\main\\java")
|
//SourcePath.path().setPath("F:\\Personal\\project\\smart\\src\\main\\java")
|
||||||
//SourcePath.path().setDesc("加载项目外代码").setPath("E:\\ApplicationPower\\ApplicationPower\\Common-util\\src\\main\\java")
|
//SourcePath.path().setDesc("加载项目外代码").setPath("E:\\ApplicationPower\\ApplicationPower\\Common-util\\src\\main\\java")
|
||||||
);
|
);
|
||||||
config.setPackageFilters("com.power.doc.controller.UserController");
|
config.setPackageFilters("com.power.doc.dubbo.*");
|
||||||
config.setDataDictionaries(
|
config.setDataDictionaries(
|
||||||
ApiDataDictionary.builder().setTitle("订单字典").setEnumClass(OrderEnum.class).setCodeField("code").setDescField("desc")
|
ApiDataDictionary.builder().setTitle("订单字典").setEnumClass(OrderEnum.class).setCodeField("code").setDescField("desc")
|
||||||
);
|
);
|
||||||
|
@ -78,23 +81,31 @@ public class ApiDocTest {
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
config.setPackageFilters("com.power.doc.controller.UserController");
|
config.setPackageFilters("com.power.doc.dubbo.*,com.power.doc.controller.UserController");
|
||||||
//非必须只有当setAllInOne设置为true时文档变更记录才生效,https://gitee.com/sunyurepository/ApplicationPower/issues/IPS4O
|
//非必须只有当setAllInOne设置为true时文档变更记录才生效,https://gitee.com/sunyurepository/ApplicationPower/issues/IPS4O
|
||||||
config.setRevisionLogs(
|
config.setRevisionLogs(
|
||||||
RevisionLog.builder().setRevisionTime("2018/12/15").setAuthor("chen").setRemarks("测试").setStatus("创建").setVersion("V1.0"),
|
RevisionLog.builder().setRevisionTime("2018/12/15").setAuthor("chen").setRemarks("测试").setStatus("创建").setVersion("V1.0"),
|
||||||
RevisionLog.builder().setRevisionTime("2018/12/16").setAuthor("chen2").setRemarks("测试2").setStatus("修改").setVersion("V2.0")
|
RevisionLog.builder().setRevisionTime("2018/12/16").setAuthor("chen2").setRemarks("测试2").setStatus("修改").setVersion("V2.0")
|
||||||
);
|
);
|
||||||
// config.setResponseBodyAdvice(ResponseBodyAdvice.builder()
|
config.setResponseBodyAdvice(BodyAdvice.builder()
|
||||||
// .setDataField("data")
|
.setDataField("data")
|
||||||
// .setDataField("dadada")
|
.setDataField("dadada")
|
||||||
// .setClassName("com.power.common.model.CommonResult"));
|
.setClassName("com.power.common.model.CommonResult"));
|
||||||
|
config.setRequestBodyAdvice(BodyAdvice.builder()
|
||||||
|
.setDataField("data")
|
||||||
|
.setDataField("dadada")
|
||||||
|
.setClassName("com.power.common.model.CommonResult"));
|
||||||
|
config.setRpcApiDependencies(RpcApiDependency.builder().setGroupId("com.test").setArtifactId("test1").setVersion("1.0"),
|
||||||
|
RpcApiDependency.builder().setGroupId("com.smart").setArtifactId("test").setVersion("1.1.1")
|
||||||
|
);
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
|
|
||||||
//TornaBuilder.buildApiDoc(config);
|
//TornaBuilder.buildApiDoc(config);
|
||||||
//OpenApiBuilder.buildOpenApi(config);
|
//OpenApiBuilder.buildOpenApi(config);
|
||||||
HtmlApiDocBuilder.buildApiDoc(config);
|
HtmlApiDocBuilder.buildApiDoc(config);
|
||||||
|
//RpcTornaBuilder.buildApiDoc(config);
|
||||||
|
TornaBuilder.buildApiDoc(config);
|
||||||
|
// RpcHtmlBuilder.buildApiDoc(config);
|
||||||
long end = System.currentTimeMillis();
|
long end = System.currentTimeMillis();
|
||||||
DateTimeUtil.printRunTime(end, start);
|
DateTimeUtil.printRunTime(end, start);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue