86183
2022-09-09 0d999e33085c0a25c5525242748f6aa62a401159
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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 + "]";
    }
 
 
 
}