|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package cn.estsh.i3plus.pojo.base.enumutil;
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description :
|
|
|
|
@ -900,6 +901,64 @@ public class CommonEnumUtil {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Content-Type
|
|
|
|
|
*/
|
|
|
|
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
|
|
|
|
public enum CONTENT_TYPE {
|
|
|
|
|
FORM("x-www-form-urlencoded", "表单"),
|
|
|
|
|
FILE(" multipart/form-data", "文件"),
|
|
|
|
|
JSON(" application/json", "JSON"),
|
|
|
|
|
XML(" application/xml ", "XML");
|
|
|
|
|
|
|
|
|
|
private String value;
|
|
|
|
|
private String description;
|
|
|
|
|
|
|
|
|
|
public String getValue() {
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getDescription() {
|
|
|
|
|
return description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CONTENT_TYPE(String value, String description) {
|
|
|
|
|
this.value = value;
|
|
|
|
|
this.description = description;
|
|
|
|
|
}
|
|
|
|
|
public static CONTENT_TYPE valueOfContenType(String val) {
|
|
|
|
|
CONTENT_TYPE tmp = null;
|
|
|
|
|
for (int i = 0; i < values().length; i++) {
|
|
|
|
|
if (StringUtils.equalsIgnoreCase(values()[i].value, val)) {
|
|
|
|
|
tmp = values()[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String valueOfDescription(String val) {
|
|
|
|
|
String tmp = null;
|
|
|
|
|
for (int i = 0; i < values().length; i++) {
|
|
|
|
|
if (StringUtils.equalsIgnoreCase(values()[i].value, val)) {
|
|
|
|
|
tmp = values()[i].description;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String descriptionOfValue(String val) {
|
|
|
|
|
String tmp = null;
|
|
|
|
|
for (int i = 0; i < values().length; i++) {
|
|
|
|
|
if (StringUtils.equalsIgnoreCase(values()[i].description, val)) {
|
|
|
|
|
tmp = values()[i].value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 数据有效的静态常量
|
|
|
|
|
public static final int VALID = CommonEnumUtil.IS_VAILD.VAILD.getValue();
|
|
|
|
|
// 数据未删除的静态常量
|
|
|
|
|