package com.vci.web.enumpck;
|
|
import com.vci.starter.web.annotation.VciEnum;
|
import com.vci.starter.web.enumpck.BaseEnum;
|
|
/**
|
* 功能菜单作用域
|
* @author weidy
|
* @date 2019/9/25
|
*/
|
@VciEnum(name = "resourceControlType",text = "功能控制区域",description = "电脑端BS,CS,移动端,集成,微服务")
|
public enum ResourceControlTypeEnum implements BaseEnum {
|
/**
|
* 电脑端B/S
|
*/
|
BS("resourceControlType_bs","B/S"),
|
/**
|
* 电脑端C/S
|
*/
|
CS("resourceControlType_cs","C/S"),
|
|
/**
|
* .net
|
*/
|
DOTNET("dotnet","C#"),
|
/**
|
* 移动端
|
*/
|
MOBILE("resourceControlType_mobile","移动端");
|
|
/**
|
* 枚举的值
|
*/
|
private String value;
|
|
/**
|
* 枚举显示文本
|
*/
|
private String text;
|
|
/**
|
* 获取枚举值
|
* @return 枚举值
|
*/
|
@Override
|
public String getValue() {
|
return value;
|
}
|
|
/**
|
* 获取枚举显示文本
|
* @return 显示文本
|
*/
|
@Override
|
public String getText() {
|
return text;
|
}
|
|
/**
|
* 构造函数
|
* @param value 值
|
* @param text 显示文本
|
*/
|
private ResourceControlTypeEnum(String value, String text){
|
this.value = value;
|
this.text = text;
|
}
|
|
/**
|
* 根据名称获取对应的枚举值
|
* @param text 名称
|
* @return 枚举值
|
*/
|
public static String getValueByText(String text){
|
for(ResourceControlTypeEnum wenum : ResourceControlTypeEnum.values()){
|
if(wenum.getText().equalsIgnoreCase(text)){
|
return wenum.getValue();
|
}
|
}
|
return "";
|
}
|
|
/**
|
* 根据枚举值获取名称
|
* @param value 枚举值
|
* @return 名称
|
*/
|
public static String getTextByValue(String value){
|
for(ResourceControlTypeEnum wenum : ResourceControlTypeEnum.values()){
|
if(wenum.getValue().equalsIgnoreCase(value)){
|
return wenum.getText();
|
}
|
}
|
return "";
|
}
|
|
}
|