Merge branch 'dev' into test

yun-zuoyi
王杰 5 years ago
commit 880d449dfb

@ -1747,4 +1747,54 @@ public class PtlPcnEnumUtil {
return valueOf(val);
}
}
/**
* redis
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum EXPIRE_TIME {
NEVER(-1, "不过期"),
ONE_HOUR(3600, "一小时"),
FIVE_MINS(300, "5分钟"),
HALF_HOUR(1800, "半小时"),
ONE_QUARTER(900, "一刻钟"),
ONE_MIN(60, "一分钟");
private int value;
private String description;
EXPIRE_TIME(int value, String description) {
this.value = value;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public static String valueOfDescription2(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description.equals("已审批") ? "审批" : values()[i].description;
}
}
return tmp;
}
}
}

Loading…
Cancel
Save