diff --git a/src/main/java/com/ly/doc/helper/JsonBuildHelper.java b/src/main/java/com/ly/doc/helper/JsonBuildHelper.java index a9d3ddd5..26cfe061 100644 --- a/src/main/java/com/ly/doc/helper/JsonBuildHelper.java +++ b/src/main/java/com/ly/doc/helper/JsonBuildHelper.java @@ -288,7 +288,7 @@ public static String buildJson(String typeName, String genericCanonicalName, CustomField customResponseField = CustomField.nameEquals(key, builder.getCustomRespFieldMap()); CustomField customRequestField = CustomField.nameEquals(key, builder.getCustomReqFieldMap()); if (Objects.nonNull(customRequestField)) { - if (JavaClassUtil.isTargetChildClass(typeName, customRequestField.getOwnerClassName()) && (customRequestField.isIgnore()) + if (JavaClassUtil.isTargetChildClass(docField.getDeclaringClassName(), customRequestField.getOwnerClassName()) && (customRequestField.isIgnore()) && !isResp) { continue; } else { @@ -296,7 +296,7 @@ public static String buildJson(String typeName, String genericCanonicalName, } } if (Objects.nonNull(customResponseField)) { - if (JavaClassUtil.isTargetChildClass(typeName, customResponseField.getOwnerClassName()) && (customResponseField.isIgnore()) + if (JavaClassUtil.isTargetChildClass(docField.getDeclaringClassName(), customResponseField.getOwnerClassName()) && (customResponseField.isIgnore()) && isResp) { continue; } else { diff --git a/src/main/java/com/ly/doc/helper/ParamsBuildHelper.java b/src/main/java/com/ly/doc/helper/ParamsBuildHelper.java index 86fb17e5..3f95a091 100644 --- a/src/main/java/com/ly/doc/helper/ParamsBuildHelper.java +++ b/src/main/java/com/ly/doc/helper/ParamsBuildHelper.java @@ -197,11 +197,11 @@ public static List buildParams(String className, String pre, int level CustomField customResponseField = CustomField.nameEquals(key, projectBuilder.getCustomRespFieldMap()); CustomField customRequestField = CustomField.nameEquals(key, projectBuilder.getCustomReqFieldMap()); - if (customResponseField != null && JavaClassUtil.isTargetChildClass(simpleName, customResponseField.getOwnerClassName()) + if (customResponseField != null && JavaClassUtil.isTargetChildClass(docField.getDeclaringClassName(), customResponseField.getOwnerClassName()) && (customResponseField.isIgnore()) && isResp) { continue; } - if (customRequestField != null && JavaClassUtil.isTargetChildClass(simpleName, customRequestField.getOwnerClassName()) + if (customRequestField != null && JavaClassUtil.isTargetChildClass(docField.getDeclaringClassName(), customRequestField.getOwnerClassName()) && (customRequestField.isIgnore()) && !isResp) { continue; }