upgrade to 1.6
This commit is contained in:
parent
122ef8b25d
commit
60870be61f
|
@ -29,13 +29,13 @@ which looks a html like generated by `asciidoctor-maven-plugin` plugin.
|
|||
<dependency>
|
||||
<groupId>com.github.shalousun</groupId>
|
||||
<artifactId>smart-doc</artifactId>
|
||||
<version>1.7.5</version>
|
||||
<version>1.7.6</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
```
|
||||
#### gradle
|
||||
```
|
||||
testCompile 'com.github.shalousun:smart-doc:1.7.5'
|
||||
testCompile 'com.github.shalousun:smart-doc:1.7.6'
|
||||
```
|
||||
### Create a unit test
|
||||
Just running a unit test will allow Smart-doc to generate a very concise api document for you,
|
||||
|
|
|
@ -30,13 +30,13 @@ smart-doc使用和测试可参考[smart-doc demo](https://gitee.com/sunyureposit
|
|||
<dependency>
|
||||
<groupId>com.github.shalousun</groupId>
|
||||
<artifactId>smart-doc</artifactId>
|
||||
<version>1.7.5</version>
|
||||
<version>1.7.6</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
```
|
||||
#### gradle
|
||||
```
|
||||
testCompile 'com.github.shalousun:smart-doc:1.7.5'
|
||||
testCompile 'com.github.shalousun:smart-doc:1.7.6'
|
||||
```
|
||||
### Create a unit test
|
||||
通过运行一个单元测试来让Smart-doc为你生成一个简洁明了的api文档
|
||||
|
|
|
@ -113,6 +113,12 @@
|
|||
6. 修改方法注释相同引起的html链接跳转错误。
|
||||
7. 添加生成AllInOne的覆盖配置项,默认自动加版本号不覆盖。
|
||||
8. 新增枚举字典码导出到文档的功能。
|
||||
#### 版本号:1.7.6
|
||||
- 更新日期:2019-11-13
|
||||
- 更新内容:
|
||||
1. fix #I14PT5 header重复渲染到文档
|
||||
2. fix #I14MV7 不设置dataDictionaries出现空指针错误
|
||||
3. 增加请求参数枚举字段解析(试用功能)
|
||||
|
||||
|
||||
|
2
pom.xml
2
pom.xml
|
@ -5,7 +5,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>smart-doc</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.7.5</version>
|
||||
<version>1.7.6</version>
|
||||
|
||||
<name>smart-doc</name>
|
||||
<url>https://github.com/shalousun/smart-doc.git</url>
|
||||
|
|
|
@ -280,22 +280,18 @@ public class SourceBuilder {
|
|||
apiMethodDoc.setResponseUsage(buildReturnJson(method, this.fieldMap));
|
||||
List<ApiParam> responseParams = buildReturnApiParams(method, cls.getGenericFullyQualifiedName());
|
||||
apiMethodDoc.setResponseParams(responseParams);
|
||||
//reduce create in template
|
||||
apiMethodDoc.setHeaders(createHeaders(this.headers, this.isAdoc));
|
||||
|
||||
List<ApiReqHeader> allApiReqHeaders;
|
||||
if (this.headers != null) {
|
||||
|
||||
allApiReqHeaders = Stream.of(this.headers, apiReqHeaders)
|
||||
.flatMap(Collection::stream)
|
||||
.collect(Collectors.collectingAndThen(
|
||||
Collectors.toCollection(
|
||||
()->new TreeSet<>(Comparator.comparing(ApiReqHeader::getName))
|
||||
)
|
||||
,ArrayList::new));
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
allApiReqHeaders = apiReqHeaders;
|
||||
}
|
||||
|
||||
//reduce create in template
|
||||
apiMethodDoc.setHeaders(createHeaders(allApiReqHeaders, this.isAdoc));
|
||||
apiMethodDoc.setRequestHeaders(allApiReqHeaders);
|
||||
methodDocList.add(apiMethodDoc);
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.power.common.util.CollectionUtil;
|
|||
import com.power.doc.constants.DocLanguage;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
|
@ -133,6 +134,8 @@ public class ApiConfig {
|
|||
|
||||
public void setRequestHeaders(ApiReqHeader... requestHeaders) {
|
||||
this.requestHeaders = CollectionUtil.asList(requestHeaders);
|
||||
this.requestHeaders.stream().map(header -> header.setDesc(header.getDesc()+"(Global)"))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<CustomRespField> getCustomResponseFields() {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.power.doc.model;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* http request header info model
|
||||
|
@ -84,4 +86,18 @@ public class ApiReqHeader {
|
|||
this.since = since;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ApiReqHeader that = (ApiReqHeader) o;
|
||||
return Objects.equals(name, that.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
return Objects.hash(name);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue