package com.tofly.gpsboot.common.system;

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

/**
 * 是否查看
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum WorkStateEnum {
    /**
     *
     */
    WORK_STATE_GO_WORK("1","上班"),
    WORK_STATE_WORKING("2","工作中"),
    WORK_STATE_BELOW("3","下班"),
    WORK_STATE_ERROR("4","异常"),
    ;
    /**
     * 编码
     */
    private String code;
    /**
     * 内容
     */
    private String value;

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

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