package com.tofly.gpsboot.common.system;

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

/**
 * 是否占用
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum OpeningEnum {
    /**
     *
     */
    FULLY_OPEN("520","全开"),
    HALF_OPEN("521","半开"),
    CLOSE("522","关闭"),
    OTHER("523","其他")

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

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

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