doc-view icon indicating copy to clipboard operation
doc-view copied to clipboard

深层次的元素显示有问题

Open zzl493743016 opened this issue 3 years ago • 4 comments
trafficstars

Bug 描述 深层次的元素显示有问题

Version

  • Doc View: 1.2.3
  • IDEA 2021.2.2

Bug 详情

actionInfoJsonStruct|List<ActionInfoDto>|N|行为json的结构样例,只作为接口文档参考用,实际不会有数值的传递| |-->element|ActionInfoDto|Y|| |-->-->insertAction|InsertActionCache|N|插入坑位内容| |-->-->-->insertSlot|Integer|N|在第N位插入内容| |-->-->-->insertScreenSlot|Integer|N|在 同屏第N位 插入| |-->-->replaceAction|ReplaceActionCache|N|替换坑位内容| |-->-->-->replaceSlot|Integer|N|在 第N位 替换| |-->-->-->replaceScreenSlot|Integer|N|在 该屏的第N坑 替换| |-->-->-->replaceRanges|List<Integer>|N|替换范围:1-商品坑,2-品类坑,3-品牌坑"| |-->-->-->replaceType|Integer|N|替换方式:1-以商品序号派,2-条件内以点击IPV排,条件外以商品序号排| |-->-->-->totalExposeDays|Integer|N|累计曝光天数| |-->-->-->totalExposeUv|Integer|N|累计曝光UV| |-->-->eventContents|List<EventContent>|N|事件内容| |actionJson|String|N|已废弃| |contentJson|String|N|已废弃|

eventContents 是个list,但是它里面的元素没有展开显示了

zzl493743016 avatar Aug 09 '22 03:08 zzl493743016

看了代码,发现是递归判断这里有问题

/** * 检查从当前节点到根节点的链表上是否存在当前类型的节点, 存在则说明递归了 * * @param body * @param qualifiedName * @return */ public static boolean checkLinkedListHasTypeClass(@NotNull Body body, @NotNull String qualifiedName) {

    Body temp = body.getParent();

    while (temp != null) {
        if (qualifiedName.equals(temp.getQualifiedNameForClassType())) {
            return true;
        }
        temp = temp.getParent();
    }

    return false;

}

会导致list嵌套的时候,子list的元素不进入递归

zzl493743016 avatar Aug 09 '22 08:08 zzl493743016

👍🏻 可以提个 pr

liuzhihang avatar Aug 09 '22 08:08 liuzhihang

我提交了

zzl493743016 avatar Aug 11 '22 06:08 zzl493743016

@zzl493743016

下面这种递归会有问题,你能详细描述下,你遇到的深层次实体是什么样的么?

@Data
public class UserRespVo {
    /**
     * 用户名字
     */
    private String userName;

    /**
     * 递归
     */
    UserRespVo userRespVo;
}

liuzhihang avatar Aug 12 '22 02:08 liuzhihang