package com.tofly.gpsboot.common.system;

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

/**
 * 路面情况，关联字典编码表：（完好、开裂、沉降、其它）
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum RoadSituationEnum {
    /**
     *
     */
    NORMAL("530","完好"),
    CRAZE("531","开裂"),
    SETTLEMENT("532","沉降"),
    OTHER("533","其它"),

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

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

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