package com.tofly.gpsboot.common.system;

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

/**
 * 隐患部位
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum TroublePartEnum {
    /**
     *
     */
    TROUBLE_PART_PIPELINE("0","管线"),
    TROUBLE_PART_FACILITY("1","设施"),
    TROUBLE_PART_OTHER("2","其他")
    ;
    ;
    /**
     * 编码
     */
    private String code;
    /**
     * 内容
     */
    private String value;
    public static String getCodeForValue(String code) {
        String path = "";
        if (StringUtils.isEmpty(code)) {
            return path;
        }

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