From 3597732de8cfbd5df179cf20bd975d1ff015055b Mon Sep 17 00:00:00 2001 From: shalousun Date: Sat, 22 May 2021 22:43:36 +0800 Subject: [PATCH] release 2.1.8 --- CHANGELOG.md | 6 +----- pom.xml | 2 +- .../com/power/doc/helper/JsonBuildHelper.java | 8 ++++---- .../com/power/doc/helper/ParamsBuildHelper.java | 16 ++++++++-------- .../doc/template/SpringBootDocBuildTemplate.java | 2 +- 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9f365b..a0940c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/pom.xml b/pom.xml index 6209ddd..77c78d5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 smart-doc jar - 2.1.7 + 2.1.8 smart-doc https://github.com/smart-doc-group/smart-doc.git diff --git a/src/main/java/com/power/doc/helper/JsonBuildHelper.java b/src/main/java/com/power/doc/helper/JsonBuildHelper.java index 616ace4..1313616 100644 --- a/src/main/java/com/power/doc/helper/JsonBuildHelper.java +++ b/src/main/java/com/power/doc/helper/JsonBuildHelper.java @@ -217,13 +217,13 @@ public class JsonBuildHelper { List 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; } } diff --git a/src/main/java/com/power/doc/helper/ParamsBuildHelper.java b/src/main/java/com/power/doc/helper/ParamsBuildHelper.java index 6bf9cc1..35b7067 100644 --- a/src/main/java/com/power/doc/helper/ParamsBuildHelper.java +++ b/src/main/java/com/power/doc/helper/ParamsBuildHelper.java @@ -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; } } } diff --git a/src/main/java/com/power/doc/template/SpringBootDocBuildTemplate.java b/src/main/java/com/power/doc/template/SpringBootDocBuildTemplate.java index d1e10d8..26754c9 100644 --- a/src/main/java/com/power/doc/template/SpringBootDocBuildTemplate.java +++ b/src/main/java/com/power/doc/template/SpringBootDocBuildTemplate.java @@ -827,7 +827,7 @@ public class SpringBootDocBuildTemplate implements IDocBuildTemplate { } JavaClass superClass = cls.getSuperJavaClass(); List classAnnotations = new ArrayList<>(); - if(Objects.nonNull(superClass)) { + if (Objects.nonNull(superClass)) { classAnnotations.addAll(superClass.getAnnotations()); } classAnnotations.addAll(cls.getAnnotations());