package com.sckw.core.model.enums;

import lombok.Getter;

/**
 * @author czh
 * @desc 菜单类型
 * @date 2023/6/15
 */
@Getter
public enum MenuTypeEnum {

    //菜单
    DIRECTORY(1, "菜单"),
    //通过
    BUTTON(2, "按钮");

    private final int code;

    private final String name;

    MenuTypeEnum(int code, String name){
        this.code = code;
        this.name = name;
    }

    public static MenuTypeEnum getName(int code){
        for (MenuTypeEnum menuTypeEnum : values()) {
            if (menuTypeEnum.getCode() == code) {
                return menuTypeEnum;
            }
        }
        return null;
    }

}
