/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved. <a>http://www.crunii.com</a>
 */
package com.crunii.micro.common.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * @author 田平 create 2019年2月20日上午9:11:29
 */
@Getter
@Setter
@ToString
@ApiModel(description = "树节点")
public class TreeNode<T> implements Serializable {
	private static final long serialVersionUID = 1L;
	// 1菜单，2按扭，3url组，4URL
	public static final int NODE_TYPE_MENU = 1;
	public static final int NODE_TYPE_BUTTON = 2;
	public static final int NODE_TYPE_GROUP = 3;
	public static final int NODE_TYPE_URL = 4;

	@ApiModelProperty(value = "节点ID")
	protected String nodeId;

	@ApiModelProperty(value = "父节点ID")
	protected String parentNodeId;

	@ApiModelProperty(value = "真实数据ID")
	protected String rawId;

	@ApiModelProperty(value = "组Id")
	private Integer groupId;

	@ApiModelProperty(value = "节点类型，用于前端渲染图标样式，1菜单，2按扭，3url组，4URL")
	protected Integer nodeType;

	@ApiModelProperty(value = "排序")
	private Integer sortId;

	@ApiModelProperty(value = "节点名字")
	protected String nodeName;

	@ApiModelProperty(value = "图标")
	private String icon;

	@ApiModelProperty(value = "是否叶子节点")
	protected boolean leaf;

	@ApiModelProperty(value = "节点数据")
	protected T nodeData;

	@ApiModelProperty(value = "父路径s")
	protected Set<String> parents;

	@ApiModelProperty(value = "子节点列表")
	protected List<TreeNode<T>> children = new ArrayList<TreeNode<T>>();

	@ApiModelProperty(value = "URL列表")
	protected List<TreeNode<T>> urlList = new ArrayList<TreeNode<T>>();
}
