package com.tofly.gpsboot.common.system;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.util.StringUtils;

/**
 * 是否超时
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum IsOverEnum {
    /**
     *
     */
    IS_OVER_YES("0","未超时"),
    IS_OVER_NO("1","已超时"),

    ;
    /**
     * 编码
     */
    private String code;
    /**
     * 内容
     */
    private String value;

    public static String getCodeForValue(String code) {
        String path = "";
        if (StringUtils.isEmpty(code)) {
            return path;
        }

        for (IsOverEnum e : IsOverEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                path = e.value;
                break;
            }
        }
        return path;
    }
}
