Merge remote-tracking branch 'origin/dev'
This commit is contained in:
commit
7b4954f3bd
|
@ -4,7 +4,7 @@
|
|||
- 更新日期: 2020-05-10
|
||||
- 更新内容:
|
||||
1. 修复不允许List中放文件上传对象错误的bug。
|
||||
2. 添加推送接口作者信息到torna。
|
||||
2. 添加推送接口作者信息到torna,通过配置author设置推送人,不配置默认为计算机用户名。
|
||||
3. 添加推送queryParams参数到torna(需要使用torna 1.6.0+)
|
||||
#### 版本号:2.1.5
|
||||
- 更新日期: 2020-05-05
|
||||
|
|
|
@ -90,6 +90,7 @@ public class TornaBuilder {
|
|||
*/
|
||||
public static void buildTorna(List<ApiDoc> apiDocs, ApiConfig apiConfig) {
|
||||
TornaApi tornaApi = new TornaApi();
|
||||
tornaApi.setAuthor(StringUtil.isEmpty(apiConfig.getAuthor()) ? System.getProperty("user.name") : apiConfig.getAuthor());
|
||||
Apis api;
|
||||
List<Apis> apisList = new ArrayList<>();
|
||||
//添加接口数据
|
||||
|
@ -98,7 +99,7 @@ public class TornaBuilder {
|
|||
api.setName(StringUtils.isBlank(a.getDesc()) ? a.getName() : a.getDesc());
|
||||
api.setItems(buildApis(a.getList(), TornaUtil.setDebugEnv(apiConfig,tornaApi)));
|
||||
api.setIsFolder(TornaConstants.YES);
|
||||
api.setAuthor(apiConfig.getAuthor());
|
||||
api.setAuthor(a.getAuthor());
|
||||
apisList.add(api);
|
||||
}
|
||||
tornaApi.setApis(apisList);
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.power.doc.builder.rpc;
|
|||
|
||||
import com.google.gson.Gson;
|
||||
import com.power.common.util.OkHttp3Util;
|
||||
import com.power.common.util.StringUtil;
|
||||
import com.power.doc.builder.ProjectDocConfigBuilder;
|
||||
import com.power.doc.constants.TornaConstants;
|
||||
import com.power.doc.model.ApiConfig;
|
||||
|
@ -52,9 +53,9 @@ public class RpcTornaBuilder {
|
|||
List<RpcApiDoc> apiDocList = docBuildTemplate.getApiData(configBuilder);
|
||||
buildTorna(apiDocList, config);
|
||||
}
|
||||
|
||||
public static void buildTorna(List<RpcApiDoc> apiDocs, ApiConfig apiConfig) {
|
||||
TornaApi tornaApi = new TornaApi();
|
||||
tornaApi.setAuthor(StringUtil.isEmpty(apiConfig.getAuthor()) ? System.getProperty("user.name") : apiConfig.getAuthor());
|
||||
Apis api;
|
||||
List<Apis> apisList = new ArrayList<>();
|
||||
//添加接口数据
|
||||
|
@ -64,7 +65,7 @@ public class RpcTornaBuilder {
|
|||
TornaUtil.setDebugEnv(apiConfig,tornaApi);
|
||||
api.setItems(buildDubboApis(a.getList()));
|
||||
api.setIsFolder(TornaConstants.YES);
|
||||
api.setAuthor(apiConfig.getAuthor());
|
||||
api.setAuthor(a.getAuthor());
|
||||
api.setDubboInfo(new DubboInfo().builder()
|
||||
.setAuthor(a.getAuthor())
|
||||
.setProtocol(a.getProtocol())
|
||||
|
|
|
@ -64,6 +64,16 @@ public class ApiDoc implements Comparable<ApiDoc> {
|
|||
*/
|
||||
private String link;
|
||||
|
||||
private String author;
|
||||
|
||||
public String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setAuthor(String author) {
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
|
|
@ -40,6 +40,15 @@ public class TornaApi {
|
|||
*/
|
||||
List<DebugEnv> debugEnvs;
|
||||
List<Apis> apis;
|
||||
String author;
|
||||
|
||||
public String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setAuthor(String author) {
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public List<DebugEnv> getDebugEnvs() {
|
||||
return debugEnvs;
|
||||
|
|
|
@ -28,10 +28,7 @@ import com.power.doc.builder.ProjectDocConfigBuilder;
|
|||
import com.power.doc.constants.DocTags;
|
||||
import com.power.doc.helper.ParamsBuildHelper;
|
||||
import com.power.doc.model.*;
|
||||
import com.power.doc.utils.DocClassUtil;
|
||||
import com.power.doc.utils.DocUtil;
|
||||
import com.power.doc.utils.JavaClassValidateUtil;
|
||||
import com.power.doc.utils.OpenApiSchemaUtil;
|
||||
import com.power.doc.utils.*;
|
||||
import com.thoughtworks.qdox.model.DocletTag;
|
||||
import com.thoughtworks.qdox.model.JavaClass;
|
||||
import com.thoughtworks.qdox.model.JavaMethod;
|
||||
|
@ -80,9 +77,12 @@ public interface IDocBuildTemplate<T> {
|
|||
default void handleApiDoc(JavaClass cls, List<ApiDoc> apiDocList, List<ApiMethodDoc> apiMethodDocs, int order, boolean isUseMD5) {
|
||||
String controllerName = cls.getName();
|
||||
ApiDoc apiDoc = new ApiDoc();
|
||||
String classAuthor = JavaClassUtil.getClassTagsValue(cls, DocTags.AUTHOR, Boolean.TRUE);
|
||||
apiDoc.setOrder(order);
|
||||
apiDoc.setName(controllerName);
|
||||
apiDoc.setAuthor(classAuthor);
|
||||
apiDoc.setAlias(controllerName);
|
||||
//apiDoc.setAuthor();
|
||||
if (isUseMD5) {
|
||||
String name = DocUtil.generateId(apiDoc.getName());
|
||||
apiDoc.setAlias(name);
|
||||
|
|
|
@ -35,11 +35,12 @@ public class ApiDocTest {
|
|||
ApiConfig config = new ApiConfig();
|
||||
config.setServerUrl("http://127.0.0.1:8899");
|
||||
//config.setStrict(true);
|
||||
config.setOpenUrl("http://127.0.0.1:8899/api");
|
||||
config.setOpenUrl("http://demo.torna.cn/api");
|
||||
config.setAppKey("20201216788835306945118208");
|
||||
config.setAppToken("c16931fa6590483fb7a4e85340fcbfef");
|
||||
config.setAppToken("258e853573d44ef4a3e2caebdcafbc0f");
|
||||
config.setSecret("W.ZyGMOB9Q0UqujVxnfi@.I#V&tUUYZR");
|
||||
config.setDebugEnvName("测试环境");
|
||||
// config.setAuthor("test");
|
||||
config.setDebugEnvUrl("http://127.0.0.1");
|
||||
//config.setTornaDebug(true);
|
||||
|
||||
|
|
Loading…
Reference in New Issue