package com.dsh.utils.login;
|
|
import com.dsh.config.JsonLongSerializer;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import lombok.Data;
|
|
import java.io.Serializable;
|
import java.util.ArrayList;
|
import java.util.HashMap;
|
import java.util.List;
|
import java.util.Map;
|
|
/***
|
* @Description:
|
* @Param: 权限树
|
* @Author: BaiWenLong
|
*/
|
@Data
|
public class Tree implements Serializable {
|
|
private static final long serialVersionUID = 5401772599251813928L;
|
|
public static String TREE_NODE_STATE_DEFAULT = "open";
|
public static String TREE_NODE_STATE_CLOSED = "closed";
|
|
private String key;
|
private String title;
|
private String name;
|
private String lable;
|
private String state = Tree.TREE_NODE_STATE_DEFAULT;
|
private boolean checked;
|
private String permission;
|
private String path;
|
private String icon;
|
@JsonSerialize(using = JsonLongSerializer.class)
|
private Long parentId;
|
private String type;
|
private boolean enable;
|
/**
|
* 排序值
|
*/
|
private Integer sort;
|
|
|
private int childSize;
|
private Map<String, Object> attributes = new HashMap<String, Object>();
|
private List<Tree> children = new ArrayList<Tree>();
|
|
|
public Tree(String key, String title, String state) {
|
this.key = key;
|
this.title = title;
|
this.state = state;
|
}
|
|
public Tree(String rootName) {
|
this.key = "-1L";
|
this.title = rootName;
|
}
|
|
|
@Override
|
public String toString() {
|
return "Tree [key=" + key + ", title=" + title + ", state=" + state
|
+ ", checked=" + checked + ", childSize=" + childSize
|
+ ", children=" + children + "]";
|
}
|
|
|
|
}
|