package com.prolog.rdc.tms.constant.enums;

import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

/**
 * 司机接单状态枚举
 * @author hongbo.pan
 * @date 2022/11/30
 */
@AllArgsConstructor
@Getter
public enum DriverReceiveStatusEnum {

    N("N", "未接单"),
    A("A", "已接单"),
    ;

    private static Map<String, DriverReceiveStatusEnum> enumMap = Maps.newHashMap();
    private String code;
    private String desc;

    static {
        for(DriverReceiveStatusEnum as : DriverReceiveStatusEnum.values()) {
            enumMap.put(as.code, as);
        }
    }

    public static DriverReceiveStatusEnum getByCode(String code) {
        return  enumMap.get(code);
    }

}
