package org.jeecg.modules.system.model;

import cn.com.ctop.common.module.entity.TagInfo;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
public class TagInfoTree implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    private String id;

    private String key;
    private String title;

    /**
     * 父id
     */
    private String parentId;

    /**
     * 标签名称
     */
    private String tagName;

    /**
     * 编码
     */
    private String tagCode;
    /**
     * 排序
     */
    private Integer tagOrder;

    /**
     * 所属一级标签id
     */
    private Long firstTagId;

    /**
     * 所属二级标签id
     */
    private Long secendTagId;

    /**
     * 简介
     */
    private String description;

    private String model;

    private Integer status;

    private Integer delFlag;

    private Integer level;

    private Long tagCategoryId;

    private String userId;
    /**
     * 是否叶子节点: 1:是 0:不是
     */
    private boolean isLeaf;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;

    private List<TagInfoTree> children;

    public TagInfoTree(TagInfo tagInfo) {
        this.key = tagInfo.getId()+"";
        this.id = tagInfo.getId()+"";
        this.title = tagInfo.getTagName();
        this.parentId = tagInfo.getParentId()+"";
        this.tagName = tagInfo.getTagName();
        this.tagCode = tagInfo.getTagCode();
        this.tagOrder = tagInfo.getTagOrder();
        this.delFlag = tagInfo.getDelFlag();
        this.description = tagInfo.getDescription();
        this.firstTagId = tagInfo.getFirstTagId();
        this.secendTagId = tagInfo.getSecendTagId();
        this.description = tagInfo.getDescription();
        this.model = tagInfo.getModel();
        this.status = tagInfo.getStatus();
        this.delFlag = tagInfo.getDelFlag();
        this.level = tagInfo.getLevel();
        this.tagCategoryId = tagInfo.getTagCategoryId();
        this.userId = tagInfo.getUserId();
        this.createTime = tagInfo.getCreateTime();
        this.updateTime = tagInfo.getUpdateTime();
        this.isLeaf = tagInfo.isLeaf();
    }
}
