package cn.pluss.platform.util.tree;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author DJH
 */
@Data
@Accessors(chain = true)
public class Node {

    @TableId
    protected String id;

    @TableField(value = "pid")
    protected String pId;

    protected Integer sort;

    @JSONField(serialize = false)
    public boolean isRoot() {
        return pId == null || "0".equals(pId);
    }
}
