package com.nova.sankuai.domain.enums; import io.swagger.annotations.ApiModel; /** * @author weikangdi * @create 2021/11/19 * 权限类型 */ @ApiModel(value = "权限类型枚举") public enum PermissionTypeEnum { API(0, "API"), MENU(1, "MENU"); private Integer code; private String value; PermissionTypeEnum(int code, String value) { this.code = code; this.value = value; } public static String value(Integer code) { if (code != null) { for (PermissionTypeEnum m : PermissionTypeEnum.values()) { if (m.getCode() == code.intValue()) { return m.getValue(); } } } return null; } public Integer getCode() { return code; } public void setCode(Integer code) { this.code = code; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } }