Skip to content

Commit

Permalink
release 2.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
shalousun committed May 22, 2021
1 parent 660eb38 commit 3597732
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 19 deletions.
6 changes: 1 addition & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
## smart-doc版本
#### 版本号2.1.9
- 更新日期
- 更新内容
1.添加@JsonProperty支持

#### 版本号:2.1.8

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/power/doc/helper/JsonBuildHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,13 @@ public static String buildJson(String typeName, String genericCanonicalName,
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;
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/power/doc/helper/ParamsBuildHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public static List<ApiParam> buildParams(String className, String pre, int level
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())
Expand All @@ -167,14 +167,14 @@ public static List<ApiParam> buildParams(String className, String pre, int level
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;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ private boolean checkController(JavaClass cls) {
}
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());
Expand Down

0 comments on commit 3597732

Please sign in to comment.