package com.yuchen.saas.park.api.enums.property;

import lombok.Getter;
import org.nest.springwrap.core.log.exception.ServiceException;

@Getter
public enum MonthDayEnum {
    MONTH(1, "月"),
    DAY(2, "天"),
    ;

    private int value;
    private String desc;

    MonthDayEnum(int i, String desc) {
        value = i;
        this.desc = desc;
    }

    public static MonthDayEnum convert(int intValue) {
        MonthDayEnum[] allValues = MonthDayEnum.values();
        for(int i = 0; i < allValues.length; i++) {
            if(allValues[i].value == intValue) {
                return allValues[i];
            }
        }
        throw new ServiceException("MonthDayEnum 非法枚举参数值");
    }
}
