因有个判断需要处理不同系统类型跳转不同 系统。 考虑用switch + 枚举的方式。 具体使用案例如下:
package com.b2b.common.constant;
import com.base.utils.base.StringUtils;
/**
* 系统类型枚举
* @author shijing
*/
public enum SystemType {
ERP(0,"ERP"),
ORDER_PLATFORM(1,"订货平台"),
PERSONAL(2,"个人中心系统"),
SHOP_MALL(3,"商城"),
PARTNER(4,"伙伴系统");
private int value;
private String desc;
SystemType(int value ,String desc) {
this.value = value;
this.desc = desc;
}
public int getValue() {
return value;
}
public String getDesc() {
return desc;
}
/**
* 通过value取枚举
* @param value
* @return
*/
public static SystemType getTypeByValue(String value){ <