package com.tofly.gpsboot.common.system;

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

/**
 * 是否转发
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum IsForwardingEnum {
    /**
     *
     */
    IS_FORWARDING_NO("0","未转发"),
    IS_FORWARDING_YES("1","已转发"),

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

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

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