package com.tofly.gpsboot.common.system;

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

/**
 * 上报状态
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum IsSubmitEnum {
    /**
     *
     */
    IS_SUBMIT_NO("0","未上报"),
    IS_SUBMIT_YES("1","已上报"),
    ;
    /**
     * 编码
     */
    private String code;
    /**
     * 内容
     */
    private String value;

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

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