package com.ningdatech.pmapi.sys.model.enumeration;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 资源类型
 *
 * @author PoffyZhang
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "MenuTypeEnum", description = "资源类型-枚举")
public enum MenuTypeEnum {
    /**
     * 菜单
     */
    MENU(0, "菜单"),

    /**
     * 按钮
     */
    BUTTON(1, "按钮");

    /**
     * 资源类型
     */
    private Integer code;

    /**
     * 资源描述
     */
    private String desc;

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    @ApiModelProperty(value = "编码", allowableValues = "0,1", example = "0")
    public Integer getCode() {
        return this.code;
    }


    public boolean eq(String val) {
        return this.name().equals(val);
    }

}
