yangys
2024-10-30 25db770e621f1259b8d5b7fd514207f7481c2d0f
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
package com.qianwen.smartman.common.enums;
 
import java.util.Arrays;
import java.util.List;
/**
 * 菜单分类
 */
public enum MenuCategoryEnum {
    APP(0, "app"),
    MENU(1, "菜单"),
    BUTTON(2, "按钮"),
    CARD(3, "卡片");
    
    private final int status;
    private final String desc;
 
    MenuCategoryEnum(final int status, final String desc) {
        this.status = status;
        this.desc = desc;
    }
 
    public int getStatus() {
        return this.status;
    }
 
    public String getDesc() {
        return this.desc;
    }
 
    public static MenuCategoryEnum of(Integer status) {
        if (status == null) {
            return null;
        }
        MenuCategoryEnum[] values = values();
        for (MenuCategoryEnum menuCategoryEnum : values) {
            if (menuCategoryEnum.status == status.intValue()) {
                return menuCategoryEnum;
            }
        }
        return null;
    }
 
    public static List<Integer> getMenusOutofCard() {
        return Arrays.asList(APP.getStatus(), MENU.getStatus(), BUTTON.getStatus());
    }
 
    public static List<Integer> getMenusWithCard() {
        return Arrays.asList(APP.getStatus(), CARD.getStatus());
    }
 
    public static List<Integer> getMenus() {
        return Arrays.asList(APP.getStatus(), MENU.getStatus());
    }
}