package com.tofly.gpsboot.common.system;

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

/**
 * 签到状态
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum SignTypeEnum {
    /**
     *
     */
    SIGN_TYPE_UNTREATED("0","未签到"),
    SIGN_TYPE_YES("1","上班"),
    SIGN_TYPE_NO("2","下班"),
    SIGN_TYPE_OFFLINE("3","离线"),
    SIGN_TYPE_DISABLE("4","禁用")

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

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

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