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

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

@Getter
public enum FeeMarkEnum {
    CYCLE(1, "周期性收费"),
    METER(2, "用量收费"),
    QUANTITY(3, "数量收费"),
    FIXED(4, "固定金额收费"),
    SPECIFY(5, "指定金额收费"),

    ;

    private final int value;
    private final String desc;

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

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