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

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

import java.util.Map;

/**
 * 导入价格表枚举
 * @author
 * @date 2023/4/11
 */
@AllArgsConstructor
@Getter
public enum PriceModeEnum {

    SHIPPER(1, "托运价格"),
    CARRIER(2, "承运价格"),
    DRIVER(3, "司机价格"),
    ;
    private static Map<Integer, PriceModeEnum> enumMap = Maps.newHashMap();
    private Integer code;
    private String desc;

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

    public static PriceModeEnum getByCode(Integer code) {
        return  enumMap.get(code);
    }

}
