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

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

import java.util.Map;

/**
 * 预约单创建模式枚举
 * @author hongbo.pan
 * @date 2022/10/8
 */
@AllArgsConstructor
@Getter
public enum AppointCreateModeEnum {

    SHIPPER("1", "发货方模式"),
    CONSIGNEE("2", "收货方模式"),
    SHIP("3", "运单模式"),
    LOADING("4", "派车单模式"),
    ;

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

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

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

}
