package com.ningdatech.carapi.driver.constant;

import org.apache.commons.lang3.StringUtils;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author CMM
 * @description
 * @since 2022/12/05 15:31
 */
@AllArgsConstructor
@Getter
public enum DriverAbnormalBehaviorOverseeEnum {

    UN_OVERSEE(0,"待督办"),

    OVERSEE(1,"已督办");

    private  Integer code;
    private  String desc;

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDescByCode(String code) {
        if(StringUtils.isBlank(code)){
            return StringUtils.EMPTY;
        }
        for (DriverAbnormalBehaviorOverseeEnum t : DriverAbnormalBehaviorOverseeEnum.values()) {
            if (code.equals(t.getCode())) {
                return t.desc;
            }
        }
        return StringUtils.EMPTY;
    }

    public boolean eq(String val) {
        return this.name().equals(val);
    }

}
