package com.tofly.gpsboot.common.system;

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

/**
 * 是否反工
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum IsReworkEnum {
    /**
     *
     */
    IS_REWORK_NO("0","未返工"),
    IS_REWORK_YES("1","已返工"),

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

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

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