You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
885 B
45 lines
885 B
3 years ago
|
package com.epmet.enums;
|
||
|
|
||
|
import com.epmet.commons.tools.constant.NumConstant;
|
||
|
import org.apache.commons.lang3.StringUtils;
|
||
|
|
||
|
/**
|
||
|
* @Author zxc
|
||
|
* @DateTime 2022/3/29 16:35
|
||
|
* @DESC
|
||
|
*/
|
||
|
public enum ChannelEnum {
|
||
|
|
||
|
MINI("0","小程序"),
|
||
|
MSG("1","短信")
|
||
|
;
|
||
|
|
||
|
private String key;
|
||
|
private String value;
|
||
|
|
||
|
ChannelEnum(String key, String value) {
|
||
|
this.key = key;
|
||
|
this.value = value;
|
||
|
}
|
||
|
|
||
|
public static String getKeyByValue(String value){
|
||
|
if (StringUtils.isBlank(value)){
|
||
|
return NumConstant.ONE_STR;
|
||
|
}
|
||
|
for (ChannelEnum a : ChannelEnum.values()) {
|
||
|
if (a.getValue().equals(value)){
|
||
|
return a.getKey();
|
||
|
}
|
||
|
}
|
||
|
return NumConstant.ONE_STR;
|
||
|
}
|
||
|
|
||
|
public String getKey() {
|
||
|
return key;
|
||
|
}
|
||
|
|
||
|
public String getValue() {
|
||
|
return value;
|
||
|
}
|
||
|
}
|