package com.tofly.gpsboot.common.system;

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

/**
 * 是否巡查
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum IsArtificialEndFlagEnum {
    /**
     *
     */
    IS_ARTIFICIAL_END_FLAG_NO("0","关闭"),
    IS_ARTIFICIAL_END_FLAG_YES("1","启用"),

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

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

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