package com.yuchen.saas.parking.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 *  停车卡类型枚举类
 */
@AllArgsConstructor
@Getter
public enum CardDateFlagEnum {


    EXPIRED(1, "已过期"),
    LOST(2, "已失效"),
    BE_LOST(3, "即将失效"),
    ;

    private final Integer code;

    private final String desc;

    public static String getEnumDesc(Integer code) {
        if (Objects.nonNull(code)) {
            for (CardDateFlagEnum e : CardDateFlagEnum.values()) {
                if (e.getCode().equals(code)) {
                    return e.getDesc();
                }
            }
        }
        return null;
    }


}
