首先需要一个区间枚举
public enum TimeCycle {
TODAY("today","今天"),
YESTERDAY("yesterday","昨天"),
MONTH("month","本月"),
LAST_MONTH("lastMonth","上个月"),
PASS_SEVEN_DAYS("pastSevenDays","过去七天"),
PASS_FOURTEEN_DAYS("pastFourteenDays","过去十四天"),
PASS_THIRTY_DAYS("pastThirtyDays","过去三十天"),
HISTORY("history","历史");
public final String code;
public final String remark;
private static Map<String,TimeCycle> cache = new HashMap<>();
TimeCycle(String code,String remark){
this.code = code;
this.remark = remark;
}
static {
for(TimeCycle value