release 2.1.8

This commit is contained in:
shalousun 2021-05-22 22:43:36 +08:00
parent 660eb38042
commit 3597732de8
5 changed files with 15 additions and 19 deletions

View File

@ -1,8 +1,4 @@
## smart-doc版本
#### 版本号2.1.9
- 更新日期
- 更新内容
1.添加@JsonProperty支持
#### 版本号2.1.8
@ -15,7 +11,7 @@
5. 修复maven插件torna-rest和torna-rpc两个task未加编译前缀的问题。
6. 修复生成json用例中数组类型json错误的问题。
7. 修复customRequestFields中设置字段value在用例中不生效的bug。
8. 添加@JsonProperty支持,支持JsonProperty.Access控制字段。
#### 版本号2.1.7
- 更新日期: 2020-05-12

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>smart-doc</artifactId>
<packaging>jar</packaging>
<version>2.1.7</version>
<version>2.1.8</version>
<name>smart-doc</name>
<url>https://github.com/smart-doc-group/smart-doc.git</url>

View File

@ -217,13 +217,13 @@ public class JsonBuildHelper {
List<JavaAnnotation> annotations = docField.getAnnotations();
for (JavaAnnotation annotation : annotations) {
String annotationName = annotation.getType().getValue();
if(DocAnnotationConstants.JSON_PROPERTY.equalsIgnoreCase(annotationName)){
if (DocAnnotationConstants.JSON_PROPERTY.equalsIgnoreCase(annotationName)) {
AnnotationValue value = annotation.getProperty("access");
if(Objects.nonNull(value)){
if(JSON_PROPERTY_READ_ONLY.equals(value.getParameterValue()) && !isResp){
if (Objects.nonNull(value)) {
if (JSON_PROPERTY_READ_ONLY.equals(value.getParameterValue()) && !isResp) {
continue out;
}
if(JSON_PROPERTY_WRITE_ONLY.equals(value.getParameterValue()) && isResp){
if (JSON_PROPERTY_WRITE_ONLY.equals(value.getParameterValue()) && isResp) {
continue out;
}
}

View File

@ -154,7 +154,7 @@ public class ParamsBuildHelper {
CustomField customResponseField = responseFieldMap.get(fieldName);
if (customResponseField != null && JavaClassUtil.isTargetChildClass(simpleName, customResponseField.getOwnerClassName())
&& (customResponseField.isIgnore()) && isResp) {
continue ;
continue;
}
CustomField customRequestField = projectBuilder.getCustomReqFieldMap().get(fieldName);
if (customRequestField != null && JavaClassUtil.isTargetChildClass(simpleName, customRequestField.getOwnerClassName())
@ -167,14 +167,14 @@ public class ParamsBuildHelper {
if (DocAnnotationConstants.MAX.equalsIgnoreCase(simpleAnnotationName)) {
maxLength = annotation.getProperty(DocAnnotationConstants.VALUE_PROP).toString();
}
if(DocAnnotationConstants.JSON_PROPERTY.equalsIgnoreCase(simpleAnnotationName)){
if (DocAnnotationConstants.JSON_PROPERTY.equalsIgnoreCase(simpleAnnotationName)) {
AnnotationValue value = annotation.getProperty("access");
if(Objects.nonNull(value)){
if(JSON_PROPERTY_READ_ONLY.equals(value.getParameterValue()) && !isResp){
continue out;
}
if(JSON_PROPERTY_WRITE_ONLY.equals(value.getParameterValue()) && isResp){
continue out;
if (Objects.nonNull(value)) {
if (JSON_PROPERTY_READ_ONLY.equals(value.getParameterValue()) && !isResp) {
continue out;
}
if (JSON_PROPERTY_WRITE_ONLY.equals(value.getParameterValue()) && isResp) {
continue out;
}
}
}

View File

@ -827,7 +827,7 @@ public class SpringBootDocBuildTemplate implements IDocBuildTemplate<ApiDoc> {
}
JavaClass superClass = cls.getSuperJavaClass();
List<JavaAnnotation> classAnnotations = new ArrayList<>();
if(Objects.nonNull(superClass)) {
if (Objects.nonNull(superClass)) {
classAnnotations.addAll(superClass.getAnnotations());
}
classAnnotations.addAll(cls.getAnnotations());